fix: guard release tag against workspace version mismatch - #60
Open
Atishyy27 wants to merge 1 commit into
Open
Conversation
release.sh takes the release tag as an arbitrary CLI arg and never checks it against [workspace.package].version in Cargo.toml. infigraph-cli's --version comes from clap's version field, which pulls CARGO_PKG_VERSION at compile time from that same Cargo.toml. So a forgotten version bump (or a typo in the tag arg) ships binaries whose --version output silently disagrees with the git tag/GitHub release they're uploaded under, with no way to fix it after the fact short of deleting the release. Guard by comparing the tag (v-prefix stripped) against the workspace version before any build starts, and fail with a clear message pointing at the fix in either direction.
Atishyy27
requested review from
WinterQuant,
johnintuit,
murari316 and
sandeep-mewara
as code owners
August 13, 2026 20:27
3 tasks
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
release.shtakes the release tag as a raw CLI arg (./release.sh v0.10.0) and never checks it against[workspace.package].versioninCargo.toml.infigraph-cliandinfigraph-mcpboth derive--versionfrom clap'sversionfield, which readsCARGO_PKG_VERSIONat compile time from that same Cargo.toml.So if the workspace version isn't bumped before running
release.sh v0.11.0(or the tag arg has a typo), the built binaries silently report--versionas the old/wrong value while the GitHub release and git tag say something else. There's no guard, and no way to fix it after upload short of deleting the release and re-running.Change
Added a check right after the version arg is parsed: strip the
vprefix from the tag, compare it against[workspace.package].version, and exit with a clear message (pointing at the fix in either direction) before any build starts.Test plan
./release.sh v3.3.0against the currentCargo.toml(version = "3.2.15") fails withError: release tag v3.3.0 does not match [workspace.package].version 3.2.15 in Cargo.toml.;./release.sh v3.2.15passes the guard and proceeds.bash -n release.sh— syntax check passes.cargo test --all/cargo clippy— n/a, pure shell change, no Rust touched.Notes
Didn't run a full release build (needs cmake + full rust toolchain + would actually create/upload a release asset), the guard is a pure, isolated string comparison at the top of the script before the build/upload logic runs, so testing it standalone covers the actual change.
Fixes #49.