Changing coverage badge logic to always show the latest build

What does this MR do and why?

Changing coverage badge logic to always show the latest build

Independent of the pipeline status, when a build_name is passed, we should always get the latest successful build

The problem statement is the same; what we really want to do is !45321 (comment 433574391) but this query is still not performant enough as of now. So we'll need to use some tricks to get around this

References

This is the first query to get all the latest pipelines for each status type:

https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/40535/commands/124728

This is an example query for ci_builds querying for last successful build of that type:

https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/40535/commands/124734

Screenshots or screen recordings

Before After

How to set up and validate locally

https://docs.gitlab.com/user/project/badges/#test-coverage-report-badges is how to set-up a badge for a particular job

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #407242 (closed)

Edited by Max Fan

Merge request reports

Loading