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:

  1. Create an Import::SourceUser and Placeholder user for every user_id returned by the member's GraphQL response when there is no corresponding Import::SourceUser with a source_user_identifier equal to the user_id.
  2. Create a membership when the corresponding Import::SourceUser is mapped to a real user
  3. 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

  1. Enable importer_user_mapping and bulk_import_importer_user_mapping feature flags.
  2. Stage a small direct transfer migration of a group with projects on your localhost . Ensure the group and/or project has some members.
  3. 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.
  4. During the contribution reassignment process, the user should be assigned the memberships that the source user had within the imported group/projects.
  5. Stage the migration again where the destination is the same top-level group as the first migration
  6. 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

Merge request reports

Loading