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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
3953e5fc
Commit
3953e5fc
authored
May 10, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update generic commit status to make it look like a build
parent
fe2137d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
25 deletions
+21
-25
app/models/commit_status.rb
app/models/commit_status.rb
+2
-2
app/views/projects/ci/builds/_build.html.haml
app/views/projects/ci/builds/_build.html.haml
+10
-23
app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
.../generic_commit_statuses/_generic_commit_status.html.haml
+9
-0
No files found.
app/models/commit_status.rb
View file @
3953e5fc
...
@@ -91,12 +91,12 @@ class CommitStatus < ActiveRecord::Base
...
@@ -91,12 +91,12 @@ class CommitStatus < ActiveRecord::Base
end
end
def
self
.
stages
def
self
.
stages
# We group by stage name, but order stages by their
's
index
# We group by stage name, but order stages by their
s'
index
unscoped
.
from
(
all
,
:sg
).
group
(
'stage'
).
order
(
'max(stage_idx)'
,
'stage'
).
pluck
(
'sg.stage'
)
unscoped
.
from
(
all
,
:sg
).
group
(
'stage'
).
order
(
'max(stage_idx)'
,
'stage'
).
pluck
(
'sg.stage'
)
end
end
def
self
.
stages_status
def
self
.
stages_status
# We execute subquery for each
of the stages which calculates an Stage S
tatus
# We execute subquery for each
stage to calculate a stage s
tatus
statuses
=
unscoped
.
from
(
all
,
:sg
).
group
(
'stage'
).
pluck
(
'sg.stage'
,
all
.
where
(
'stage=sg.stage'
).
status_sql
)
statuses
=
unscoped
.
from
(
all
,
:sg
).
group
(
'stage'
).
pluck
(
'sg.stage'
,
all
.
where
(
'stage=sg.stage'
).
status_sql
)
statuses
.
inject
({})
do
|
h
,
k
|
statuses
.
inject
({})
do
|
h
,
k
|
h
[
k
.
first
]
=
k
.
last
h
[
k
.
first
]
=
k
.
last
...
...
app/views/projects/ci/builds/_build.html.haml
View file @
3953e5fc
...
@@ -55,30 +55,17 @@
...
@@ -55,30 +55,17 @@
-
if
defined?
(
retried
)
&&
retried
-
if
defined?
(
retried
)
&&
retried
%span
.label.label-warning
retried
%span
.label.label-warning
retried
-
if
defined?
(
new_duration
)
&&
new_duration
%td
.duration
%td
.duration
-
if
build
.
duration
-
if
build
.
duration
=
icon
(
"clock-o"
)
%p
=
icon
(
"clock-o"
)
#{
duration_in_words
(
build
.
finished_at
,
build
.
started_at
)
}
#{
duration_in_words
(
build
.
finished_at
,
build
.
started_at
)
}
-
if
build
.
finished_at
%p
=
icon
(
"calendar"
)
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
-
else
%td
.duration
-
if
build
.
duration
=
icon
(
"clock-o"
)
#{
duration_in_words
(
build
.
finished_at
,
build
.
started_at
)
}
%td
.timestamp
%td
.timestamp
-
if
build
.
finished_at
-
if
build
.
finished_at
=
icon
(
"calendar"
)
=
icon
(
"calendar"
)
%span
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
%span
#{
time_ago_with_tooltip
(
build
.
finished_at
)
}
-
if
defined?
(
coverage
)
&&
coverage
-
if
defined?
(
coverage
)
&&
coverage
%td
.coverage
%td
.coverage
...
...
app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
View file @
3953e5fc
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
-
else
-
else
%strong
##{generic_commit_status.id}
%strong
##{generic_commit_status.id}
-
if
defined?
(
retried
)
&&
retried
=
icon
(
'warning'
,
class:
'text-warning has-tooltip'
,
title:
'Status was retried.'
)
-
if
defined?
(
commit_sha
)
&&
commit_sha
-
if
defined?
(
commit_sha
)
&&
commit_sha
%td
%td
=
link_to
generic_commit_status
.
short_sha
,
namespace_project_commit_path
(
generic_commit_status
.
project
.
namespace
,
generic_commit_status
.
project
,
generic_commit_status
.
sha
),
class:
"monospace"
=
link_to
generic_commit_status
.
short_sha
,
namespace_project_commit_path
(
generic_commit_status
.
project
.
namespace
,
generic_commit_status
.
project
,
generic_commit_status
.
sha
),
class:
"monospace"
...
@@ -42,13 +45,19 @@
...
@@ -42,13 +45,19 @@
-
generic_commit_status
.
tags
.
each
do
|
tag
|
-
generic_commit_status
.
tags
.
each
do
|
tag
|
%span
.label.label-primary
%span
.label.label-primary
=
tag
=
tag
-
if
defined?
(
retried
)
&&
retried
%span
.label.label-warning
retried
%td
.duration
%td
.duration
-
if
generic_commit_status
.
duration
-
if
generic_commit_status
.
duration
=
icon
(
"clock-o"
)
#{
duration_in_words
(
generic_commit_status
.
finished_at
,
generic_commit_status
.
started_at
)
}
#{
duration_in_words
(
generic_commit_status
.
finished_at
,
generic_commit_status
.
started_at
)
}
%td
.timestamp
%td
.timestamp
-
if
generic_commit_status
.
finished_at
-
if
generic_commit_status
.
finished_at
=
icon
(
"calendar"
)
%span
#{
time_ago_with_tooltip
(
generic_commit_status
.
finished_at
)
}
%span
#{
time_ago_with_tooltip
(
generic_commit_status
.
finished_at
)
}
-
if
defined?
(
coverage
)
&&
coverage
-
if
defined?
(
coverage
)
&&
coverage
...
...
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