Skip to content

ci: fix Codecov uploads (token + scope coverage to the app package)#317

Merged
fabriziosalmi merged 2 commits into
mainfrom
ci/fix-codecov-token-and-scope
Jun 15, 2026
Merged

ci: fix Codecov uploads (token + scope coverage to the app package)#317
fabriziosalmi merged 2 commits into
mainfrom
ci/fix-codecov-token-and-scope

Conversation

@fabriziosalmi

Copy link
Copy Markdown
Owner

The README coverage badge was stuck at a stale ~38% that matched no real measurement. Root cause: Codecov rejected every upload from the protected main branch

-> Token length: 0
error -- Upload queued for processing failed: {"message":"Token required because branch is protected"}

The codecov-action ran without a token, and with no fail_ci_if_error the upload step failed silently while the job stayed green, so the badge froze at the last successful upload (months old).

Real coverage today: ~70% over modules/ (84% if you count the tests/ tree, which --cov=. was folding in). So this is a broken-badge problem, not a low-coverage problem.

Changes

  • token: ${{ secrets.CODECOV_TOKEN }} on the codecov-action so uploads from main succeed again. (CODECOV_TOKEN repo secret added separately.) fail_ci_if_error stays false so a transient Codecov outage never blocks a release.
  • --cov=modules instead of --cov=. — measure the application package, not the whole repo (the tests/ tree runs at ~100% and was inflating the number). The badge will report the honest ~70%.
  • codecov.yml (new): informational statuses (no PR gating on a single-maintainer project) + an ignore list for tests/scripts/docs.

After this merges, the next CI run on main uploads successfully and the badge updates to the real number.

🤖 Generated with Claude Code

fabriziosalmi and others added 2 commits June 15, 2026 15:11
The README coverage badge was frozen at a stale value because Codecov rejected
every upload from the protected main branch: the codecov-action ran without a
token ("Token required because branch is protected") and, with no
fail_ci_if_error, the step failed silently while the job stayed green. Real
coverage is ~70% on modules/ (84% counting the test tree), not the badge's value.

- Pass token: ${{ secrets.CODECOV_TOKEN }} so uploads from main succeed again.
- Measure --cov=modules (the application package) instead of --cov=. so the
  number reflects app code rather than being inflated by the tests/ tree.
- Add a minimal codecov.yml: informational statuses (no PR gating on this
  single-maintainer project) and an ignore list for tests/scripts/docs.

Requires the CODECOV_TOKEN repository secret (added separately).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The v5 action warns 'Unexpected input file' and ignores it, falling back to
auto-search. Use the correct 'files:' key so the coverage.xml path is explicit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.39%. Comparing base (4eacfad) to head (5ce0353).
⚠️ Report is 263 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #317       +/-   ##
===========================================
+ Coverage   38.41%   70.39%   +31.97%     
===========================================
  Files          69       49       -20     
  Lines        8981    11244     +2263     
===========================================
+ Hits         3450     7915     +4465     
+ Misses       5531     3329     -2202     
Flag Coverage Δ
unittests 70.39% <ø> (+31.97%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fabriziosalmi fabriziosalmi merged commit 4ec2008 into main Jun 15, 2026
9 checks passed
@fabriziosalmi fabriziosalmi deleted the ci/fix-codecov-token-and-scope branch June 15, 2026 13:49
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