Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
5cfdcce0
Commit
5cfdcce0
authored
Sep 05, 2018
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce class methods so CE constants can be easily overridden on EE
parent
c903fcd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
app/presenters/commit_status_presenter.rb
app/presenters/commit_status_presenter.rb
+7
-1
lib/gitlab/ci/status/build/failed.rb
lib/gitlab/ci/status/build/failed.rb
+7
-1
No files found.
app/presenters/commit_status_presenter.rb
View file @
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?
...
...
lib/gitlab/ci/status/build/failed.rb
View file @
5cfdcce0
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment