fix: unblock CI (rust-1.95 clippy + SHA-pinned actions)#19
Conversation
Three new clippy errors started firing on `-D warnings` after the
rust-1.95 release:
- `clippy::manual_checked_ops` in src/catalog/builder.rs: rewrite
the `pct` closure with `checked_div(total).unwrap_or(0)`, which
is semantically identical to the existing `if total == 0 { 0 }
else { (n * 100) / total }` form.
- `clippy::unnecessary_sort_by` in src/catalog/index.rs (x2):
replace `sort_by(|a, b| b.1.cmp(&a.1))` with
`sort_by_key(|b| std::cmp::Reverse(b.1))`. Both forms produce a
stable sort by `.1` descending.
No behavioral change. Unblocks the pre-commit hook so README and
other commits can land again.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 26 minutes and 35 seconds.Comment |
Org policy "all actions must be pinned to a full-length commit SHA" was rejecting CI runs at the workflow setup step. Pin every uses: ref to a 40-char SHA, with the original tag preserved as a trailing comment for human readability. For dtolnay/rust-toolchain and taiki-e/install-action, the action's required input was previously inferred from the ref (@stable, @nextest); since SHA-pinning loses that signal and the action errors out without the input, an explicit `with: toolchain:` / `with: tool:` is added.
Why
CI on
mainwas effectively broken by two simultaneous issues:-D warnings, breaking the pre-commit hook (cargo ci-lint) and blocking any new commit.This PR fixes both so commits can land and CI can run again.
Commits
fix(clippy): address new lints from rust-1.95clippy::manual_checked_opsinsrc/catalog/builder.rs— rewrite thepctclosure with(n * 100).checked_div(total).unwrap_or(0), semantically identical to the existingif total == 0 { 0 } else { (n * 100) / total }form.clippy::unnecessary_sort_byinsrc/catalog/index.rs(×2) — replacesort_by(|a, b| b.1.cmp(&a.1))withsort_by_key(|b| std::cmp::Reverse(b.1)). Stable sort, identical ordering.ci: pin actions to full-length commit SHAsEvery
uses:line in.github/workflows/now uses a 40-char SHA with the original tag preserved as a trailing comment. Fordtolnay/rust-toolchain(was@stable) andtaiki-e/install-action(was@nextest), an explicitwith: toolchain: stable/with: tool: nextestwas added since SHA-pinning loses the ref-based input inference and the action otherwise errors.Verification
cargo ci-fmt✓cargo ci-lint✓cargo ci-test✓ (405 tests pass)No behavioral change in either commit.