fix: guard release tag against workspace version mismatch - #61
Closed
Atishyy27 wants to merge 1 commit into
Closed
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:42
Author
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 #49.
release.shtakes the release tag as an arbitrary CLI arg and never checks it against[workspace.package].versioninCargo.toml.infigraph-cli's--versioncomes from clap'sversionfield, which pullsCARGO_PKG_VERSIONat compile time from that sameCargo.toml. So a forgotten version bump (or a typo in the tag arg) ships binaries whose--versionoutput 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 — matching exactly what #49 reports (--versionstuck on 3.2.6 across the v3.2.7 and v3.2.8 releases).Guards by comparing the tag (v-prefix stripped) against the workspace version before any build starts, and fails with a clear message pointing at the fix in either direction.
Test plan
bash -n release.shpasses (syntax)Cargo.toml(currently3.2.15): a mismatched tag (v9.9.9) fails with the new error message and exit 1; a matching tag (v3.2.15) passes through cleanlycargo test --all/cargo clippy— not applicable, this is a shell-only change, no Rust touchedNotes
Didn't run the full release build (requires cmake + a real GitHub release target), the change is isolated to the version-guard block before any build/upload step runs, so it can't affect build/package/upload behavior when the versions do match.