Commit dc658a18 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '7204-follow-up-protected-environments-technical-debt-ce' into 'master'

CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7256

See merge request gitlab-org/gitlab-ce!21545
parents b027b3e0 5cfdcce0
...@@ -11,10 +11,16 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated ...@@ -11,10 +11,16 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
runner_unsupported: 'Your runner is outdated, please upgrade your runner' runner_unsupported: 'Your runner is outdated, please upgrade your runner'
}.freeze }.freeze
private_constant :CALLOUT_FAILURE_MESSAGES
presents :build presents :build
def self.callout_failure_messages
CALLOUT_FAILURE_MESSAGES
end
def callout_failure_message def callout_failure_message
CALLOUT_FAILURE_MESSAGES.fetch(failure_reason.to_sym) self.class.callout_failure_messages.fetch(failure_reason.to_sym)
end end
def recoverable? def recoverable?
......
...@@ -13,6 +13,8 @@ module Gitlab ...@@ -13,6 +13,8 @@ module Gitlab
runner_unsupported: 'unsupported runner' runner_unsupported: 'unsupported runner'
}.freeze }.freeze
private_constant :REASONS
def status_tooltip def status_tooltip
base_message base_message
end end
...@@ -25,6 +27,10 @@ module Gitlab ...@@ -25,6 +27,10 @@ module Gitlab
build.failed? build.failed?
end end
def self.reasons
REASONS
end
private private
def base_message def base_message
...@@ -36,7 +42,7 @@ module Gitlab ...@@ -36,7 +42,7 @@ module Gitlab
end end
def failure_reason_message def failure_reason_message
REASONS.fetch(subject.failure_reason.to_sym) self.class.reasons.fetch(subject.failure_reason.to_sym)
end end
end end
end end
......
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