ci: pin Rust toolchain and add version consistency guard#872
Merged
Conversation
Pin the toolchain to 1.95.0 via `rust-toolchain.toml`. Rust releases introduce new clippy lints on every minor, and the CI was using the runner's `stable` default — when clippy 1.95 added `collapsible-match`, `manual-checked-ops`, and `unnecessary-sort-by` lints, the first push to main after the upgrade failed `RUSTFLAGS=-D warnings` with 13 errors (see v0.1.8 Release PR merge, run 24750705751). Pinning makes toolchain bumps a deliberate PR instead of a silent runner-side change. Add a `version-consistency` CI job that cross-checks three values: `Cargo.toml` workspace version, `.release-please-manifest.json`, and the latest `v*` git tag. The manifest is allowed to be one bump ahead of the latest tag only while HEAD is a `chore(main): release` commit (normal Release PR flight). Any other mismatch fails the job with a recovery hint, which would have caught the 2026-04 skip-labeling regression (manifest 0.1.7, latest tag v0.1.6, HEAD not a release commit) on its very first post-regression push. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds automated version consistency validation and pins the Rust toolchain to a specific version for reproducible builds.
Key Changes
Version Consistency CI Job: Added a new GitHub Actions workflow job that validates alignment between:
.release-please-manifest.jsonversionCargo.tomlversionThe check detects silent tag-creation failures by ensuring the manifest version either matches the latest tag (normal state) or is exactly one bump ahead (during an active Release PR). Any other mismatch triggers an error with recovery instructions.
Rust Toolchain Pinning: Added
rust-toolchain.tomlto pin the Rust toolchain to version1.95.0withrustfmtandclippycomponents, ensuring consistent builds across environments.Notable Implementation Details
jq,grep, andgit tagto extract and compare versionschore(main): release)fetch-depth: 0to ensure full git history is available for tag inspectionhttps://claude.ai/code/session_011gh13DXdwEkbrC55EvmPVt