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
9c37a26c
Commit
9c37a26c
authored
Feb 15, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close all pipeline todos at once when retrying it
parent
25b3b2e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/services/ci/retry_build_service.rb
app/services/ci/retry_build_service.rb
+1
-1
app/services/ci/retry_pipeline_service.rb
app/services/ci/retry_pipeline_service.rb
+4
-0
spec/services/ci/retry_pipeline_service_spec.rb
spec/services/ci/retry_pipeline_service_spec.rb
+13
-0
No files found.
app/services/ci/retry_build_service.rb
View file @
9c37a26c
...
@@ -7,7 +7,7 @@ module Ci
...
@@ -7,7 +7,7 @@ module Ci
new_build
.
enqueue!
new_build
.
enqueue!
MergeRequests
::
AddTodoWhenBuildFailsService
MergeRequests
::
AddTodoWhenBuildFailsService
.
new
(
build
.
project
,
current_user
)
.
new
(
project
,
current_user
)
.
close
(
new_build
)
.
close
(
new_build
)
end
end
end
end
...
...
app/services/ci/retry_pipeline_service.rb
View file @
9c37a26c
...
@@ -12,6 +12,10 @@ module Ci
...
@@ -12,6 +12,10 @@ module Ci
.
reprocess
(
build
)
.
reprocess
(
build
)
end
end
MergeRequests
::
AddTodoWhenBuildFailsService
.
new
(
project
,
current_user
)
.
close_all
(
pipeline
)
pipeline
.
process!
pipeline
.
process!
end
end
...
...
spec/services/ci/retry_pipeline_service_spec.rb
View file @
9c37a26c
...
@@ -132,6 +132,19 @@ describe Ci::RetryPipelineService, '#execute', :services do
...
@@ -132,6 +132,19 @@ describe Ci::RetryPipelineService, '#execute', :services do
end
end
end
end
end
end
it
'closes all todos about failed jobs for pipeline'
do
expect
(
MergeRequests
::
AddTodoWhenBuildFailsService
)
.
to
receive_message_chain
(
:new
,
:close_all
)
service
.
execute
(
pipeline
)
end
it
'reprocesses the pipeline'
do
expect
(
pipeline
).
to
receive
(
:process!
)
service
.
execute
(
pipeline
)
end
end
end
context
'when user is not allowed to retry pipeline'
do
context
'when user is not allowed to retry pipeline'
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