Skip to content

fix: unblock CI (rust-1.95 clippy + SHA-pinned actions)#19

Merged
nh13 merged 2 commits into
mainfrom
fix/clippy-1.95-warnings
Apr 30, 2026
Merged

fix: unblock CI (rust-1.95 clippy + SHA-pinned actions)#19
nh13 merged 2 commits into
mainfrom
fix/clippy-1.95-warnings

Conversation

@nh13

@nh13 nh13 commented Apr 30, 2026

Copy link
Copy Markdown
Member

Why

CI on main was effectively broken by two simultaneous issues:

  1. The rust-1.95 release introduced new clippy lints that fired under -D warnings, breaking the pre-commit hook (cargo ci-lint) and blocking any new commit.
  2. The org-level GitHub Actions policy "all actions must be pinned to a full-length commit SHA" started rejecting workflow files at the setup step.

This PR fixes both so commits can land and CI can run again.

Commits

fix(clippy): address new lints from rust-1.95

  • clippy::manual_checked_ops in src/catalog/builder.rs — rewrite the pct closure with (n * 100).checked_div(total).unwrap_or(0), semantically identical to the existing if total == 0 { 0 } else { (n * 100) / total } form.
  • clippy::unnecessary_sort_by in src/catalog/index.rs (×2) — replace sort_by(|a, b| b.1.cmp(&a.1)) with sort_by_key(|b| std::cmp::Reverse(b.1)). Stable sort, identical ordering.

ci: pin actions to full-length commit SHAs

Every uses: line in .github/workflows/ now uses a 40-char SHA with the original tag preserved as a trailing comment. For dtolnay/rust-toolchain (was @stable) and taiki-e/install-action (was @nextest), an explicit with: toolchain: stable / with: tool: nextest was 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)
  • CI now passes on this PR (pre-rust-1.95 it was failing on the org SHA-pin policy).

No behavioral change in either commit.

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.
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@nh13 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 35 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27693a69-e702-4526-86ef-89522e8001d8

📥 Commits

Reviewing files that changed from the base of the PR and between 104baf3 and dcbd55b.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • .github/workflows/deploy-local.yml
  • .github/workflows/publish.yml
  • src/catalog/builder.rs
  • src/catalog/index.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clippy-1.95-warnings

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.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 26 minutes and 35 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

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.
@nh13 nh13 changed the title fix(clippy): address new lints from rust-1.95 fix: unblock CI (rust-1.95 clippy + SHA-pinned actions) Apr 30, 2026
@nh13 nh13 merged commit 80b4686 into main Apr 30, 2026
4 checks passed
@nh13 nh13 deleted the fix/clippy-1.95-warnings branch April 30, 2026 21:53
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