Prevent pipeline creation while import is running
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
- Export a project with enough pipelines(100+), or use this one: 2023-09-07_10-57-261_root_test-export-project_export.tar.gz
- Import the project:
Projects > New > Import project > GitLab project
- While the import is running, go to the pipelines page and run a new pipeline.
- On
master
this should fail with a duplicate internal id error:
- On this MR it will prevent the pipeline creation:
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.
Related to #423421 (closed)
Edited by Marius Bobin