Replicate inherited membership structure on direct transfer import of top-level group
This issue was created from this discussion !148220 (comment 1869843637).
Problem
Inherited memberships are not reliably imported in Direct Transfer, leading to inherited members being imported as direct members.
For example, at present if the source group has the following structure:
ParentGroup -> SubGroup [members(User1, User2)] -> Project
When importing Project
we check if a user has an existing membership, which includes inherited membership.
As the membership of SubGroup
may not yet have been imported the check for existing membership can determine that a member is not yet a member and so we will create them as a direct member.
Instead, the correct behaviour would be for them not to be created as a direct member of Project
, which would allow them to just be an inherited member through SubGroup
.
Proposal
The group membership import stage should happen earlier than the project import stage.
This will mean that when a project comes to be imported its parent group's members will have been imported, and the check of existing inherited membership will find an existing inherited membership.
This might mean we push projects to import in stage 2
and therefore need to bump subgroups
and finisher
to a stage 3
and 4
.
Note: A group's subgroups are already imported at a stage after its members are imported, so inherited group memberships are unaffected.