Skip to content

Fix/cargo workspace deps version for publishing#2017

Open
vemilano wants to merge 2 commits into
commitizen-tools:masterfrom
vemilano:fix/cargo-workspace-deps-version
Open

Fix/cargo workspace deps version for publishing#2017
vemilano wants to merge 2 commits into
commitizen-tools:masterfrom
vemilano:fix/cargo-workspace-deps-version

Conversation

@vemilano

Copy link
Copy Markdown
Contributor

Description

This PR makes 2 things:

  1. Fixes CRASH on cargo provider #2001. Commitizen was crashing when a workspace member had a fixed version
  2. Add support for rust projects with workspace members that want to publish their crates on crates.io

Regarding the second point, to provide more details, crates.io requires that each crate have a version specified in Cargo.toml. For projects that use a workspace, this means that all members using version.workspace = true must also have a version specified at the workspace.dependencies level (the specified version must be the same as that of workspace.version).

When performing a version bump, in addition to updating workspace.version (in Cargo.toml) and the versions in Cargo.lock, we must also update the versions specified in Cargo.toml, since they are actually dynamically managed by Cargo via version.workspace = true.

Projects such as crate-ci/cargo-release or pksunkara/cargo-workspaces also use the same process

Checklist

Was generative AI tooling used to co-author this PR?

no

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@Lee-W Lee-W force-pushed the fix/cargo-workspace-deps-version branch from bba3019 to 9277972 Compare June 19, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRASH on cargo provider

1 participant