Ensure members mapper always runs on Project Import
What does this MR do?
This MR fixes a bug where project members are not added to the Imported Project, if a project does not have any issues/MRs/other relations that users can author.
Consider the following scenario:
- A user creates an empty project (with or without repository)
- Same user invites several users to members
- User exports and imports created project
- Members list of imported project will only include project creator
This is happening because members_mapper.map
never ran https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/import_export/base/relation_factory.rb#L115-114
Even if project members never authored anything, it should still be possible to import project members. For this reason, I am adding mapping of users before relation tree restoration, so that all members are added before any relation is created. This will ensure that even if there are no issues or MRs in the projects, users are still being added as members (when performing import as admin that is as per https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/import_export/members_mapper.rb#L7-6)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team