Add ability to see code coverage badge on any branch

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

As a developer working on a long working branch (say feature branch), I want to be able quickly see the latest coverage value for the branch, so I can see how it compares to the default branch.

Currently, the test coverage badge can be hardcoded for the branch you would like to display the coverage for but switching between it to compare coverage is slow or involves digging through pipelines.

Customer ticket requesting this feature --> https://gitlab.zendesk.com/agent/tickets/113248 (internal use only)

Target audience

Further details

Development teams often work on long lived branches like release or feature branches. There is a summary view of a branch similar to the project summary view that can contain badges including the coverage badge.

This would allow compliance teams / quality teams / managers to see how the coverage metric is progressing along with development so there are no late iteration surprises that force the team to cut features to add code coverage OR delay a release.

Proposal

When a user is viewing the summary page for a branch, they should see the latest code coverage value for that branch and the default branch, so that they can judge how far apart those values are to adjust the team's focus.

This may be expanded to any badge the customer has setup to appear referencing the current branch vs. default.

Screenshot_2020-04-06_11.30.28

From the customer:

a badge link that specifies the current branch and job should return the coverage value (I can see it on the job in the build for that branch so the value should be available somehow)

This would allow the customer to set one URL in the README for the test coverage badge, and be able to see the test coverage of the specific branch they are on, rather than just one branch.

Permissions and Security

No specific permissions for the test coverage badge are noted in the documentation.

Documentation

Test coverage badge documentation

What does success look like, and how can we measure that?

Users who navigate to a pipeline summary page for a pipeline that generated a parsed coverage report will see a badge with coverage.

Links / references

Edited by 🤖 GitLab Bot 🤖