Skip to content

Resolve "GitLab Migration - Migrate Snippets with Notes and Awards"

Related to #339406 (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 Snippets migration when using Group Migration that includes projects (https://docs.gitlab.com/ee/user/group/import/).

The snippets should include their Notes and awards. This MR will only migrate DB data of snippets. Snippets repositories will be migrated on a separate MR. See separate issue: #343438 (closed)

The technical strategy for adding snippets migration with these 2 MRs is described in this comment: #339406 (comment 707741948)

Screenshots or screen recordings

Note that only one file is migrated in a snippet that has 2 files. This is because the snippet repo is not yet migrated. It will be done on a follow-up MR, as explained in this MR top description.

edited_snippet_test

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 Snippets in the newly created project. Add notes and emoji awards to it.
  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 snippets got imported with its notes and awards.

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