You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): plumb release tag into mergify --version (#1576)
`Cargo.toml` is pinned at `0.0.0` because cargo's semver rejects the
project's 4-component calver (`2026.4.23.1`), so `--version` reported
the placeholder on every release wheel — bad signal for support and
diagnostics, and the reason the flag had been disabled outright.
Solution: keep `Cargo.toml` at the placeholder, but accept the real
version via a `MERGIFY_RELEASE_VERSION` env var the release workflow
sets from `$GITHUB_REF`. `crates/mergify-cli/build.rs` re-exports it
as a `rustc-env` so `option_env!` at compile time can fold it into a
`VERSION` const, with `CARGO_PKG_VERSION` as the dev-build fallback.
Clap reads `VERSION` directly (re-enabling `--version`), and the CLI
schema generator (`_internal dump-cli-schema`) routes through the
same const so the published reference matches what the binary says.
The release path is the same as before: `build-wheels.yml`'s stamp
step still writes the tag into `pyproject.toml`; it now also pushes
the same value into `$GITHUB_ENV` so the maturin build sees it. PR
smoke builds skip the stamp step, so the binary reports `0.0.0` —
locked in by a new `mergify --version` smoke test in CI and two
unit tests pinning the `--version` flag and the env fallback.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments