Skip to content

Update way of project repository migration during Gitlab Migration

What does this MR do and why?

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

This MR:

  1. Updates the way we import repository as part of GitLab Project Migration (https://docs.gitlab.com/ee/user/group/import/) from using Gitaly fetch_as_mirror API, to importing using repository bundle that is exported using relation export API
  2. It fixes an issue with importing Diff comments on MRs with deleted source branch (and potentially other repository related issues where we need to have all git refs present during import)
  3. Sets RepositoryBundlePipeline minimum_sourve_version to 15.1, since this is when repository bundle export was added to the API
  4. Sets RepositoryPipeline to have maximum_source_version to 15.0 in order to skip it from 15.1, since we have a new way of importing
  5. Slightly refactors BulkImports::PipelineWorker#perform for easier read

Mentions #358776 (closed)

Screenshots or screen recordings

repositorybundle2

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 a new MR and leave some diff comments
  5. Merge MR and delete source branch
  6. Go to /groups/new#import-group-pane page and enter instance url and access token (needs to be api & read_repository scope).
  7. Select newly created group and click Import.
  8. Wait for Group import to complete and verify imported project MR diff comments. They should be present.
  9. Check bulk_import_failures table, there should be no errors related to diff notes

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