Overall pipeline status does not render warning status if stages contain warnings

Summary

The CI status for a commit renders as green checkmark when individual stages have a yellow-bang warning status.

What is the current bug behavior?

Overall pipeline status renders a green checkmark and says "passed", even if jobs/stages have yellow bangs.

What is the expected correct behavior?

Overall pipeline status should render a yellow bang and say "passed with warnings".

Example Project

This is easy to find in the canonical gitlab-org/gitlab project: https://gitlab.com/gitlab-org/gitlab/pipelines?scope=finished&page=1

Steps to reproduce

  1. Find a passed-with-warnings Pipeline run in the gitlab-org/gitlab project.
  2. Click the link for the commit that the pipeline was run on.

image

Relevant logs and/or screenshots

Here is a passed-with-warnings pipeline with a green passed checkmark.

image

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:env:info)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

The view code where this manifests is centered around https://gitlab.com/gitlab-org/gitlab/blob/master/app%2Fviews%2Fprojects%2Fcommit%2F_commit_box.html.haml#L82

  1. Decide that ci_icon_for_status needs to be updated to return the correct icon name.
  2. Decide that the wrong status term is being passed into ci_status_for_icon, and pass in a different term.
  3. Pass a DetailedStatus into ci_icon_for_status instead of the simple Ci::Pipeline#status

In all scenarios, we should consider updating the copy in _commit_box.html.haml to include "with warnings", in the event there are any.

Edited by drew stachon