Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
a91a0ef90357
Commit
f71a9de1
authored
May 19, 2017
by
Grzegorz Bizon
Browse files
Exclude manual actions from cancelable jobs scope
parent
2d7821daa601
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/models/concerns/has_status.rb
View file @
a91a0ef9
...
...
@@ -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
...
...
changelogs/unreleased/fix-gb-exclude-manual-actions-from-cancelable-jobs.yml
0 → 100644
View file @
a91a0ef9
---
title
:
Exclude manual actions when checking if pipeline can be canceled
merge_request
:
11562
author
:
spec/models/ci/pipeline_spec.rb
View file @
a91a0ef9
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment