Skip to content

ci: pin Rust toolchain and add version consistency guard#872

Merged
kys0213 merged 1 commit into
mainfrom
ci/version-consistency-and-toolchain-pin
Apr 23, 2026
Merged

ci: pin Rust toolchain and add version consistency guard#872
kys0213 merged 1 commit into
mainfrom
ci/version-consistency-and-toolchain-pin

Conversation

@kys0213

@kys0213 kys0213 commented Apr 23, 2026

Copy link
Copy Markdown
Owner

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.json version
    • Cargo.toml version
    • Latest git tag version

    The 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.toml to pin the Rust toolchain to version 1.95.0 with rustfmt and clippy components, ensuring consistent builds across environments.

Notable Implementation Details

  • The version consistency check uses jq, grep, and git tag to extract and compare versions
  • Includes intelligent detection of Release PR merge commits by checking commit message patterns (chore(main): release)
  • Provides actionable error messages with recovery steps for tag-creation failures
  • Uses fetch-depth: 0 to ensure full git history is available for tag inspection

https://claude.ai/code/session_011gh13DXdwEkbrC55EvmPVt

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>
@kys0213 kys0213 changed the title Add version consistency check and pin Rust toolchain ci: pin Rust toolchain and add version consistency guard Apr 23, 2026
@kys0213 kys0213 merged commit 7a95199 into main Apr 23, 2026
5 checks passed
@kys0213 kys0213 deleted the ci/version-consistency-and-toolchain-pin branch April 23, 2026 03:15
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