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
b4ef158a
Commit
b4ef158a
authored
Oct 27, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Still show status from pipelines, see:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17397201
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17397461
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6801#note_17468470
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17482654
parent
7cdb238a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
17 deletions
+27
-17
ci_status_helper.rb
app/helpers/ci_status_helper.rb
+11
-8
commit.rb
app/models/commit.rb
+14
-7
_commit.html.haml
app/views/projects/commits/_commit.html.haml
+2
-2
No files found.
app/helpers/ci_status_helper.rb
View file @
b4ef158a
...
...
@@ -54,15 +54,18 @@ module CiStatusHelper
custom_icon
(
icon_name
)
end
def
render_commit_ref_status
(
commit
,
ref
=
nil
,
**
args
)
pipeline
=
commit
.
pipelines_for
(
ref
).
last
render_pipeline_status
(
pipeline
,
**
args
)
end
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
)
def
render_commit_status
(
commit
,
ref:
nil
,
tooltip_placement:
'auto left'
)
project
=
commit
.
project
path
=
pipelines_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement:
tooltip_placement
)
path
=
pipelines_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
render_status_with_link
(
'commit'
,
commit
.
status_for
(
ref
),
path
,
tooltip_placement:
tooltip_placement
)
end
def
render_pipeline_status
(
pipeline
,
tooltip_placement:
'auto left'
)
...
...
app/models/commit.rb
View file @
b4ef158a
...
...
@@ -51,12 +51,14 @@ class Commit
end
attr_accessor
:raw
attr_reader
:statuses
def
initialize
(
raw_commit
,
project
)
raise
"Nil as raw commit passed"
unless
raw_commit
@raw
=
raw_commit
@project
=
project
@statuses
=
{}
end
def
id
...
...
@@ -225,17 +227,22 @@ class Commit
)
end
def
pipelines_for
(
ref
)
project
.
pipelines
.
where
(
sha:
sha
,
ref:
ref
)
end
def
pipelines
@pipeline
||=
project
.
pipelines
.
where
(
sha:
sha
)
project
.
pipelines
.
where
(
sha:
sha
)
end
def
status
return
@status
if
defined?
(
@status
)
@status
||=
pipelines
.
status
status_for
(
nil
)
end
def
status_for
(
ref
)
if
statuses
.
key?
(
ref
)
statuses
[
ref
]
elsif
ref
statuses
[
ref
]
=
pipelines
.
where
(
ref:
ref
).
status
else
statuses
[
ref
]
=
pipelines
.
status
end
end
def
revert_branch_name
...
...
app/views/projects/commits/_commit.html.haml
View file @
b4ef158a
...
...
@@ -20,13 +20,13 @@
=
commit
.
short_id
-
if
commit
.
status
.visible-xs-inline
=
render_commit_
ref_status
(
commit
,
ref
)
=
render_commit_
status
(
commit
,
ref:
ref
)
-
if
commit
.
description?
%a
.text-expander.hidden-xs.js-toggle-button
...
.commit-actions.hidden-xs
-
if
commit
.
status
=
render_commit_
ref_status
(
commit
,
ref
)
=
render_commit_
status
(
commit
,
ref:
ref
)
=
clipboard_button
(
clipboard_text:
commit
.
id
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit-short-id btn btn-transparent"
=
link_to_browse_code
(
project
,
commit
)
...
...
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