Skip to content

fix(cargo-workspace): delegate to versioning strategy for cascade bumps in prerelease#2836

Open
anishesg wants to merge 1 commit into
googleapis:mainfrom
proudhare:fix/ph-issue-2828
Open

fix(cargo-workspace): delegate to versioning strategy for cascade bumps in prerelease#2836
anishesg wants to merge 1 commit into
googleapis:mainfrom
proudhare:fix/ph-issue-2828

Conversation

@anishesg

@anishesg anishesg commented Jul 3, 2026

Copy link
Copy Markdown

The CargoWorkspace.bumpVersion() method was unconditionally using PatchVersionUpdate().bump() for cascade-bumped packages, which increments the patch version and carries prerelease suffixes verbatim. This caused packages bumped only as dependencies to get incorrect versions during prerelease windows (e.g., 1.0.0-beta.01.0.1-beta.0 instead of 1.0.0-beta.1).

This fix ports the solution from the node-workspace plugin (PR #2249), which delegates to the configured versioningStrategy when available. The strategiesByPath map is already populated in preconfigure() and is now used in bumpVersion() to apply the correct prerelease strategy to cascade-bumped packages.

Added a regression test that verifies prerelease cascade bumps increment the prerelease counter rather than the patch version.

Fixes #2828

…ps in prerelease

The `CargoWorkspace.bumpVersion()` method was unconditionally using `PatchVersionUpdate().bump()` for cascade-bumped packages, which increments the patch version and carries prerelease suffixes verbatim. This caused packages bumped only as dependencies to get incorrect versions during prerelease windows (e.g., `1.0.0-beta.0` → `1.0.1-beta.0` instead of `1.0.0-beta.1`).

Signed-off-by: anish <anishesg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cargo-workspace: cascaded dependent bumps ignore the active prerelease window

1 participant