From 90fa4e7e54dc4f272b5f6a853f07b5e57a2a6cc4 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 29 Sep 2017 11:14:00 +0200 Subject: Move part of pipeline presenter to main CE file --- app/presenters/ci/pipeline_presenter.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/presenters') diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index a542bdd8295..5e393e95c80 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -1,6 +1,13 @@ module Ci class PipelinePresenter < Gitlab::View::Presenter::Delegated - presents :pipeline + FAILURE_REASONS = {} + + def failure_reason + return unless pipeline.failure_reason? + + FAILURE_REASONS[pipeline.failure_reason.to_sym] || + pipeline.failure_reason + end def status_title if auto_canceled? -- cgit v1.2.1 From 123da5fbe8f5dee13278b1ef9aff79ff9adcef90 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 3 Oct 2017 13:18:59 +0200 Subject: Improve specs for pipeline failure reason presenter Conflicts: app/presenters/ci/pipeline_presenter.rb --- app/presenters/ci/pipeline_presenter.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/presenters') diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index 5e393e95c80..099b4720fb6 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -1,6 +1,10 @@ module Ci class PipelinePresenter < Gitlab::View::Presenter::Delegated - FAILURE_REASONS = {} + FAILURE_REASONS = { + config_error: 'CI/CD YAML configuration error!' + }.freeze + + presents :pipeline def failure_reason return unless pipeline.failure_reason? -- cgit v1.2.1