Skip to content

docs: add SonarCloud coverage badge - #25

Merged
insatomcat merged 1 commit into
mainfrom
dev/sonarcloud-coverage-badge
Oct 8, 2026
Merged

insatomcat merged 1 commit into
mainfrom
dev/sonarcloud-coverage-badge

Conversation

@ebail

@ebail ebail commented Oct 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Display the SonarCloud coverage badge alongside the existing quality-gate badge in the README.

Validation

  • Confirmed the SonarCloud badge endpoint returns a coverage value.
  • git diff --check origin/main...HEAD

@ebail
ebail force-pushed the dev/sonarcloud-coverage-badge branch from 6e7dd3e to 5aa9494 Compare October 7, 2026 09:16

@insatomcat insatomcat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The badge works and reports the right value (100% on main, fed by the CI coverage report). One change requested on the link target, see the inline comment.

Comment thread README.md Outdated
@@ -1,4 +1,5 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=seapath_python3-setup-ovs&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=seapath_python3-setup-ovs)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=seapath_python3-setup-ovs&metric=coverage)](https://sonarcloud.io/summary/new_code?id=seapath_python3-setup-ovs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The badge shows the overall coverage, while the link opens summary/new_code, which reports the coverage of new code only. The two figures can differ, so a reader clicking the badge lands on a number that does not match it.

This badge is meant as evidence for OpenSSF gold, which has two separate criteria: statement coverage >= 90% and branch coverage >= 80%. The Sonar coverage metric merges lines and conditions into a single figure. The coverage measure page breaks it down into line coverage and condition coverage, which is what the two criteria need:

Suggested change
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=seapath_python3-setup-ovs&metric=coverage)](https://sonarcloud.io/summary/new_code?id=seapath_python3-setup-ovs)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=seapath_python3-setup-ovs&metric=coverage)](https://sonarcloud.io/component_measures?id=seapath_python3-setup-ovs&metric=coverage&view=list)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the coverage badge to link to the overall coverage measures page in bdb51bb. Thanks for the suggestion!

Signed-off-by: Eloi Bail <eloi.bail@savoirfairelinux.com>
@ebail
ebail force-pushed the dev/sonarcloud-coverage-badge branch from 5aa9494 to bdb51bb Compare October 8, 2026 06:42
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@insatomcat insatomcat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the link now points to the coverage measures page. LGTM.

@insatomcat
insatomcat merged commit ad87f80 into main Oct 8, 2026
10 checks passed
@insatomcat
insatomcat deleted the dev/sonarcloud-coverage-badge branch October 8, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants