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
pipeline.auto_canceled_by = nil
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|
pipeline.run_after_commit { PipelineMetricsWorker.perform_async(pipeline.id) }
end
......
......@@ -21,8 +21,7 @@ module EE
@pipeline.cancel_running
retry_optimistic_lock(@pipeline) do
@pipeline.failure_reason = :activity_limit_exceeded
@pipeline.drop!
@pipeline.drop!(:activity_limit_exceeded)
end
# TODO, should we invalidate the pipeline
......
......@@ -18,8 +18,7 @@ module EE
return unless @limit.exceeded?
if @command.save_incompleted
@pipeline.failure_reason = :size_limit_exceeded
@pipeline.drop
@pipeline.drop!(:size_limit_exceeded)
end
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