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
Tatuya Kamada
gitlab-ce
Commits
0ea7f32a
Commit
0ea7f32a
authored
Oct 17, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make cancelled pipelines being able to retry
Closes #23326
parent
cb8654e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+19
-5
No files found.
app/models/ci/pipeline.rb
View file @
0ea7f32a
...
...
@@ -152,7 +152,7 @@ module Ci
def
retryable?
builds
.
latest
.
any?
do
|
build
|
build
.
failed?
&&
build
.
retryable?
(
build
.
failed?
||
build
.
canceled?
)
&&
build
.
retryable?
end
end
...
...
spec/models/ci/pipeline_spec.rb
View file @
0ea7f32a
...
...
@@ -88,24 +88,38 @@ describe Ci::Pipeline, models: true do
context
'no failed builds'
do
before
do
FactoryGirl
.
create
:ci_build
,
name:
"rspec"
,
pipeline:
pipeline
,
status:
'success'
create_build
(
'rspec'
,
'success'
)
end
it
'
be
not retryable'
do
it
'
is
not retryable'
do
is_expected
.
to
be_falsey
end
context
'one canceled job'
do
before
do
create_build
(
'rubocop'
,
'canceled'
)
end
it
'is retryable'
do
is_expected
.
to
be_truthy
end
end
end
context
'with failed builds'
do
before
do
FactoryGirl
.
create
:ci_build
,
name:
"rspec"
,
pipeline:
pipeline
,
status:
'running'
FactoryGirl
.
create
:ci_build
,
name:
"rubocop"
,
pipeline:
pipeline
,
status:
'failed'
create_build
(
'rspec'
,
'running'
)
create_build
(
'rubocop'
,
'failed'
)
end
it
'
be
retryable'
do
it
'
is
retryable'
do
is_expected
.
to
be_truthy
end
end
def
create_build
(
name
,
status
)
create
(
:ci_build
,
name:
name
,
status:
status
,
pipeline:
pipeline
)
end
end
describe
'#stages'
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