Skip to content

Imported projects do not maintain ownership of issues and merge requests

Summary

Imported projects do not maintain ownership of issues and merge requests, on same server/group.

This bug was sparked after a desire to migrate from a private Gitlab back to Gitlab.com. The private gitlab instance users do not have same ID, and usernames so after fiddling back and forth with the project.json of the exported project, I still was not getting the desired results of having ownership maintained.

Then I took on creating in gitlab.com a project, exporting and importing to see if it worked. Results it does not. Commits are maintained, but not the rest.

Steps to reproduce

  1. Login as User 'C'

  2. Create a group in gitlab.com. Add User A (reporter), B (reporter), C (owner)

  3. Create a project in that gitlab.com. Add User A (dev), B (dev), C (owner)

  4. Populate the project with commits, issues, merge requests (from A, B, C)

  5. Export the project with Settings>General>Export project

  6. Go to Group and create new project (From import)

  7. The imported project will maintain correct users for commits but not for MR, Issues. Everything will have importer user as creator and the message "By XXX on 2019-02-21T15:00:42 (imported from GitLab project)"

Example Project

Source : https://gitlab.com/hmi_xma/fake_project

Reimported : https://gitlab.com/hmi_xma/fake_project_reimported

What is the current bug behavior?

All issues and Merge Requests users are replaced by importer user. The comment "By XXX on 2019-02-XXX (imported from GitLab project)" is added.

What is the expected correct behavior?

Users are correctly maintained.

Output of checks

This bug happens on GitLab.com

gitlab_import_bug

Possible fixes

No idea. @jameslopez @rpereira2 could you take a look ? The member mapper https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/gitlab/import_export/members_mapper.rb Should find users as they are from the same instance/group. But it still does not.

bug |"project import" ~"project export"