Add group attributes pipeline to BulkImports
What does this MR do and why?
Add a new pipelines to the bulk import group to migrate the attributes membership_lock
that is stored in the table namespace
.
Related to: #353955 (closed)
Implementation Details
It was opted in to use a separated pipeline to import the group attributes instead of using the current pipeline BulkImports::Groups::Pipelines::GroupPipeline that uses GraphQL because it's troublesome to use the GraphQL API as the migration feature would have to know which fields are available in the API before building the GraphQL query. More info.
So instead of using GraphQL, the new pipeline read the data from the export file that is generated during the migration.
Pipeline BulkImports::Groups::Pipelines::GroupAttributesPipeline
This pipeline download and decompress self.json.gz
that is generated in the source instance, then fetches from the JSON file the attributes that need to be imported and finally use the Groups::UpdateService
to update the group.
At the moment, only the attribute membership_lock
is being read from the file. But in the future, we can use the pipeline to migrate extra attributes of the group.
The attribute to fetch from the JSON file is hardcoded in the pipeline. Perhaps we could use list of attributes that were exported from the import_export.yml, but I'm not sure if we want to use the same list of attributes.
Screenshots or screen recordings
How to set up and validate locally
- Create a top-level group with subgroups
- Navigate to Group > Settings > General > Permissions and group features
- Check the
Prevent adding new members to projects within this group
setting - Migrate the top-level group using GitLab Group Migration into a top-level group in the destination instance
- Wait for the migration to complete and navigate to the settings page of the newly created group
- Check that the setting has been migrated
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.