Commit 49daa959 authored by Stan Hu's avatar Stan Hu

Fix merge requests not importing for older projects

This restores the merge request commit user fields in import_export.yml
for the import case.

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73307 dropped
these YAML fields because supposedly the import would fail if the
database columns didn't exist, but I haven't found that to be the
case. I tested with an import with:

1. Project generated in v13.12 that had these columns.
2. Project generated with the latest nightly build.

The import works in either case because we call
`MergeRequestDiffCommit.new` with the sanitized attributes in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73307.

Based on the discussion in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72219, these
attributes are needed for **import** but excluded for **export**. I
think Yorick might have assumed that since the code in
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73307 manually
removed these fields, we wouldn't need them anymore. However, without
these attributes, imports were failing to import with an older GitLab
version (e.g. v13.12) because the attributes were sanitized before the
importer got a chance to use them.

Changelog: fixed
parent 92c97653
...@@ -393,6 +393,10 @@ included_attributes: ...@@ -393,6 +393,10 @@ included_attributes:
- :sorted - :sorted
- :diff_type - :diff_type
merge_request_diff_commits: merge_request_diff_commits:
- :author_name
- :author_email
- :committer_name
- :committer_email
- :relative_order - :relative_order
- :sha - :sha
- :authored_date - :authored_date
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment