BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9f1beed7
Commit
9f1beed7
authored
Jan 17, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link external commit status badge to a target URL
Using new detailed statuses factory for external commit statuses.
parent
8faf0c7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
generic_commit_status.rb
app/models/generic_commit_status.rb
+6
-0
common.rb
lib/gitlab/ci/status/external/common.rb
+2
-2
pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+3
-1
No files found.
app/models/generic_commit_status.rb
View file @
9f1beed7
...
...
@@ -12,4 +12,10 @@ class GenericCommitStatus < CommitStatus
def
tags
[
:external
]
end
def
detailed_status
(
current_user
)
Gitlab
::
Ci
::
Status
::
External
::
Factory
.
new
(
self
,
current_user
)
.
fabricate!
end
end
lib/gitlab/ci/status/external/common.rb
View file @
9f1beed7
...
...
@@ -4,8 +4,8 @@ module Gitlab
module
External
module
Common
def
has_details?
can?
(
user
,
:read_commit_status
,
subject
)
&&
subject
.
target_url
.
present?
subject
.
target_url
.
present?
&&
can?
(
user
,
:read_commit_status
,
subject
)
end
def
details_path
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
9f1beed7
...
...
@@ -36,7 +36,8 @@ describe 'Pipeline', :feature, :js do
create
(
:generic_commit_status
,
status:
'success'
,
pipeline:
pipeline
,
name:
'jenkins'
,
stage:
'external'
)
stage:
'external'
,
target_url:
'http://gitlab.com/status'
)
end
end
...
...
@@ -139,6 +140,7 @@ describe 'Pipeline', :feature, :js do
it
'shows the success icon and the generic comit status build'
do
expect
(
page
).
to
have_selector
(
'.ci-status-icon-success'
)
expect
(
page
).
to
have_content
(
'jenkins'
)
expect
(
page
).
to
have_link
(
'jenkins'
,
href:
'http://gitlab.com/status'
)
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