debian-mirror-gitlab/app/presenters/ci/pipeline_presenter.rb

23 lines
518 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
module Ci
class PipelinePresenter < Gitlab::View::Presenter::Delegated
2018-03-17 18:26:18 +05:30
FAILURE_REASONS = {
config_error: 'CI/CD YAML configuration error!'
}.freeze
2017-08-17 22:00:37 +05:30
presents :pipeline
2018-03-17 18:26:18 +05:30
def failure_reason
return unless pipeline.failure_reason?
FAILURE_REASONS[pipeline.failure_reason.to_sym] ||
pipeline.failure_reason
end
2017-08-17 22:00:37 +05:30
def status_title
if auto_canceled?
"Pipeline is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}"
end
end
end
end