Skip to content

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 another group2, if a user is a member of group1 but not a member of group2, it'll lose all the access to the subgroup. An idea for solving this could be to transfer group member relationships from group1 to group2, 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":

Screen_Shot_2017-09-12_at_7.00.02_PM

With the option of "Convert to root group":

Screen_Shot_2017-09-12_at_6.59.37_PM

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#31885 (moved)

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 within Groups::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
Edited by Mayra Cabrera

Merge request reports