diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-09 13:20:58 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-09 13:20:58 +0300 |
commit | eb61b3b3aad9ff34d095a6ed2b5eda76170bef4f (patch) | |
tree | 8784c131da42e76e520e990ec915cdb73ee3f229 | |
parent | 19c4aec32d8f4f12fe5573734a6d6b005086a3cf (diff) | |
parent | 694f31dd40b7bfcdab57f40802df715961f1cbe6 (diff) |
Merge branch 'fix/gb/fix-skipped-manual-actions' into 'master'
Fix skipped manual actions issue in pipeline processing
Closes #30212
See merge request !11164
-rw-r--r-- | app/services/ci/process_pipeline_service.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/fix-gb-fix-skipped-manual-actions.yml | 4 | ||||
-rw-r--r-- | spec/services/ci/process_pipeline_service_spec.rb | 22 |
3 files changed, 27 insertions, 1 deletions
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb index 33edcd60944..25ba54ffa0d 100644 --- a/app/services/ci/process_pipeline_service.rb +++ b/app/services/ci/process_pipeline_service.rb @@ -50,7 +50,7 @@ module Ci when 'always' %w[success failed skipped] when 'manual' - %w[success] + %w[success skipped] else [] end diff --git a/changelogs/unreleased/fix-gb-fix-skipped-manual-actions.yml b/changelogs/unreleased/fix-gb-fix-skipped-manual-actions.yml new file mode 100644 index 00000000000..d8d4c668a44 --- /dev/null +++ b/changelogs/unreleased/fix-gb-fix-skipped-manual-actions.yml @@ -0,0 +1,4 @@ +--- +title: Fix skipped manual actions problem when processing the pipeline +merge_request: 11164 +author: diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb index cf773866a6f..1d0a28210fb 100644 --- a/spec/services/ci/process_pipeline_service_spec.rb +++ b/spec/services/ci/process_pipeline_service_spec.rb @@ -268,6 +268,24 @@ describe Ci::ProcessPipelineService, '#execute', :services do end end + context 'when there are only manual actions in stages' do + before do + create_build('image', stage_idx: 0, when: 'manual', allow_failure: true) + create_build('build', stage_idx: 1, when: 'manual', allow_failure: true) + create_build('deploy', stage_idx: 2, when: 'manual') + create_build('check', stage_idx: 3) + + process_pipeline + end + + it 'processes all jobs until blocking actions encountered' do + expect(all_builds_statuses).to eq(%w[manual manual manual created]) + expect(all_builds_names).to eq(%w[image build deploy check]) + + expect(pipeline.reload).to be_blocked + end + end + context 'when blocking manual actions are defined' do before do create_build('code:test', stage_idx: 0) @@ -441,6 +459,10 @@ describe Ci::ProcessPipelineService, '#execute', :services do builds.pluck(:name) end + def all_builds_names + all_builds.pluck(:name) + end + def builds_statuses builds.pluck(:status) end |