Skip to content

Add 'migrate_projects' bool flag for group bulk imports'

What does this MR do and why?

This MR adds migrate_projects bool flag to indicate if projects should be included when migrating groups using direct transfer. If it's set to false, migrated group (and any subgroups) won't include any projects. Defaults to true.

Depends on !108676 (merged)

Mentions #383332 (closed)

Screenshots or screen recordings

migrate_projects: true migrate_projects: false
migrate_projects_true.mov migrate_projects_false.mov

How to set up and validate locally

  1. Enable bulk_import_enabled application setting in admin settings or via rails console ApplicationSetting.first.update!(bulk_import_enabled: true)
  2. Enable bulk_import_projects feature flag via rails console: Feature.enable(:bulk_import_projects)
  3. Create a group with projects. Populate all entities with data (labels/issues/mrs/etc)
  4. Initiate a new bulk imports request with migrate_projects: false
POST http://gdk.test:3000/api/v4/bulk_imports
PRIVATE-TOKEN: TOKEN
Content-Type: application/json

{
  "configuration": {
    "url": "http://gdk.test:3000/",
    "access_token": "TOKEN"
  },
  "entities": [
    {
      "source_full_path": "mygroup",
      "source_type": "group_entity",
      "destination_slug": "destination",
      "destination_namespace": "namespace",
      "migrate_projects": false
    }
  ]
}
  1. Observe migrated group does not have projects included
  2. Initiate a new bulk imports request with migrate_projects: true
  3. Observe migrated group has projects included

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 George Koltsov

Merge request reports

Loading