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
Boxiang Sun
gitlab-ce
Commits
c6301865
Commit
c6301865
authored
Aug 10, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allows to cancel a Created job
parent
d867a58c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
changelogs/unreleased/48320-cancel-a-created-job.yml
changelogs/unreleased/48320-cancel-a-created-job.yml
+5
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+6
-0
No files found.
app/models/ci/build.rb
View file @
c6301865
...
@@ -226,7 +226,7 @@ module Ci
...
@@ -226,7 +226,7 @@ module Ci
end
end
def
cancelable?
def
cancelable?
active?
active?
||
created?
end
end
def
retryable?
def
retryable?
...
...
changelogs/unreleased/48320-cancel-a-created-job.yml
0 → 100644
View file @
c6301865
---
title
:
Allows to cancel a Created job
merge_request
:
20635
author
:
Jacopo Beschi @jacopo-beschi
type
:
added
spec/models/ci/build_spec.rb
View file @
c6301865
...
@@ -1103,6 +1103,12 @@ describe Ci::Build do
...
@@ -1103,6 +1103,12 @@ describe Ci::Build do
it
{
is_expected
.
to
be_cancelable
}
it
{
is_expected
.
to
be_cancelable
}
end
end
context
'when build is created'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
)
}
it
{
is_expected
.
to
be_cancelable
}
end
end
end
context
'when build is not cancelable'
do
context
'when build is not cancelable'
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