Repository navigation
Keep Cargo.lock current on the release branch and check it - #166
Merged
Merged
Conversation
release-please bumps each crate's Cargo.toml but looks for a lock file inside the package folder, so the workspace Cargo.lock at the root kept the old versions and the next cargo build rewrote a tracked file. The release-refresh job now runs cargo update --workspace, which sets the workspace crates' versions and moves no dependency, and commits Cargo.lock with the other derived files. CI and just check gain a --locked step that fails on a lock file that disagrees with the manifests; in just check it runs first, before any cargo command could rewrite the file. Co-Authored-By: Claude Fable 5.2 <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.
What
release-please bumps each crate's
Cargo.tomlbut looks for a lock file inside the package folder, so the workspaceCargo.lockat the repository root kept the old version of every crate a release bumped. The next cargo build then rewrote a tracked file (fixed by hand once, in #165)..github/workflows/release-refresh.yml: a new step runscargo update --workspaceon the release branch andCargo.lockjoins the files the refresh commit stages. The step iscontinue-on-error, like the pins step, with its own failing step at the end, so a cargo failure does not block the other derived files and still turns the job red..github/workflows/ci.yml: a step in the wiring job runscargo metadata --lockedand fails when the lock file disagrees with the manifests.Justfile: alockrecipe with the same command, first incheckso that no later cargo command can quietly rewrite a stale lock file before it is checked.docs/PLUGIN_GUIDELINES.md: theCargo.lockrow now names what fails.Measured
In a scratch copy with one crate bumped from 0.3.0 to 0.4.0:
cargo metadata --lockedexits 101.cargo update --workspacechanges exactly one line ofCargo.lock(that crate's version) and no dependency;--lockedthen passes.--offlineit fails, so the step uses the network.Not measured
The refresh step on a real runner. Its first live run is the next release PR that bumps a crate.
🤖 Generated with Claude Code