fix: guard release.sh against a Cargo.toml/tag version mismatch - #52
Open
arjun2075 wants to merge 1 commit into
Open
fix: guard release.sh against a Cargo.toml/tag version mismatch#52arjun2075 wants to merge 1 commit into
arjun2075 wants to merge 1 commit into
Conversation
release.sh takes a version tag as its only argument but never checks it against Cargo.toml's [workspace.package] version before building. clap derives --version from CARGO_PKG_VERSION at compile time, so a release cut without first bumping Cargo.toml ships a binary whose --version output silently lags the release tag. This is exactly what happened for v3.2.7 and v3.2.8 (intuit#49): no commit ever bumped the workspace version past 3.2.6, so both releases were built and tagged with the stale 3.2.6 baked in -- confirmed via 'git log -p -- Cargo.toml', which shows no version bump between the 3.2.6 commit and the current 3.2.9 one covering 3.2.7/3.2.8 at all. Add a check right after argument parsing: extract the workspace version from Cargo.toml and fail loudly if it doesn't match the requested release tag, before any build/upload work happens. Fixes intuit#49
arjun2075
requested review from
johnintuit,
murari316 and
sandeep-mewara
as code owners
August 5, 2026 17:55
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.
Fixes #49
Root cause
release.shtakes a version tag as its only argument but never checks it againstCargo.toml's[workspace.package] versionbefore building.clapderives--versionfromCARGO_PKG_VERSIONat compile time (crates/infigraph-cli/src/main.rs:49), so a release cut without first bumpingCargo.tomlships a binary whose--versionoutput silently lags the release tag it was built for.Confirmed via
git log -p -- Cargo.toml: the last version bump before the reported bug was3.2.5 → 3.2.6. No commit ever bumped it to3.2.7or3.2.8— the next bump on record is3.2.9. So both v3.2.7 and v3.2.8 were built and tagged with the stale3.2.6baked in, which also explains why v3.2.6 and v3.2.8 share an identicalaarch64-apple-darwinbinary hash (no version-relevant recompile happened between them on that platform).Fix
Add a check right after argument parsing in
release.sh: extract the workspace version fromCargo.tomland fail loudly if it doesn't match the requested release tag ($VERSION), before any build/upload work happens.Testing
release.shisn't part of thecargo testsuite (it's an ops script), so I verified it directly:bash -n release.sh— syntax check passesCargo.toml(currently3.2.9) — matches correctly, and correctly rejects a mismatched tagCargo.toml=3.2.6, tag=v3.2.8) — the guard fires with the exact error above, confirming it would have caught infigraph --version reports 3.2.6 in both v3.2.7 and v3.2.8 release binaries #49 before either broken release shippedI didn't attempt to auto-bump
Cargo.tomlfrom the script — that's a bigger behavior change (deciding whether the script should also commit a version bump) that seemed worth a separate discussion; this PR just stops the bad release from happening silently.