Commit 1965482f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Reprocess jobs in stages once when retrying pipeline

parent d16eed3b
...@@ -5,14 +5,19 @@ module Ci ...@@ -5,14 +5,19 @@ module Ci
raise Gitlab::Access::AccessDeniedError raise Gitlab::Access::AccessDeniedError
end end
pipeline.builds.failed_or_canceled.find_each do |build| pipeline.builds.failed_or_canceled.tap do |builds|
next unless build.retryable? stage_idx = builds.order('stage_idx ASC')
.pluck('DISTINCT stage_idx').first
pipeline.mark_as_processable_after_stage(stage_idx)
pipeline.mark_as_processable_after_stage(build.stage_idx) builds.find_each do |build|
next unless build.retryable?
Ci::RetryBuildService.new(project, current_user) Ci::RetryBuildService.new(project, current_user)
.reprocess(build) .reprocess(build)
end end
end
MergeRequests::AddTodoWhenBuildFailsService MergeRequests::AddTodoWhenBuildFailsService
.new(project, current_user) .new(project, current_user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment