Resolve "GitLab Migration - Migrate Milestones and Events"
Related to #339417 (closed)
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
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
-
Feature.enable(:bulk_import)
. -
Feature.enable(:bulk_import_projects)
. - Create a top level group and project in it.
- Create milestones in the newly created project.
- Go to
/groups/new#import-group-pane
page and enter instance url and access token (needs to beapi
scope). - Select newly created group and click Import.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by João Alexandre Cunha