Skip to content

Prevent pipeline creation while import is running

Marius Bobin requested to merge 423421-prevent-new-pipelines-on-import into master

What does this MR do and why?

Prevent pipeline creation while import is running

Because the imports don't get the internal ids from the database sequence, creating new pipelines while the import is still running will attempt to insert duplicate iid values in the ci_pipelines table. This fix prevents new pipelines from being created while the import is running. After the import is completed, the internal_ids row for the project will be deleted and the new pipeline will recreate it with the appropriate value.

Changelog: fixed

How to set up and validate locally

  1. Export a project with enough pipelines(100+), or use this one: 2023-09-07_10-57-261_root_test-export-project_export.tar.gz
  2. Import the project: Projects > New > Import project > GitLab project
  3. While the import is running, go to the pipelines page and run a new pipeline.
  4. On master this should fail with a duplicate internal id error:

image

  1. On this MR it will prevent the pipeline creation:

image

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #423421 (closed)

Edited by Marius Bobin

Merge request reports