Skip to content

Add namespace settings attributes pipeline to BulkImports

What does this MR do and why?

Add a new pipelines to the bulk import group to migrate the prevent_sharing_groups_outside_hierarchy that are stored in the namespace_settings table.

Related to: #353955 (closed)

Implementation Details

This pipeline download and decompress namespace_settings.ndjson.gz that is generated in the source instance, then fetches from the NDJSON file the attributes that need to be imported and finally use the Groups::UpdateService to update the namespace_settings associated with the group.

At the moment, only the attribute prevent_sharing_groups_outside_hierarchy is being read from the file. But in the future, we can use the pipeline to migrate extra attributes of the namespace_settings.

Bear in mind that the namespace_settings relation had to be added to the export process as the BulkImport uses the same code to generate the export file. Meaning that the exported group bundle file will now contain the namespace_settings.ndjson file. But the file is configured to be ignored during the import of the bundle file because the Import/Export can't handle the namespace_settings relation correctly.

This pipeline should be compatible with GitLab instances that are outdated and still don't generate the namespace_settings.ndjson file because if the file can't be downloaded, the pipeline will be marked as failed and the import process will continue.

Screenshots or screen recordings

namespace_settings_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 members from sending invitations to groups outside of GROUP_NAME and its subgroups setting
  4. Migrate the top-level group using GitLab Group Migration as a top-level group
  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

Loading