Skip to content
Snippets Groups Projects
Commit d25a1f30 authored by Jacob Schatz's avatar Jacob Schatz
Browse files

Merge branch '21192-retried-builds' into 'master'

Fix retried builds styling

#### What does this MR do?
Adds background color to retried builds and an icon + tooltip on retried builds in build list

#### Screenshots (if relevant)
<img src="/uploads/4138dd277c185de3c271b2eb9b459761/Screen_Shot_2016-10-13_at_2.44.27_PM.png" width="500px">
<img src="/uploads/99227d5ed3816a509660fe5a84da5b2a/Screen_Shot_2016-10-13_at_3.01.13_PM.png" width="500px">
#### What are the relevant issue numbers?
Closes #21192

See merge request !6109
parents 24b73bc9 d61f8a18
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -16,6 +16,7 @@ $white-light: #fff;
$white-normal: #ededed;
$white-dark: #ececec;
 
$gray-lightest: #fdfdfd;
$gray-light: #fafafa;
$gray-lighter: #f9f9f9;
$gray-normal: #f5f5f5;
Loading
Loading
Loading
Loading
@@ -195,7 +195,7 @@
.build-job {
position: relative;
 
.fa {
.fa-arrow-right {
position: absolute;
left: 15px;
top: 20px;
Loading
Loading
@@ -205,14 +205,23 @@
&.active {
font-weight: bold;
 
.fa {
.fa-arrow-right {
display: block;
}
}
 
&.retried {
background-color: $gray-lightest;
}
&:hover {
background-color: $row-hover;
}
.fa-refresh {
font-size: 13px;
margin-left: 3px;
}
}
}
}
Loading
Loading
Loading
Loading
@@ -73,6 +73,10 @@
border-top-width: 1px;
}
 
.build.retried {
background-color: $gray-lightest;
}
.commit-link {
 
.ci-status {
Loading
Loading
@@ -109,7 +113,8 @@
 
.fa {
font-size: 12px;
color: $table-text-gray;
color: $gl-text-color;
margin-left: 5px;
}
 
.commit-id {
Loading
Loading
module BuildsHelper
def sidebar_build_class(build, current_build)
build_class = ''
build_class += ' active' if build == current_build
build_class += ' retried' if build.retried?
build_class
end
end
Loading
Loading
@@ -5,6 +5,7 @@ module HasStatus
STARTED_STATUSES = %w[running success failed skipped]
ACTIVE_STATUSES = %w[pending running]
COMPLETED_STATUSES = %w[success failed canceled]
ORDERED_STATUSES = %w[failed pending running canceled success skipped]
 
class_methods do
def status_sql
Loading
Loading
- builds = @build.pipeline.builds.latest.to_a
- statuses = ["failed", "pending", "running", "canceled", "success", "skipped"]
- builds = @build.pipeline.builds.to_a
 
%aside.right-sidebar.right-sidebar-expanded.build-sidebar.js-build-sidebar
.block.build-sidebar-header.visible-xs-block.visible-sm-block.append-bottom-default
Loading
Loading
@@ -124,9 +123,9 @@
%a.stage-item= stage
 
.builds-container
- statuses.each do |build_status|
- HasStatus::ORDERED_STATUSES.each do |build_status|
- builds.select{|build| build.status == build_status}.each do |build|
.build-job{class: ('active' if build == @build), data: {stage: build.stage}}
.build-job{class: sidebar_build_class(build, @build), data: {stage: build.stage}}
= link_to namespace_project_build_path(@project.namespace, @project, build) do
= icon('arrow-right')
= ci_icon_for_status(build.status)
Loading
Loading
@@ -135,11 +134,5 @@
= build.name
- else
= build.id
- if @build.retried?
%li.active
%a
Build ##{@build.id}
&middot;
%i.fa.fa-warning
This build was retried.
- if build.retried?
%i.fa.fa-refresh.has-tooltip{data: { container: 'body', placement: 'bottom' }, title: 'Build was retried'}
Loading
Loading
@@ -6,7 +6,7 @@
- coverage = local_assigns.fetch(:coverage, false)
- allow_retry = local_assigns.fetch(:allow_retry, false)
 
%tr.build.commit
%tr.build.commit{class: ('retried' if retried)}
%td.status
- if can?(current_user, :read_build, build)
= ci_status_with_icon(build.status, namespace_project_build_url(build.project.namespace, build.project, build))
Loading
Loading
@@ -35,8 +35,9 @@
 
- if build.stuck?
= icon('warning', class: 'text-warning has-tooltip', title: 'Build is stuck. Check runners.')
- if retried
= icon('warning', class: 'text-warning has-tooltip', title: 'Build was retried.')
= icon('refresh', class: 'text-warning has-tooltip', title: 'Build was retried')
 
.label-container
- if build.tags.any?
Loading
Loading
@@ -47,8 +48,6 @@
%span.label.label-info triggered
- if build.try(:allow_failure)
%span.label.label-danger allowed to fail
- if retried
%span.label.label-warning retried
- if build.manual?
%span.label.label-info manual
 
Loading
Loading
Loading
Loading
@@ -177,7 +177,7 @@ describe "Pipelines" do
before { click_on 'Retry failed' }
 
it { expect(page).not_to have_content('Retry failed') }
it { expect(page).to have_content('retried') }
it { expect(page).to have_selector('.retried') }
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment