Transfer group labels
What does this MR do and why?
Resolves #354890 (closed)
The MR updates Groups::TransferService to use the existing Labels::TransferService
to transfer labels for each project under the transferred group. #354890 (closed) describes why this is necessary. To provide a short summary, Groups::TransferService
does not currently copy/re-assign group labels. For example, if you were to transfer the GitLab project from the GitLab.org
group to the GitLab-com
group, the issues that may have the labels from the GitLab.org
group would still have them associated.
The change is shipped behind a feature flag for de-risking.
How to set up and validate locally
-
Enable the feature flag
Feature.enable(:group_labels_transfer)
-
Create the following domain objects.
-
Create a group named "Root group". As the name indicated, it should be a root group.
- Create a group label belonging to "Root group". Name it "orange".
-
Create a group named "Sub group". The group should belong to "Root group"
- Create a group label belonging to "Sub group". Name it "blue".
-
Create a project under "Sub group"
-
Create a project label belonging to the created project. Name it "red".
-
Create an issue. Assign ALL labels (orange, blue, and red) to the issue.
-
-
Create a group named "Root group 2". As the name indicated, it should be a root group.
- Transfer "Sub group" to "Root group 2".
Confirm that the project under "Sub group" has a new label titled "orange". Previously the labels from a parent group (the parent of the transferred group) were not copied.
Before transfer | After transfer |
---|---|
![]() |
![]() |
More cases are covered in the updated rspec file.