summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-09-07 16:49:35 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-09-07 16:49:35 +0000
commitdc658a181c5d118cacf6afc0266a883fd496d8bc (patch)
treeabcaabffdb1d0e9dac3a5f998e4608236ab357cc
parentb027b3e037a328cc8a699d6befa796039c03b44b (diff)
parent5cfdcce0e6a31593919e0da41e1183298dc5e642 (diff)
downloadgitlab-ce-dc658a181c5d118cacf6afc0266a883fd496d8bc.tar.gz
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
-rw-r--r--app/presenters/commit_status_presenter.rb8
-rw-r--r--lib/gitlab/ci/status/build/failed.rb8
2 files changed, 14 insertions, 2 deletions
diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb
index a08f34e2335..65e77ea3f92 100644
--- a/app/presenters/commit_status_presenter.rb
+++ b/app/presenters/commit_status_presenter.rb
@@ -11,10 +11,16 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated
runner_unsupported: 'Your runner is outdated, please upgrade your runner'
}.freeze
+ private_constant :CALLOUT_FAILURE_MESSAGES
+
presents :build
+ def self.callout_failure_messages
+ CALLOUT_FAILURE_MESSAGES
+ end
+
def callout_failure_message
- CALLOUT_FAILURE_MESSAGES.fetch(failure_reason.to_sym)
+ self.class.callout_failure_messages.fetch(failure_reason.to_sym)
end
def recoverable?
diff --git a/lib/gitlab/ci/status/build/failed.rb b/lib/gitlab/ci/status/build/failed.rb
index 508b4814631..2fa9a0d4541 100644
--- a/lib/gitlab/ci/status/build/failed.rb
+++ b/lib/gitlab/ci/status/build/failed.rb
@@ -13,6 +13,8 @@ module Gitlab
runner_unsupported: 'unsupported runner'
}.freeze
+ private_constant :REASONS
+
def status_tooltip
base_message
end
@@ -25,6 +27,10 @@ module Gitlab
build.failed?
end
+ def self.reasons
+ REASONS
+ end
+
private
def base_message
@@ -36,7 +42,7 @@ module Gitlab
end
def failure_reason_message
- REASONS.fetch(subject.failure_reason.to_sym)
+ self.class.reasons.fetch(subject.failure_reason.to_sym)
end
end
end