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
68c12e15
Commit
68c12e15
authored
May 04, 2017
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'always-show-latest-pipeline-in-commit-box' into 'master'
Always show latest pipeline info in commit box Closes #31378 See merge request !11038
parents
eddeecf6
0a29bde4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
13 deletions
+18
-13
commit.rb
app/models/commit.rb
+2
-2
_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+9
-8
always-show-latest-pipeline-in-commit-box.yml
.../unreleased/always-show-latest-pipeline-in-commit-box.yml
+4
-0
commit_spec.rb
spec/models/commit_spec.rb
+3
-3
No files found.
app/models/commit.rb
View file @
68c12e15
...
...
@@ -236,8 +236,8 @@ class Commit
project
.
pipelines
.
where
(
sha:
sha
)
end
def
la
te
st_pipeline
pipelines
.
last
def
last_pipeline
@last_pipeline
||=
pipelines
.
last
end
def
status
(
ref
=
nil
)
...
...
app/views/projects/commit/_commit_box.html.haml
View file @
68c12e15
...
...
@@ -61,19 +61,20 @@
%span
.commit-info.branches
%i
.fa.fa-spinner.fa-spin
-
if
@commit
.
status
-
if
@commit
.
last_pipeline
-
last_pipeline
=
@commit
.
last_pipeline
.well-segment.pipeline-info
.status-icon-container
{
class:
"ci-status-icon-#{@commit.status}"
}
=
link_to
namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@commit
.
late
st_pipeline
.
id
)
do
=
ci_icon_for_status
(
@commit
.
status
)
=
link_to
namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
la
st_pipeline
.
id
)
do
=
ci_icon_for_status
(
last_pipeline
.
status
)
Pipeline
=
link_to
"#
#{
@commit
.
latest_pipeline
.
id
}
"
,
namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
@commit
.
late
st_pipeline
.
id
),
class:
"monospace"
=
ci_label_for_status
(
@commit
.
status
)
-
if
@commit
.
late
st_pipeline
.
stages
.
any?
=
link_to
"#
#{
last_pipeline
.
id
}
"
,
namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
la
st_pipeline
.
id
),
class:
"monospace"
=
ci_label_for_status
(
last_pipeline
.
status
)
-
if
la
st_pipeline
.
stages
.
any?
.mr-widget-pipeline-graph
=
render
'shared/mini_pipeline_graph'
,
pipeline:
@commit
.
late
st_pipeline
,
klass:
'js-commit-pipeline-graph'
=
render
'shared/mini_pipeline_graph'
,
pipeline:
la
st_pipeline
,
klass:
'js-commit-pipeline-graph'
in
=
time_interval_in_words
@commit
.
pipelines
.
total_
duration
=
time_interval_in_words
last_pipeline
.
duration
:javascript
$
(
".commit-info.branches"
).
load
(
"
#{
branches_namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
)
}
"
);
changelogs/unreleased/always-show-latest-pipeline-in-commit-box.yml
0 → 100644
View file @
68c12e15
---
title
:
Always show the latest pipeline information in the commit box
merge_request
:
11038
author
:
spec/models/commit_spec.rb
View file @
68c12e15
...
...
@@ -212,7 +212,7 @@ eos
end
end
describe
'#la
te
st_pipeline'
do
describe
'#last_pipeline'
do
let!
(
:first_pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
...
...
@@ -226,8 +226,8 @@ eos
status:
'success'
)
end
it
'returns la
te
st pipeline'
do
expect
(
commit
.
la
te
st_pipeline
).
to
eq
second_pipeline
it
'returns last pipeline'
do
expect
(
commit
.
last_pipeline
).
to
eq
second_pipeline
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