summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-05-10 02:38:25 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-05-10 02:38:25 +0300
commit3953e5fcd7060e77405327e670f92ebd7d0ee5a0 (patch)
treeca3992f88a928deb9bdfd7fe5f79985878158f19 /app
parentfe2137d871b978033007a3375cf6f1edf0f04cd4 (diff)
downloadgitlab-ce-3953e5fcd7060e77405327e670f92ebd7d0ee5a0.tar.gz
Update generic commit status to make it look like a build
Diffstat (limited to 'app')
-rw-r--r--app/models/commit_status.rb4
-rw-r--r--app/views/projects/ci/builds/_build.html.haml33
-rw-r--r--app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml9
3 files changed, 21 insertions, 25 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 0c0c3d38f94..2d09edf3ca1 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -91,12 +91,12 @@ class CommitStatus < ActiveRecord::Base
end
def self.stages
- # We group by stage name, but order stages by their's index
+ # We group by stage name, but order stages by theirs' index
unscoped.from(all, :sg).group('stage').order('max(stage_idx)', 'stage').pluck('sg.stage')
end
def self.stages_status
- # We execute subquery for each of the stages which calculates an Stage Status
+ # We execute subquery for each stage to calculate a stage status
statuses = unscoped.from(all, :sg).group('stage').pluck('sg.stage', all.where('stage=sg.stage').status_sql)
statuses.inject({}) do |h, k|
h[k.first] = k.last
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index 7384bfa1a7a..962b9fb2595 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -55,30 +55,17 @@
- if defined?(retried) && retried
%span.label.label-warning retried
- - if defined?(new_duration) && new_duration
- %td.duration
- - if build.duration
- %p
- = icon("clock-o")
- &nbsp;
- #{duration_in_words(build.finished_at, build.started_at)}
- - if build.finished_at
- %p
- = icon("calendar")
- &nbsp;
- #{time_ago_with_tooltip(build.finished_at)}
- - else
- %td.duration
- - if build.duration
- = icon("clock-o")
- &nbsp;
- #{duration_in_words(build.finished_at, build.started_at)}
+ %td.duration
+ - if build.duration
+ = icon("clock-o")
+ &nbsp;
+ #{duration_in_words(build.finished_at, build.started_at)}
- %td.timestamp
- - if build.finished_at
- = icon("calendar")
- &nbsp;
- %span #{time_ago_with_tooltip(build.finished_at)}
+ %td.timestamp
+ - if build.finished_at
+ = icon("calendar")
+ &nbsp;
+ %span #{time_ago_with_tooltip(build.finished_at)}
- if defined?(coverage) && coverage
%td.coverage
diff --git a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
index f21c864e35c..8129514964a 100644
--- a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
+++ b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
@@ -12,6 +12,9 @@
- else
%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
%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"
@@ -42,13 +45,19 @@
- generic_commit_status.tags.each do |tag|
%span.label.label-primary
= tag
+ - if defined?(retried) && retried
+ %span.label.label-warning retried
%td.duration
- if generic_commit_status.duration
+ = icon("clock-o")
+ &nbsp;
#{duration_in_words(generic_commit_status.finished_at, generic_commit_status.started_at)}
%td.timestamp
- if generic_commit_status.finished_at
+ = icon("calendar")
+ &nbsp;
%span #{time_ago_with_tooltip(generic_commit_status.finished_at)}
- if defined?(coverage) && coverage