Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
f71a9de1
Commit
f71a9de1
authored
May 19, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exclude manual actions from cancelable jobs scope
parent
bdf62a19
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
changelogs/unreleased/fix-gb-exclude-manual-actions-from-cancelable-jobs.yml
...ed/fix-gb-exclude-manual-actions-from-cancelable-jobs.yml
+4
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+10
-0
No files found.
app/models/concerns/has_status.rb
View file @
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
...
...
changelogs/unreleased/fix-gb-exclude-manual-actions-from-cancelable-jobs.yml
0 → 100644
View file @
f71a9de1
---
title
:
Exclude manual actions when checking if pipeline can be canceled
merge_request
:
11562
author
:
spec/models/ci/pipeline_spec.rb
View file @
f71a9de1
...
@@ -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
...
...
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