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

Merge branch 'fix/gb/exclude-manual-actions-from-cancelable-jobs' into 'master'

Exclude manual actions when checking if pipeline can be canceled

Closes #31107

See merge request !11562
parents f5f99c90 f71a9de1
...@@ -82,7 +82,7 @@ module HasStatus ...@@ -82,7 +82,7 @@ module HasStatus
scope :failed_or_canceled, -> { where(status: [:failed, :canceled]) } scope :failed_or_canceled, -> { where(status: [:failed, :canceled]) }
scope :cancelable, -> do scope :cancelable, -> do
where(status: [:running, :pending, :created, :manual]) where(status: [:running, :pending, :created])
end end
end end
......
---
title: Exclude manual actions when checking if pipeline can be canceled
merge_request: 11562
author:
...@@ -854,6 +854,16 @@ describe Ci::Pipeline, models: true do ...@@ -854,6 +854,16 @@ describe Ci::Pipeline, models: true do
end end
end end
end end
context 'when there is a manual action present in the pipeline' do
before do
create(:ci_build, :manual, pipeline: pipeline)
end
it 'is not cancelable' do
expect(pipeline).not_to be_cancelable
end
end
end end
describe '#cancel_running' do describe '#cancel_running' do
......
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