提交 fe1a814b 编写于 作者: K 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
......@@ -82,7 +82,7 @@ module HasStatus
scope :failed_or_canceled, -> { where(status: [:failed, :canceled]) }
scope :cancelable, -> do
where(status: [:running, :pending, :created, :manual])
where(status: [:running, :pending, :created])
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
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
describe '#cancel_running' do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册