ci: publish Go coverage badge + GitHub Code Quality PR comments (#133) - #334
Conversation
Resolve #133's coverage-reporting decision now the repo is public — self-hosted, no third-party SaaS: - README badge: a `cov badge` subcommand emits a shields.io endpoint JSON for the merged Go total (the exact number `make cov` gates); a new non-gating `badge` job publishes it to an orphan `badges` branch (sole holder of contents:write, main-push only) via scripts/ci/publish-badge.sh. README reads it over raw.githubusercontent.com. - PR drop comments: GitHub Code Quality (native, first-party). The coverage job converts the merged Go profile to Cobertura (go tool gocover-cobertura, excludes mirrored from .testcoverage.yml) and uploads via actions/upload-code-coverage; the github-code-quality[bot] posts the aggregate + per-file diff-vs-main comment. continue-on-error so this public-preview feature never reds CI; fork PRs skip. Gating is unchanged — `make cov`'s thresholds stay the only merge gate. actionlint doesn't know the preview `code-quality` scope yet, suppressed narrowly in .github/actionlint.yaml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 9 minutes and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📚 Docs preview is live → https://a6ae2994-wavehouse-docs.wave-rf.workers.dev
|
Code Coverage OverviewLanguages: Go GoThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
Summary
Resolves #133 — coverage publishing now the repo is public. Self-hosted, no third-party SaaS (chosen over Codecov/Coveralls for supply-chain posture, Codecov's ownership churn, and the "two official numbers" problem — full rationale in the issue thread). The coverage gate is unchanged:
make cov's thresholds in.testcoverage.ymlstay the only merge gate. Everything here is publishing and is non-gating.1. Go coverage README badge (self-hosted)
cov badgesubcommand (scripts/cov/main.go) emits a shields.io endpoint JSON for the merged Go total using the exact number the gate computes (same.testcoverage.ymlexcludes) — the badge can never disagree with the gate.badgejob (main-push only, the sole holder ofcontents:write, off a trusted-main checkout) publishes it to an orphanbadgesbranch viascripts/ci/publish-badge.sh. The README reads it overraw.githubusercontent.com.2. PR drop comments (GitHub Code Quality — native/first-party)
coveragejob converts the merged Go profile to Cobertura (go tool gocover-cobertura, a new pinnedtooldep;-ignore-dirsmirrors the YAML's global excludes) and uploads viaactions/upload-code-coverage(code-quality: write). Thegithub-code-quality[bot]posts the aggregate + per-file diff-vs-maincomment.continue-on-error, so this public-preview feature can never red CI. Fork PRs skip it (nocode-qualitytoken, per GitHub's own guard). Code Quality is enabled on the repo (Settings → Code quality).Notes
badgesbranch) and the Code Quality baseline; PRs opened after that get the bot comment.actionlintdoesn't recognize the previewcode-qualityscope yet → suppressed narrowly in.github/actionlint.yaml(a genuine scope typo still fails).language: javascriptupload + a second badge JSON).Validation
make cigreen (all Go suites + merged + ts-total gates).go build/go mod tidyclean.scripts/ci/publish-badge.shsimulated end-to-end against a bare remote (orphan-create → no-op-on-unchanged → fast-forward-update; caught + fixed a macOSinstall -Dportability bug before it could bite CI).Closes #133.
🤖 Generated with Claude Code