Skip to content

Name the branch in the coverage badge URL, or it reads "unknown" - #18

Open
rt87 wants to merge 1 commit into
mainfrom
ci_pin-the-coverage-badge-to-main
Open

rt87 wants to merge 1 commit into
mainfrom
ci_pin-the-coverage-badge-to-main

Conversation

@rt87

@rt87 rt87 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Follow-up to #17, measured once the first report had landed on main:

URL renders
img.shields.io/codecov/c/github/rt87/alembic-static-data (merged in #17) unknown
img.shields.io/codecov/c/github/rt87/alembic-static-data/main 100%
codecov.io/github/rt87/alembic-static-data/graph/badge.svg 100%

Codecov's API explains it: the repository-level endpoint returns totals: null, while
branches/main/ carries a head commit with coverage. Without a branch segment shields has nothing to read.

So the badge merged one commit ago was showing unknown on a public README. Pinning it to main fixes
that, and makes the badge say what it means — the coverage of the default branch.

For the record, the rest of #17 worked without any manual step: the OIDC upload created the repository on
Codecov by itself (activated: true), and main is at 100%.

🤖 Generated with Claude Code

https://claude.ai/code/session_017D7FmgZ7gdsg5dKbQWBiN7

Measured after the first report landed on main: the shields.io codecov endpoint
without a branch segment renders "unknown", while the same URL with /main
renders 100%, and so does Codecov's own
codecov.io/github/<repo>/graph/badge.svg. The repository-level API confirms it,
returning totals: null while the main branch carries a head commit with
coverage.

So the badge I merged one commit ago was displaying "unknown" on a public
README. Pinning it to main fixes that and also makes it say what it means: the
coverage of the default branch, not of whatever Codecov considers current.

Claude-Session: https://claude.ai/code/session_017D7FmgZ7gdsg5dKbQWBiN7
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.

1 participant