Skip to content

Resolve "GitLab Migration - Migrate Snippets Repositories"

Related to #343438 (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?

Adds a new Snippet scope

We need to match snippets by project, title and created_at(disregarding milliseconds).

Most importantly, we're introducing Snippet Repository Migration to GitLab Migration

We firstly migrated snippets DB data on !73271 (merged). Now this MR focus on migrating their repositories.

The idea is to create a SnippetsRepositoryPipeline that will read from GraphQL, with pagination, the snippets for a the migrated project, while collecting their repositories' url and cloning their repositories from the source GitLab instance to the GitLab target instance.

Screenshots or screen recordings

edited_snippet_repo

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, with at least 2 files. 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 both their files.

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 Mayra Cabrera

Merge request reports

Loading