Commit f71a9de1 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Exclude manual actions from cancelable jobs scope

parent bdf62a19
......@@ -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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment