diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-03-22 18:51:15 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-04-16 12:22:23 +0300 |
commit | fb07863693affd1d34f66847bd81a2a9f5ef81a2 (patch) | |
tree | 161fc48e7584a829293fa13cedd241f3734060d8 /app/services/ci/create_pipeline_service.rb | |
parent | ef82859d7d8ea70b29f600193fc18bdf5aea895e (diff) |
Rewind IID on Ci::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/create_pipeline_service.rb')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 4 |
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 |