Skip to content

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

group_attributes

How to set up and validate locally

  1. Create a top-level group with subgroups
  2. Navigate to Group > Settings > General > Permissions and group features
  3. Check the Prevent adding new members to projects within this group setting
  4. Migrate the top-level group using GitLab Group Migration into a top-level group in the destination instance
  5. Wait for the migration to complete and navigate to the settings page of the newly created group
  6. 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.

Edited by Rodrigo Tomonari

Merge request reports