Commit eb61b3b3 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'fix/gb/fix-skipped-manual-actions' into 'master'

Fix skipped manual actions issue in pipeline processing

Closes #30212

See merge request !11164
parents 19c4aec3 694f31dd
...@@ -50,7 +50,7 @@ module Ci ...@@ -50,7 +50,7 @@ module Ci
when 'always' when 'always'
%w[success failed skipped] %w[success failed skipped]
when 'manual' when 'manual'
%w[success] %w[success skipped]
else else
[] []
end end
......
---
title: Fix skipped manual actions problem when processing the pipeline
merge_request: 11164
author:
...@@ -268,6 +268,24 @@ describe Ci::ProcessPipelineService, '#execute', :services do ...@@ -268,6 +268,24 @@ describe Ci::ProcessPipelineService, '#execute', :services do
end end
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 context 'when blocking manual actions are defined' do
before do before do
create_build('code:test', stage_idx: 0) create_build('code:test', stage_idx: 0)
...@@ -441,6 +459,10 @@ describe Ci::ProcessPipelineService, '#execute', :services do ...@@ -441,6 +459,10 @@ describe Ci::ProcessPipelineService, '#execute', :services do
builds.pluck(:name) builds.pluck(:name)
end end
def all_builds_names
all_builds.pluck(:name)
end
def builds_statuses def builds_statuses
builds.pluck(:status) builds.pluck(:status)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment