Close all pipeline todos at once when retrying it
This commit is contained in:
parent
25b3b2e5bc
commit
9c37a26cc7
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue