Skip to content

Fix ignore_skipped not working as expected

What does this MR do and why?

Connected to #326513 (closed)

Previously, the pipeline status badge displayed the status from the latest SHA, even if all pipelines associated with that SHA were skipped using [ci skip] . This resulted in an unknown status when using ignore_skipped=true parameter. The code changes now ensure that the badge displays the latest non-skipped pipeline status for the given branch.

How to set up and validate locally

  1. Create pipeline with non-skipped status
  2. Create a new commit with [ci skip] prefix to skip pipeline
  3. Go to http://gdk.test:3000/<namespace>/<project>/badges/master/pipeline.svg should be show skipped badge
  4. Go to http://gdk.test:3000/<namespace>/<project>badges/master/pipeline.svg?ignore_skipped=true should not show unknown

Query Plans

Courtesy of @drew

Original

Without skipped: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/27436/commands/85426

With skipped: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/27436/commands/85428

Updated

Without skipped: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/27436/commands/85424

With skipped: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/27436/commands/85425

Edited by drew stachon

Merge request reports