Commit f71a9de1 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Exclude manual actions from cancelable jobs scope

parent 2d7821daa601
......@@ -82,7 +82,7 @@ def all_state_names
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 @@ def create_pipeline(status, ref, sha)
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