Update Direct Transfer to create placeholder memberships
What does this MR do and why?
This Update Directs Transfer's MembersPipeline to create placeholder memberships when the Import::SourceUser is mapped to a Placeholder User; in other words, it isn't mapped to a real user.
With this implementation, MembersPipeline will perform the following actions:
- Create an Import::SourceUser and Placeholder user for every
user_idreturned by the member's GraphQL response when there is no corresponding Import::SourceUser with asource_user_identifierequal to theuser_id. - Create a membership when the corresponding Import::SourceUser is mapped to a real user
- Create a placeholder membership when the corresponding Import::SourceUser is mapped to a placeholder user
Related to #477845 (closed) and #443557 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Enable
importer_user_mappingandbulk_import_importer_user_mappingfeature flags. - Stage a small direct transfer migration of a group with projects on your localhost . Ensure the group and/or project has some members.
- After the import, reassign some of the contributions of a source user who was a member to a real user, and then as that user, accept the contribution assignment.
- During the contribution reassignment process, the user should be assigned the memberships that the source user had within the imported group/projects.
- Stage the migration again where the destination is the same top-level group as the first migration
- After the import, the user who accepted the reassignment should be automatically be added as member of the new imported group/project
Edited by Rodrigo Tomonari