Commit 6453eca1 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Pass pipeline failure reason to a transition event

parent 4a883f36
...@@ -126,6 +126,12 @@ module Ci ...@@ -126,6 +126,12 @@ module Ci
pipeline.auto_canceled_by = nil pipeline.auto_canceled_by = nil
end end
before_transition any => :failed do |pipeline, transition|
transition.args.first.try do |reason|
pipeline.failure_reason = reason
end
end
after_transition [:created, :pending] => :running do |pipeline| after_transition [:created, :pending] => :running do |pipeline|
pipeline.run_after_commit { PipelineMetricsWorker.perform_async(pipeline.id) } pipeline.run_after_commit { PipelineMetricsWorker.perform_async(pipeline.id) }
end end
......
...@@ -21,8 +21,7 @@ module EE ...@@ -21,8 +21,7 @@ module EE
@pipeline.cancel_running @pipeline.cancel_running
retry_optimistic_lock(@pipeline) do retry_optimistic_lock(@pipeline) do
@pipeline.failure_reason = :activity_limit_exceeded @pipeline.drop!(:activity_limit_exceeded)
@pipeline.drop!
end end
# TODO, should we invalidate the pipeline # TODO, should we invalidate the pipeline
......
...@@ -18,8 +18,7 @@ module EE ...@@ -18,8 +18,7 @@ module EE
return unless @limit.exceeded? return unless @limit.exceeded?
if @command.save_incompleted if @command.save_incompleted
@pipeline.failure_reason = :size_limit_exceeded @pipeline.drop!(:size_limit_exceeded)
@pipeline.drop
end end
error(@limit.message) error(@limit.message)
......
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