Skip to content

fix: guard release tag against workspace version mismatch - #60

Open
Atishyy27 wants to merge 1 commit into
intuit:mainfrom
Atishyy27:fix/49-release-version-guard
Open

fix: guard release tag against workspace version mismatch#60
Atishyy27 wants to merge 1 commit into
intuit:mainfrom
Atishyy27:fix/49-release-version-guard

Conversation

@Atishyy27

@Atishyy27 Atishyy27 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

release.sh takes the release tag as a raw CLI arg (./release.sh v0.10.0) and never checks it against [workspace.package].version in Cargo.toml. infigraph-cli and infigraph-mcp both derive --version from clap's version field, which reads CARGO_PKG_VERSION at 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 --version as 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 v prefix 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

  • Manually verified the guard in isolation: ./release.sh v3.3.0 against the current Cargo.toml (version = "3.2.15") fails with Error: release tag v3.3.0 does not match [workspace.package].version 3.2.15 in Cargo.toml.; ./release.sh v3.2.15 passes 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

infigraph --version reports 3.2.6 in both v3.2.7 and v3.2.8 release binaries

1 participant