Skip to content
Snippets Groups Projects
Commit 5cfdcce0 authored by Mayra Cabrera's avatar Mayra Cabrera
Browse files

Introduce class methods so CE constants can be easily overridden on EE

parent c903fcd5
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -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?
Loading
Loading
Loading
Loading
@@ -13,6 +13,8 @@ module Gitlab
runner_unsupported: 'unsupported runner'
}.freeze
 
private_constant :REASONS
def status_tooltip
base_message
end
Loading
Loading
@@ -25,6 +27,10 @@ module Gitlab
build.failed?
end
 
def self.reasons
REASONS
end
private
 
def base_message
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment