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
- Create pipeline with
non-skippedstatus - Create a new commit with
[ci skip]prefix to skip pipeline - Go to
http://gdk.test:3000/<namespace>/<project>/badges/master/pipeline.svgshould be showskippedbadge - Go to
http://gdk.test:3000/<namespace>/<project>badges/master/pipeline.svg?ignore_skipped=trueshould not showunknown
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