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
Tatuya Kamada
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
app/models/generic_commit_status.rb
app/models/generic_commit_status.rb
+6
-0
lib/gitlab/ci/status/external/common.rb
lib/gitlab/ci/status/external/common.rb
+2
-2
spec/features/projects/pipelines/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