diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-25 17:11:56 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-25 17:11:56 +0300 |
commit | e1285c1d8ad2c7a5ed556bd5296fbe4afcacb16d (patch) | |
tree | 6e1595e7774e1fc8a8782e92e58b0bed20ffc895 /app/services/ci/process_pipeline_service.rb | |
parent | 94100d4e722ad61fec3e8ab3f9889ffabba1100f (diff) |
Restore method that ensures builds being created
Diffstat (limited to 'app/services/ci/process_pipeline_service.rb')
-rw-r--r-- | app/services/ci/process_pipeline_service.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb index e6bd1d1460c..2e028c44d8b 100644 --- a/app/services/ci/process_pipeline_service.rb +++ b/app/services/ci/process_pipeline_service.rb @@ -5,6 +5,8 @@ module Ci def execute(pipeline) @pipeline = pipeline + ensure_created_builds! # TODO, remove me in 9.0 + new_builds = stage_indexes_of_created_builds.map do |index| process_stage(index) @@ -67,5 +69,18 @@ module Ci def created_builds pipeline.builds.created end + + # This method is DEPRECATED and should be removed in 9.0. + # + # We need it to maintain backwards compatibility with previous versions + # when builds were not created within one transaction with the pipeline. + # + def ensure_created_builds! + return if created_builds.any? + + Ci::CreatePipelineBuildsService + .new(project, current_user) + .execute(pipeline) + end end end |