Commit 71db3b1c authored by Kamil Trzciński's avatar Kamil Trzciński

Make all future skipped builds as processable when retrying a build

parent 62e2989b
Pipeline #3983348 failed with stages
in 611 minutes and 3 seconds
......@@ -62,6 +62,7 @@ module Ci
status_event: 'enqueue'
)
MergeRequests::AddTodoWhenBuildFailsService.new(build.project, nil).close(new_build)
build.pipeline.mark_as_processable_after_stage(build.stage_idx)
new_build
end
end
......
......@@ -136,6 +136,10 @@ module Ci
end
end
def mark_as_processable_after_stage(stage_idx)
builds.skipped.where('stage_idx > ?', stage_idx).each(&:process)
end
def latest?
return false unless ref
commit = project.commit(ref)
......
......@@ -30,6 +30,10 @@ class CommitStatus < ActiveRecord::Base
transition [:created, :skipped] => :pending
end
event :process do
transition skipped: :created
end
event :run do
transition pending: :running
end
......
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