From 057c0d7a5c062f3030bcc46614ef2442009002de Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 6 Apr 2017 21:32:56 +0800 Subject: Also track auto-cancelling in jobs, detail: Not only tracking auto-cancelling in pipelines, we'll also track this in jobs because pipelines could be retried and the information would get lost when this happened. Also erase auto-cancelling relation for pipelines when they're retried. --- app/presenters/ci/build_presenter.rb | 4 ++-- app/presenters/ci/pipeline_presenter.rb | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app/presenters') diff --git a/app/presenters/ci/build_presenter.rb b/app/presenters/ci/build_presenter.rb index d9970396cc6..c495c3f39bb 100644 --- a/app/presenters/ci/build_presenter.rb +++ b/app/presenters/ci/build_presenter.rb @@ -13,8 +13,8 @@ module Ci end def status_title - if canceled? && pipeline.auto_canceled? - "Job is redundant and is auto-canceled by Pipeline ##{pipeline.auto_canceled_by_id}" + if auto_canceled? + "Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" end end end diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index b8e74bf5509..a542bdd8295 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -3,7 +3,9 @@ module Ci presents :pipeline def status_title - "Pipeline is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" if auto_canceled? + if auto_canceled? + "Pipeline is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" + end end end end -- cgit v1.2.1