diff options
Diffstat (limited to 'lib/gitlab/ci/pipeline/chain/populate.rb')
-rw-r--r-- | lib/gitlab/ci/pipeline/chain/populate.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/populate.rb b/lib/gitlab/ci/pipeline/chain/populate.rb index 69b8a8fc68f..7a2a1c6a80b 100644 --- a/lib/gitlab/ci/pipeline/chain/populate.rb +++ b/lib/gitlab/ci/pipeline/chain/populate.rb @@ -8,10 +8,7 @@ module Gitlab PopulateError = Class.new(StandardError) def perform! - ## - # Populate pipeline with block argument of CreatePipelineService#execute. - # - @command.seeds_block&.call(pipeline) + build_relations ## # Populate pipeline with all stages, and stages with builds. @@ -34,6 +31,18 @@ module Gitlab def break? pipeline.errors.any? end + + private + + def build_relations + ## + # Populate pipeline with block argument of CreatePipelineService#execute. + # + @command.seeds_block&.call(pipeline) + + # Allocate next IID. This operation must be outside of transactions of pipeline creations. + pipeline.ensure_project_iid! + end end end end |