Skip to content

Resolve "GitLab Migration - Migrate Milestones and Events"

Related to #339417 (closed)

this feature is behind bulk_import_projects feature flag that is currently off by default (and disabled on .com).

What does this MR do and why?

This MR adds Milestones migration when using Group Migration that includes projects (https://docs.gitlab.com/ee/user/group/import/). It's identical to group Milestone migration, that is why MigrationsPipeline has been updated from being groups only to being used in both Projects and Groups.

To achieve the above we will rename:

BulkImports::Groups::Pipelines::MilestonesPipeline BulkImports::Common::Pipelines::MilestonesPipeline.

Screenshots or screen recordings

Milestones

edited-milestones-migration

Events

[10] pry(main)> Rails.logger.level = :info
=> :info
[11] pry(main)> project = Project.last
=> #<Project id:72 Commit451/twitter-2/typeahead-js>>
[12] pry(main)> project.milestones.first.events
=> [#<Event:0x00007fbd43302778
  project_id: 72,
  author_id: 1,
  target_id: 95,
  created_at: Thu, 12 Aug 2021 19:12:49.810000000 UTC +00:00,
  updated_at: Thu, 12 Aug 2021 19:12:49.810000000 UTC +00:00,
  action: "created",
  target_type: "Milestone",
  group_id: nil,
  fingerprint: nil,
  id: 622>]

How to set up and validate locally

  1. Feature.enable(:bulk_import).
  2. Feature.enable(:bulk_import_projects).
  3. Create a top level group and project in it.
  4. Create milestones in the newly created project.
  5. Go to /groups/new#import-group-pane page and enter instance url and access token (needs to be api scope).
  6. Select newly created group and click Import.
  7. Wait for Group import to complete and verify imported project's milestones.

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 João Alexandre Cunha

Merge request reports

Loading