Import of a project with merge request comments and deletion of the source branch fails
Summary
Import of a project with merge request comments and deletion of the source branch fails.
Steps to reproduce
- Create new project "export-import-bug" https://gitlab.com/m.lueder.mf/export-import-bug
- Add new Issue "Testissue"
- Create merge request
- Create and commit a file in Web IDE
- In the MR, add an inline comment to the newly created file and click "Add comment now"
- Click "Resolve discussion" below the comment
- Click "Resolve WIP status"
- Check "Delete source branch"
- Click "Merge"
- Wait until the source branch is removed
- Export the project
- Import the exported project as "export-import-bug-import" https://gitlab.com/m.lueder.mf/export-import-bug-import/
Example Project
Export project: https://gitlab.com/m.lueder.mf/export-import-bug
Imported project: https://gitlab.com/m.lueder.mf/export-import-bug-import/
What is the current bug behavior?
There is no merge request in the imported project.
What is the expected correct behavior?
There is one merge request in the imported project.
Relevant logs
The following error is logged in the importer.log on our inhouse GitLab-CE server:
{
"severity": "ERROR",
"time": "2019-06-29T16:52:28.088Z",
"correlation_id": "XXXX",
"importer": "Import/Export",
"import_jid": "XXXXXX",
"project_id": 100,
"project_path": "XXX/YYYY",
"message": "Failed to replace merge_requests because one or more of the new records could not be saved. Notes is invalid",
"caller": "/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/import_export/project_tree_restorer.rb:37:in `rescue in restore'"
}