fix: unbreak cargo publish and stop shipping testdata in the crate - #10
Merged
Conversation
main had Cargo.toml at 0.0.3 while the committed Cargo.lock still recorded fauxrest 0.0.4, so `cargo publish` rewrote the lock file during dependency resolution and then aborted with "1 files in the working directory contain changes that were not yet committed into git: Cargo.lock". update_version.sh only rewrites Cargo.toml and README.md, so the lock file drifted on every release. Running `cargo build` after it regenerates the lock, and `git commit -a` in the same step now picks it up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fauxrest 0.0.2 on crates.io shipped the whole testdata/ tree because the package had no include/exclude. Restrict the package to the crate itself so test fixtures, docs and CI configuration are no longer published. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Six tasks invoked the binary against testdata/tamadalab, which no longer exists. The remaining tasks are untouched. Co-Authored-By: Claude Opus 5 <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
Fixes the
cargo publishfailure in the release pipeline, and stops the cratefrom shipping test fixtures.
Both problems are live on
mainright now: run30353306124
failed at
publish_to_crates_iowithThe Cargo.lock failure
mainhadCargo.tomlat0.0.3while the committedCargo.lockstillrecorded
fauxrest 0.0.4.cargo publishre-resolves dependencies, rewritesthe lock file to match
Cargo.toml, and then refuses to continue because theworking directory became dirty.
The drift comes from
.github/scripts/update_version.sh, which rewritesCargo.tomlandREADME.mdbut never touchesCargo.lock. Runningcargo buildright after it regenerates the lock, and the existinggit commit -ain the same step picks it up — so this stops recurring.The packaging change
Cargo.tomlhad noinclude/exclude, socargo publishpackaged the entirerepository. Adding
excludekeepstestdata/,docs/,.github/and.vscode/out of the published crate.Order matters. Fixing
Cargo.lockalone would make the next publishsucceed and upload
testdata/to crates.io. Both changes need to landtogether, which is why they are in one pull request.
Also included
Six
.vscode/tasks.jsonentries invoked the binary against atestdatadirectory that no longer exists. They are removed; the remaining tasks are
untouched.
Verification
cargo buildandcargo testpass (66 tests + 13 doctests)Cargo.tomlandCargo.lockboth report0.0.3after this changepublish.yaml— that workflow only runs forhead branches matching
releases/v*🤖 Generated with Claude Code