Skip to content

Add diff attribute back to excluded list for Import/Export

What does this MR do and why?

#346937 (closed)

This MR fixes an issue that happens during Project Import/Export that has binary merge request diff files. When we try to serialize binary diff file to json Encoding::UndefinedConversionError occurs.

This exception started occuring when we removed diff attribute from the list of excluded attributes on export in 99e2f4ba (at least some of the occurrences).

In order to import diffs properly we export utf8_diff value that does the serialization properly, and then on import update diff attribute with utf8_diff value https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/import_export/project/relation_factory.rb#L134

This MR puts diff back to the list of excluded attributes and updates the way we setup diff, by updating diff value on parsed_relation_hash, instead of @relation_hash, after all of the cleaning of attributes has been complete.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by George Koltsov

Merge request reports

Loading