feat(ci): repo-scoped ripr badges (#182 PR 2)#232
Conversation
Adds public README badges for `ripr` and `ripr+` as Shields endpoint JSON committed under `badges/`. Per upstream ripr policy, README badges must be repo-scoped — a diff-scoped artifact would read `0` on `main` simply because no diff exists, not because the repo is clean. The PR-time pilot artifact added in #230 stays diff-scoped and is never republished as a README badge. cargo xtask repo-ripr-badge-artifacts runs `ripr check --root . --mode ready --format repo-exposure-json`, extracts `metrics.headline_eligible` (the count of repo seams the configured `[severity.seams]` policy treats as non-off), maps the number to a Shields color, and writes both endpoint files. The command REQUIRES `ripr` on PATH — unlike `cargo xtask ripr-pr` which is advisory locally, regenerating badges with stale numbers is worse than failing loud. Threshold mapping for Shields color: 0 brightgreen (inbox-zero goal) 1..=99 yellowgreen 100..=999 orange 1000+ red Initial Shipper count: 2,711 (red). Both badges currently project the same count; differentiating `ripr+` to include unsuppressed test-efficiency findings is upstream territory and deferred. Receipts and metadata: policy/generated-allowlist.toml `badges/*.json` glob, kind `shields_badge_endpoint`, classification `generated` .gitattributes `badges/*.json` linguist-generated README.md two new badges (ripr, ripr+) linking docs/ci/ripr.md docs/ci/ripr.md new "Repo Badges" section: scope (repo not diff), Shields URLs, schema, regen command, threshold mapping, refresh cadence Refresh cadence is intentionally manual — the badge is a repo health endpoint, not a PR tax. An optional workflow_dispatch refresh job is mentioned as a future extension but not added here. Tests: ripr::tests::shields_color_thresholds (new) ripr::tests::write_shields_endpoint_shape (new) 21/21 tests passing.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
Droid finished @EffortlessSteven's task —— View job Droid Review Complete — PR #232Status: ✅ Approved — no actionable findings. SummaryLGTM — no issues found. The new Validation Details
Inspected surfaces: Residual risk: None identified for this PR scope. |
* feat(ci): mutation testing PR-time lane + cargo xtask mutants-pr (#182 PR 3) Adds a label-gated PR-time mutation lane and the xtask wrapper it invokes, keeping mutation off every PR's hot path while making it cheap to opt in when warranted. cargo xtask mutants-pr --changed [--base origin/main] [--dry-run] is a thin wrapper around `cargo-mutants` that: 1. Refuses to run without `--changed`. Whole-workspace mutation is intentionally not part of the PR-time lane — that lives in the weekly schedule (see docs/ci/test-evidence-lanes.md). 2. Computes `git diff <base>...HEAD --name-only -- '*.rs'`, filters out `tests/` and `benches/` paths (cargo-mutants only mutates production source). 3. Runs `cargo mutants --no-shuffle --file <each-path>` (or `--list` when `--dry-run` is passed). 4. If `cargo-mutants` is missing locally, prints install instructions and exits advisory-success rather than erroring. CI installs the tool before invoking. 5. Surfaces `cargo mutants` non-zero exit codes — surviving mutants are load-bearing failures, unlike ripr's purely advisory findings. `.github/workflows/mutation.yml` adds the `mutants-pr` job alongside the existing `mutants-weekly` job. The PR job's gate: if: github.event_name == 'pull_request' && ( contains(github.event.pull_request.labels.*.name, 'mutation') || contains(github.event.pull_request.labels.*.name, 'full-ci') ) The weekly job's crate list stays unchanged (shipper-duration, shipper-types, shipper-config). Expanding it to the full trust-critical surface (shipper-core, shipper-encrypt, etc.) is too expensive for a 60-minute job and is its own future rollout step; the policy stays about routing, not coverage scope. xtask/src/mutants.rs new — 3 unit tests xtask/src/main.rs `mutants-pr` subcommand wiring .github/workflows/mutation.yml two-job split (mutants-weekly + mutants-pr) docs/ci/test-evidence-lanes.md advisory-routed table + targeted mutation section updated CHANGELOG.md Added entry Tests: mutants::tests::install_hint_mentions_cargo_install (new) mutants::tests::args_defaults_are_explicit (new) mutants::tests::changed_requires_the_flag (new) 24/24 tests passing. Refs #182 (this is the third PR in the #182 sequence: advisory lane in #230, --base + projection in #231, badges in #232, mutation scoping here). * fix(xtask): wrap mutants-pr doc-comment Behaviour block in fenced code `<REF>` inside a doc comment is parsed by rustdoc as an invalid HTML tag under `-D rustdoc::invalid-html-tags` (implied by RUSTDOCFLAGS=-D warnings on the CI Documentation job). Wrap the whole Behaviour block in a ```text fence so the angle brackets are literal.
Summary
Adds the public README badges for
riprandripr+as Shields endpoint JSON committed underbadges/. Repo-scoped, not diff-scoped — a diff-scoped artifact would read0on `main` simply because no diff exists, not because the repo is clean.What changed
cargo xtask repo-ripr-badge-artifacts(new) — runsripr check --root . --mode ready --format repo-exposure-json, extractsmetrics.headline_eligible, maps to a Shields color, writes both endpoint files. Requiresripron PATH (regenerating with stale numbers is worse than failing loud).badges/ripr.json+badges/ripr-plus.json(new) — initial values committed: 2711 (red).README.md— two new badge images linkingdocs/ci/ripr.md.docs/ci/ripr.md— new "Repo Badges" section explaining the repo-scoped framing, the Shields URLs, the JSON schema, the regen command, the threshold mapping, and the manual refresh cadence.policy/generated-allowlist.toml—badges/*.jsonglob receipted asshields_badge_endpoint..gitattributes—badges/*.json linguist-generated=true(hides badges from default diff view and language stats).Threshold mapping (Shields color)
```
0 brightgreen (inbox-zero goal)
1..=99 yellowgreen
100..=999 orange
1000+ red
```
Tunable as Shipper's debt shrinks.
Initial Shipper numbers
Both badges project
metrics.headline_eligible = 2711⇒ `red`. Differentiatingripr+to also include unsuppressed test-efficiency findings is upstream territory and deferred.Refresh cadence
Manual. Run
cargo xtask repo-ripr-badge-artifactslocally and commit the regenerated badges in their own PR. The badge is a repo health endpoint, not a PR tax. An optional workflow_dispatch refresh workflow is noted as a future extension but not added here.Test plan
cargo build -p xtask— cleancargo test -p xtask— 21/21 (two new:shields_color_thresholds,write_shields_endpoint_shape)cargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleancargo xtask repo-ripr-badge-artifactslocally — generates both endpoints, headline_eligible=2711cargo xtask check-file-policy --mode blocking-allowlist— unreceipted=0 with the new badge filesScope explicitly excludes (deferred)
.github/workflows/ripr-badges-refresh.yml(manual workflow_dispatch).ripr+fromripr(requires combining exposure + test-efficiency upstream).Refs #182.