Inherit crate version from [workspace.package] - #106
Merged
Merged
Conversation
All workspace members carried their own `version = "0.1.0"` in Cargo.toml, so a release had to touch eight manifests to bump the version — and in practice they were never bumped, leaving every crate at 0.1.0. That stale version is what `utoipa` reports as the OpenAPI `info.version` (via the api crate's CARGO_PKG_VERSION), so the published openapi.yaml and everything generated from it advertised 0.1.0. Move the version to `[workspace.package]` and have each member inherit it with `version.workspace = true`. Releasing is now a single edit (or `cargo set-version --workspace <VER>`), keeping all crates and the OpenAPI version in lockstep. The version itself is intentionally left at 0.1.0 here — the next release bumps it through the workspace key.
Merged
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.
What
Move the crate version to
[workspace.package]and have every member crate inherit it withversion.workspace = true, instead of each manifest hard-coding its ownversion.Why
All eight workspace members carried their own
version = "0.1.0", so bumping the release version meant editing eight manifests — and in practice it never happened, leaving every crate at0.1.0. Sinceutoipaderives the OpenAPIinfo.versionfrom theapicrate'sCARGO_PKG_VERSION, that stale0.1.0propagated into the publishedopenapi.yaml, the rendered API reference on the docs site, and the generated SDKs.With this change, releasing bumps the version in one place —
[workspace.package].version— or viacargo set-version --workspace <VER>, keeping all crates and the OpenAPI version in lockstep. This pairs with the release-runbook fix in platzio/dev#6.Note
The version is intentionally left at
0.1.0here — no bump. The next release will set it through the workspace key (a release is planned right after this merges). Inter-crate dependencies are path-only (no version pins), so nothing else needed touching, andCargo.lockis unchanged.Verification
cargo metadata --no-depsresolves all eight crates at0.1.0through the workspace, confirming the inheritance is wired correctly:https://claude.ai/code/session_012x3qrx2pZ4HtbhJPB6W5Zv
Generated by Claude Code