Class: Ci::BuildPresenter
- Inherits:
-
ProcessablePresenter
- Object
- SimpleDelegator
- Gitlab::View::Presenter::Delegated
- CommitStatusPresenter
- ProcessablePresenter
- Ci::BuildPresenter
- Defined in:
- app/presenters/ci/build_presenter.rb
Constant Summary
Constants inherited from CommitStatusPresenter
CommitStatusPresenter::TROUBLESHOOTING_DOC
Instance Method Summary collapse
- #execute_in ⇒ Object
- #failure_message ⇒ Object
- #status_title(status = detailed_status) ⇒ Object
- #trigger_variables ⇒ Object
Methods inherited from CommitStatusPresenter
#callout_failure_message, callout_failure_messages
Methods inherited from Gitlab::View::Presenter::Delegated
Methods included from Gitlab::Utils::DelegatorOverride
#delegator_override, #delegator_override_with, #delegator_target, validator, validators, verify!
Methods included from Gitlab::View::Presenter::Base
#__subject__, #can?, #declarative_policy_delegate, #is_a?, #path_with_line_numbers, #present, #url_builder, #web_path, #web_url
Methods included from Gitlab::Allowable
Methods included from Gitlab::Routing
includes_helpers, redirect_legacy_paths, url_helpers
Constructor Details
This class inherits a constructor from Gitlab::View::Presenter::Delegated
Instance Method Details
#execute_in ⇒ Object
26 27 28 |
# File 'app/presenters/ci/build_presenter.rb', line 26 def execute_in scheduled? && scheduled_at && [0, scheduled_at - Time.now].max end |
#failure_message ⇒ Object
30 31 32 |
# File 'app/presenters/ci/build_presenter.rb', line 30 def if build.failed? end |
#status_title(status = detailed_status) ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/presenters/ci/build_presenter.rb', line 7 def status_title(status = detailed_status) if auto_canceled? "Job is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" else tooltip_for_badge(status) end end |
#trigger_variables ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/presenters/ci/build_presenter.rb', line 15 def trigger_variables return [] unless trigger_request @trigger_variables ||= if pipeline.variables.any? pipeline.variables.map(&:to_hash_variable) else trigger_request.user_variables end end |