Repository navigation
Report coverage through Codecov instead of a hardcoded badge - #17
Merged
Merged
Conversation
The README claimed `coverage 100%` from a static shields.io badge. The number was true - the four resolved-Alembic jobs run with --cov-fail-under=100 - but nothing measured it, so it would have gone on claiming 100% after a drop. The resolved jobs now also write coverage.xml and upload it to Codecov, one flag per interpreter so the four reports merge instead of overwriting each other. The badge becomes a live measurement. Details worth knowing: - Upload authenticates with OIDC, so there is no CODECOV_TOKEN secret to manage or leak. That needs id-token: write on the test job; the token is minted for the audience https://codecov.io and can do nothing else. release.yml keeps id-token away from its build job for a different reason - that one could publish. - fail_ci_if_error is false on purpose. The gate above already enforces the line; a Codecov outage, or a fork PR where OIDC is unavailable, says nothing about the code. - codecov.yml mirrors the gate (project and patch target 100%, threshold 0%) rather than inventing a looser second standard, waits for all four uploads before judging a commit, and ignores tests/ and examples/. - The badge URL matters: the old codecov.io/gh/<repo>/branch/<b>/graph/badge.svg form renders "unknown" even for repositories that do have coverage - checked against psf/requests. The shields.io endpoint and the newer codecov.io/github/<repo>/graph/badge.svg form both work; this uses shields, matching the rest of the badge row. Codecov has to have the repository enabled for any of this to render; until then the badge reads "unknown". Claude-Session: https://claude.ai/code/session_017D7FmgZ7gdsg5dKbQWBiN7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The README's
coverage 100%badge was hardcoded. The number was true — the four resolved-Alembic jobs runwith
--cov-fail-under=100— but nothing measured it, so it would have kept claiming 100% after a drop.The resolved jobs now also write
coverage.xmland upload it to Codecov, one flag per interpreter so thefour reports merge instead of overwriting each other, and the badge becomes a live measurement.
Decisions in here
CODECOV_TOKENto manage or leak. That needsid-token: writeon the testjob; the token is minted for the audience
https://codecov.ioand can do nothing else. (release.ymlkeeps
id-tokenaway from its build job for a different reason — that one could publish.)fail_ci_if_error: false. The gate already enforces the line. A Codecov outage, or a fork PR whereOIDC is unavailable, says nothing about this code and must not fail the build.
codecov.ymlmirrors the gate (project and patch target 100%, threshold 0%) rather than inventing alooser second standard; waits for all four uploads before judging a commit; ignores
tests/andexamples/.codecov.io/gh/<repo>/branch/<b>/graph/badge.svgform renders
unknowneven for repositories that do have coverage — checked againstpsf/requests. Theshields.io endpoint and the newer
codecov.io/github/<repo>/graph/badge.svgboth work; this usesshields, matching the rest of the badge row.
What this PR cannot do
Codecov has to have the repository enabled before anything renders. If the first run on
mainleaves thebadge reading
unknown, the answer is to drop the badge again rather than leave a dead one in the README.Verified locally:
pytest --cov-fail-under=100 --cov-report=xml→ 115 passed, 100%,coverage.xmlwrittenwith
src/alembic_static_data/...paths. Both YAML files parse.🤖 Generated with Claude Code
https://claude.ai/code/session_017D7FmgZ7gdsg5dKbQWBiN7