Commit 37655a85 authored by Fatih Acet's avatar Fatih Acet

Merge branch '24710-fix-generic-commit-status-table-row' into 'master'

Resolve "External statuses not shown correctly on pipeline page"

## What does this MR do?

Updates `generic_commit_status/_generic_commit_status.html.haml` template to match the changes made to `ci/builds/_build.html.haml` which had not previously been carried over.

## Testing

1. Ensure updated fixtures are installed (from !7792) so that these changes are made apparent.  (check out the !7792 branch if not yet merged into master, then `bundle exec rake db:drop` and `bundle exec rake dev:setup`)

2. Visit a build list page or an individual pipeline page which contains an external build status.

3. The results should look like this:

### Before:

![Screen_Shot_2016-11-28_at_9.11.27_PM](/uploads/ed8c5beb857cd17147dbddf8f5ecab1d/Screen_Shot_2016-11-28_at_9.11.27_PM.png)

### After:

![Screen_Shot_2016-11-28_at_9.12.05_PM](/uploads/9f953a5f14764e336afa4481a917947f/Screen_Shot_2016-11-28_at_9.12.05_PM.png)

## Are there points in the code the reviewer needs to double check?

Look for any places where these partials may be rendered to ensure external status match regular build statuses.

## Why was this MR needed?

The generic commit status template has been largely overlooked when changes are made to build table rows which should be duplicated in both places.

## Does this MR meet the acceptance criteria?

- [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [x] ~~API support added~~
- Tests
  - [x] ~~Added for this feature/bug~~
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #24710

See merge request !7811
parents 7de68c8b 9c6eaf80
...@@ -66,8 +66,6 @@ ...@@ -66,8 +66,6 @@
%td %td
- if build.project - if build.project
= link_to build.project.name_with_namespace, admin_namespace_project_path(build.project.namespace, build.project) = link_to build.project.name_with_namespace, admin_namespace_project_path(build.project.namespace, build.project)
- if admin
%td %td
- if build.try(:runner) - if build.try(:runner)
= runner_link(build.runner) = runner_link(build.runner)
...@@ -93,9 +91,8 @@ ...@@ -93,9 +91,8 @@
%span #{time_ago_with_tooltip(build.finished_at)} %span #{time_ago_with_tooltip(build.finished_at)}
%td.coverage %td.coverage
- if coverage - if coverage && build.try(:coverage)
- if build.try(:coverage) #{build.coverage}%
#{build.coverage}%
%td %td
.pull-right .pull-right
......
%tr.generic_commit_status - admin = local_assigns.fetch(:admin, false)
- ref = local_assigns.fetch(:ref, nil)
- commit_sha = local_assigns.fetch(:commit_sha, nil)
- retried = local_assigns.fetch(:retried, false)
- pipeline_link = local_assigns.fetch(:pipeline_link, false)
- stage = local_assigns.fetch(:stage, false)
- coverage = local_assigns.fetch(:coverage, false)
%tr.generic_commit_status{class: ('retried' if retried)}
%td.status %td.status
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url - if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
= ci_status_with_icon(generic_commit_status.status, generic_commit_status.target_url) = ci_status_with_icon(generic_commit_status.status, generic_commit_status.target_url)
...@@ -8,14 +16,35 @@ ...@@ -8,14 +16,35 @@
%td.generic_commit_status-link %td.generic_commit_status-link
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url - if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
= link_to generic_commit_status.target_url do = link_to generic_commit_status.target_url do
%strong ##{generic_commit_status.id} %span.build-link ##{generic_commit_status.id}
- else - else
%strong ##{generic_commit_status.id} %span.build-link ##{generic_commit_status.id}
- if defined?(retried) && retried - if ref
- if generic_commit_status.ref
.icon-container
= generic_commit_status.tags.any? ? icon('tag') : icon('code-fork')
= link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref)
- else
.light none
.icon-container.commit-icon
= custom_icon("icon_commit")
- if commit_sha
= 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: "commit-id monospace"
- if retried
= icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.') = icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.')
- if defined?(pipeline_link) && pipeline_link .label-container
- if generic_commit_status.tags.any?
- generic_commit_status.tags.each do |tag|
%span.label.label-primary
= tag
- if retried
%span.label.label-warning retried
- if pipeline_link
%td %td
= link_to pipeline_path(generic_commit_status.pipeline) do = link_to pipeline_path(generic_commit_status.pipeline) do
%span.pipeline-id ##{generic_commit_status.pipeline.id} %span.pipeline-id ##{generic_commit_status.pipeline.id}
...@@ -25,25 +54,17 @@ ...@@ -25,25 +54,17 @@
- else - else
%span.monospace API %span.monospace API
- if defined?(commit_sha) && commit_sha - if admin
%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"
- if defined?(ref) && ref
%td %td
- if generic_commit_status.ref - if generic_commit_status.project
= link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref) = link_to generic_commit_status.project.name_with_namespace, admin_namespace_project_path(generic_commit_status.project.namespace, generic_commit_status.project)
- else
.light none
- if defined?(runner) && runner
%td %td
- if generic_commit_status.try(:runner) - if generic_commit_status.try(:runner)
= runner_link(generic_commit_status.runner) = runner_link(generic_commit_status.runner)
- else - else
.light none .light none
- if defined?(stage) && stage - if stage
%td %td
= generic_commit_status.stage = generic_commit_status.stage
...@@ -51,24 +72,19 @@ ...@@ -51,24 +72,19 @@
= generic_commit_status.name = generic_commit_status.name
%td %td
- if generic_commit_status.tags.any?
- 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 - if generic_commit_status.duration
= icon("clock-o") %p.duration
= time_interval_in_words(generic_commit_status.duration) = custom_icon("icon_timer")
= duration_in_numbers(generic_commit_status.duration)
%td.timestamp
- if generic_commit_status.finished_at - if generic_commit_status.finished_at
= icon("calendar") %p.finished-at
%span #{time_ago_with_tooltip(generic_commit_status.finished_at)} = icon("calendar")
%span #{time_ago_with_tooltip(generic_commit_status.finished_at)}
- if defined?(coverage) && coverage %td.coverage
%td.coverage - if coverage && generic_commit_status.try(:coverage)
- if generic_commit_status.try(:coverage) #{generic_commit_status.coverage}%
#{generic_commit_status.coverage}%
%td
-# empty column to match number of columns in ci/builds/_build.html.haml
---
title: Update generic/external build status to match normal build status template
merge_request: 7811
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment