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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1ad0c968
Commit
1ad0c968
authored
May 09, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make a build views nicer
parent
cb90368a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
34 deletions
+61
-34
app/models/commit_status.rb
app/models/commit_status.rb
+1
-1
app/views/projects/ci/builds/_build.html.haml
app/views/projects/ci/builds/_build.html.haml
+35
-17
app/views/projects/ci/commits/_commit.html.haml
app/views/projects/ci/commits/_commit.html.haml
+4
-2
app/views/projects/commit/_ci_commit.html.haml
app/views/projects/commit/_ci_commit.html.haml
+15
-13
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+6
-1
No files found.
app/models/commit_status.rb
View file @
1ad0c968
...
...
@@ -89,7 +89,7 @@ class CommitStatus < ActiveRecord::Base
def
self
.
stages
order_by
=
'max(stage_idx)'
group
(
'stage'
).
order
(
order_by
).
pluck
(
:stage
,
order_by
).
map
(
&
:first
).
compact
CommitStatus
.
where
(
id:
all
).
group
(
'stage'
).
order
(
order_by
).
pluck
(
:stage
,
order_by
).
map
(
&
:first
).
compact
end
def
self
.
stages_status
...
...
app/views/projects/ci/builds/_build.html.haml
View file @
1ad0c968
...
...
@@ -42,6 +42,7 @@
%td
=
build
.
name
.pull-right
.label-container
-
if
build
.
tags
.
any?
-
build
.
tags
.
each
do
|
tag
|
...
...
@@ -54,12 +55,29 @@
-
if
defined?
(
retried
)
&&
retried
%span
.label.label-warning
retried
-
if
defined?
(
new_duration
)
&&
new_duration
%td
.duration
-
if
build
.
duration
%p
%i
.fa.fa-clock-o
#{
duration_in_words
(
build
.
finished_at
,
build
.
started_at
)
}
-
if
build
.
finished_at
%p
%i
.fa.fa-calendar
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
-
else
%td
.duration
-
if
build
.
duration
%i
.fa.fa-clock-o
#{
duration_in_words
(
build
.
finished_at
,
build
.
started_at
)
}
%td
.timestamp
-
if
build
.
finished_at
%i
.fa.fa-calendar
%span
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
-
if
defined?
(
coverage
)
&&
coverage
...
...
app/views/projects/ci/commits/_commit.html.haml
View file @
1ad0c968
...
...
@@ -35,7 +35,8 @@
-
stages
.
each
do
|
stage
|
%td
-
if
status
=
stages_status
[
stage
]
%span
.has-tooltip
(
title=
"#{stage.titleize}: #{status}"
)
{
class:
"ci-status-icon-#{status}"
}
-
tooltip
=
"
#{
stage
.
titleize
}
:
#{
status
}
"
%span
.has-tooltip
(
title=
"#{tooltip}"
)
{
class:
"ci-status-icon-#{status}"
}
=
ci_icon_for_status
(
status
)
%td
...
...
@@ -52,7 +53,7 @@
%td
.controls.hidden-xs.pull-right
-
artifacts
=
commit
.
builds
.
latest
-
artifacts
=
commit
.
builds
.
latest
.
select
{
|
b
|
b
.
artifacts?
}
-
if
artifacts
.
present?
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
...
...
@@ -66,6 +67,7 @@
%span
#{
build
.
name
}
-
if
can?
(
current_user
,
:update_pipeline
,
@project
)
-
if
commit
.
retryable?
&&
commit
.
builds
.
failed
.
any?
=
link_to
retry_namespace_project_pipeline_path
(
@project
.
namespace
,
@project
,
commit
.
id
),
class:
'btn has-tooltip'
,
title:
"Retry"
,
method: :post
do
=
icon
(
"repeat"
)
...
...
app/views/projects/commit/_ci_commit.html.haml
View file @
1ad0c968
...
...
@@ -36,17 +36,19 @@
.table-holder
%table
.table.builds
%thead
%tr
%th
Status
%th
Build ID
%th
Stage
%th
Name
%th
Duration
%th
Finished at
-
if
@project
.
build_coverage_enabled?
%th
Coverage
%th
-
builds
=
ci_commit
.
statuses
.
latest
.
ordered
=
render
builds
,
coverage:
@project
.
build_coverage_enabled?
,
stage:
true
,
ref:
false
,
allow_retry:
true
=
render
ci_commit
.
retried
,
coverage:
@project
.
build_coverage_enabled?
,
stage:
true
,
ref:
false
,
retried:
true
-
CommitStatus
.
where
(
id:
builds
).
stages
.
each
do
|
stage
|
-
stage_builds
=
builds
.
where
(
stage:
stage
)
%tr
%th
{
colspan:
10
}
%strong
-
stage_status
=
CommitStatus
.
where
(
id:
stage_builds
.
ids
).
status
%span
{
class:
"ci-status-link ci-status-icon-#{stage_status}"
}
=
ci_icon_for_status
(
stage_status
)
=
stage
.
titleize
.
pluralize
=
render
stage_builds
,
coverage:
@project
.
build_coverage_enabled?
,
tage:
false
,
ref:
false
,
allow_retry:
true
=
render
ci_commit
.
retried
.
select
{
|
build
|
build
.
stage
==
stage
},
coverage:
@project
.
build_coverage_enabled?
,
stage:
false
,
ref:
false
,
retried:
true
%tr
%td
{
colspan:
10
}
app/views/projects/pipelines/index.html.haml
View file @
1ad0c968
...
...
@@ -38,7 +38,12 @@
%span
CI Lint
.gray-content-block
Pipelines for
#{
(
@scope
||
'changes'
)
}
on this project
-
if
@scope
==
'running'
Running pipelines for this project
-
elsif
@scope
.
nil?
Pipelines for this project
-
else
#{
@scope
.
titleize
}
for this project
%ul
.content-list
-
stages
=
@pipelines
.
stages
...
...
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