summaryrefslogtreecommitdiff
path: root/app/services/ci
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-03-22 16:51:15 +0100
committerKamil Trzciński <ayufan@ayufan.eu>2019-04-16 11:22:23 +0200
commitfb07863693affd1d34f66847bd81a2a9f5ef81a2 (patch)
tree161fc48e7584a829293fa13cedd241f3734060d8 /app/services/ci
parentef82859d7d8ea70b29f600193fc18bdf5aea895e (diff)
downloadgitlab-ce-fb07863693affd1d34f66847bd81a2a9f5ef81a2.tar.gz
Rewind IID on Ci::Pipelinesrewind-iid-on-pipelines
If no pipeline is created we currently have IID gap. This is due to fact that we generate IID not on save, but rather ahead of time. This results, us, losing IIDs.
Diffstat (limited to 'app/services/ci')
-rw-r--r--app/services/ci/create_pipeline_service.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 41dee4e5641..252f5778644 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -55,6 +55,10 @@ module Ci
end
end
+ # If pipeline is not persisted, try to recover IID
+ pipeline.reset_project_iid unless pipeline.persisted? ||
+ Feature.disabled?(:ci_pipeline_rewind_iid, project, default_enabled: true)
+
pipeline
end