Builds Groups::TransferService
What does this MR do?
It adds the ability to transfer a single group to another group, also includes the ability to convert a group into group-root
Are there points in the code the reviewer needs to double check?
- General structure for the new services
- Double check that the services don't leave any loose end.
Why was this MR needed?
From #31885 (moved): With the nested groups feature introduced it would be useful to allow move an individual group companyname
group to an existing group as a subgroup under it.it would be useful to allow move an individual group companyname
group to an existing group as a subgroup under it.
Lists of Warnings
-
This merge request does not transfer group-member relationships. Currently when transferring
group1
into anothergroup2
, if a user is a member ofgroup1
but not a member ofgroup2
, it'll lose all the access to the subgroup. An idea for solving this could be to transfer group member relationships fromgroup1
togroup2
, but we should be very clear to the user we're doing so. -
This merge request only contains the backend implementation, design discussion for this new section is being currently discussed in #31885 (moved)
Screenshots (if relevant)
Without the option of "Convert to root group":
With the option of "Convert to root group":
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together
What are the relevant issue numbers?
To do
-
Display the UI only if groups supports nested groups. This is the method to use for it -
Fix full_path_was
implementation to search for the old parent and not the old path -
Call move_dir
withinGroups::TransferService
-
Wrap the main method from Groups::TransferService
withing a transaction to ensure integrity -
Make it possible to turn a subgroup in a root-group, by "transfering" it to no group at all. -
Update group's grandchildren and great-grandchildren. An idea is adapt Gitlab::ProjectAuthorizations::WithNestedGroups
for groups -
Refactor, refactor, refactor -
Move transfer error handling up to the controller to make the services more consistent with the current services