René's URL Explorer Experiment


Title: fix(cargo_provider): support workspace virtual manifests by jcfangc · Pull Request #1733 · commitizen-tools/commitizen · GitHub

Open Graph Title: fix(cargo_provider): support workspace virtual manifests by jcfangc · Pull Request #1733 · commitizen-tools/commitizen

X Title: fix(cargo_provider): support workspace virtual manifests by jcfangc · Pull Request #1733 · commitizen-tools/commitizen

Description: Description Fix cargo_provider so cz bump works with Cargo workspace virtual manifests (root Cargo.toml containing [workspace] / [workspace.package] but no [package]) when workspace members inherit the version via package.version.workspace = true. Previously, cz bump could crash in commitizen/providers/cargo_provider.py with: NonExistentKey: Key "package" does not exist (virtual manifest has no [package]) TypeError: expected root version to be a string / unsafe assumptions around package.version shape This change makes the provider: Read/write the version from [workspace.package].version when present (fallback to [package].version for non-workspace manifests). When updating Cargo.lock: For non-workspace manifests, update the root package entry. For workspace virtual manifests, scan workspace.members (respecting exclude) and update lock entries for crates that declare package.version.workspace = true. Fixes #1732 Checklist I have read the contributing guidelines Added test coverage for the introduced behavior and edge cases Ran the test suite locally Manually tested the behavior (workspace virtual manifest + non-workspace crate) Updated documentation (not needed for this change) Note: the project uses uv / poe tasks (not Poetry). I ran the equivalent poe / uv-based test commands. Expected Behavior cz bump with version_provider = "cargo" should succeed for Cargo workspaces using a virtual manifest and centralized versioning in [workspace.package].version, without crashing. The workspace version should be updated, and Cargo.lock entries for crates inheriting the workspace version (package.version.workspace = true) should be updated safely. Non-workspace projects (root [package]) keep existing behavior. Steps to Test This Pull Request Manual test (workspace virtual manifest) Create a workspace root Cargo.toml: [workspace] members = ["crates/*"] [workspace.package] version = "1.0.0" edition = "2024" rust-version = "1.92" repository = "https://example.com/repo.git" Add a member crate crates/common-core/Cargo.toml: [package] name = "common-core" version.workspace = true edition.workspace = true rust-version.workspace = true repository.workspace = true Generate Cargo.lock once: cargo build Configure Commitizen: [tool.commitizen] name = "cz_conventional_commits" tag_format = "v$version" version_scheme = "semver" version_provider = "cargo" update_changelog_on_bump = true version_files = ["Cargo.toml:workspace.package.version"] Run: cz bump --yes Verify: [workspace.package].version is updated (e.g., 1.0.0 -> 1.1.0) Cargo.lock entries for workspace crates inheriting the version are updated no exceptions are raised Manual test (non-workspace manifest) Use a standard crate with root [package] and an existing Cargo.lock. Run cz bump --yes and verify the root package version in Cargo.lock is updated as before. Additional Context Reported in #1732. Targets workspace virtual manifests (no root [package]) and avoids unsafe assumptions about the TOML shape of version fields.

Open Graph Description: Description Fix cargo_provider so cz bump works with Cargo workspace virtual manifests (root Cargo.toml containing [workspace] / [workspace.package] but no [package]) when workspace members inherit...

X Description: Description Fix cargo_provider so cz bump works with Cargo workspace virtual manifests (root Cargo.toml containing [workspace] / [workspace.package] but no [package]) when workspace members inherit...

Opengraph URL: https://github.com/commitizen-tools/commitizen/pull/1733

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:69771310-f157-c81f-4cd6-96639252748d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBD38:14FB0B:A9447D4:DB6623A:69765FD7
html-safe-noncea10035544ea4c3b0bc280a147f3fd2880bed6faeb128d7f4bc6934eb3ea51803
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDM4OjE0RkIwQjpBOTQ0N0Q0OkRCNjYyM0E6Njk3NjVGRDciLCJ2aXNpdG9yX2lkIjoiNTk3NjAwNjE0MTUzMDIzNDg0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac09af7a73fb050273cdab773c87831dc1a6709a62048da8f183f1a594ba37c02d
hovercard-subject-tagpull_request:3124839433
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/commitizen-tools/commitizen/pull/1733/files
twitter:imagehttps://avatars.githubusercontent.com/u/111571686?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/111571686?s=400&v=4
og:image:altDescription Fix cargo_provider so cz bump works with Cargo workspace virtual manifests (root Cargo.toml containing [workspace] / [workspace.package] but no [package]) when workspace members inherit...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git
octolytics-dimension-user_id62252524
octolytics-dimension-user_logincommitizen-tools
octolytics-dimension-repository_id106127589
octolytics-dimension-repository_nwocommitizen-tools/commitizen
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id106127589
octolytics-dimension-repository_network_root_nwocommitizen-tools/commitizen
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5b577f6be6482e336e3c30e8daefa30144947b17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommitizen-tools%2Fcommitizen%2Fpull%2F1733%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcommitizen-tools%2Fcommitizen%2Fpull%2F1733%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=commitizen-tools%2Fcommitizen
Reloadhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
Reloadhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
Reloadhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
commitizen-tools https://patch-diff.githubusercontent.com/commitizen-tools
commitizenhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen
Please reload this pagehttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Fork 314 https://patch-diff.githubusercontent.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Star 3.2k https://patch-diff.githubusercontent.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen
Code https://patch-diff.githubusercontent.com/commitizen-tools/commitizen
Issues 124 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/issues
Pull requests 27 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pulls
Discussions https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/discussions
Actions https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/actions
Projects 0 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/projects
Security 0 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/security
Insights https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pulse
Code https://patch-diff.githubusercontent.com/commitizen-tools/commitizen
Issues https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/issues
Pull requests https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pulls
Discussions https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/discussions
Actions https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/actions
Projects https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/projects
Security https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/security
Insights https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2Fcommitizen-tools%2Fcommitizen%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fcommitizen-tools%2Fcommitizen%2Fissues%2Fnew%2Fchoose
jcfangchttps://patch-diff.githubusercontent.com/jcfangc
commitizen-tools:masterhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/tree/master
jcfangc:fix/cargo-workspace-virtual-manifesthttps://patch-diff.githubusercontent.com/jcfangc/commitizen/tree/fix/cargo-workspace-virtual-manifest
Conversation 18 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733
Commits 5 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/commits
Checks 20 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/checks
Files changed https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
Please reload this pagehttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
fix(cargo_provider): support workspace virtual manifests https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#top
Show all changes 5 commits https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
36d49e9 fix(cargo_provider): support workspace virtual manifests jcfangc Dec 23, 2025 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/commits/36d49e9bd06f1d9d30ad53ff7f12ae3da9816854
9a4e266 style: run formatter jcfangc Jan 4, 2026 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/commits/9a4e266b86b09416ce37999db23c1df23351fa77
fc4bfc5 fix(types): remove unused type ignore jcfangc Jan 4, 2026 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/commits/fc4bfc543035d66124903047613ca14bbfe22682
08852bf fix(provider): harden cargo version parsing and lockfile updates jcfangc Jan 5, 2026 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/commits/08852bf3bc6cfc92aa39aace4a6bb2bce02672c7
0eead00 refactor(cargo_provider): improve readability and maintainability jcfangc Jan 6, 2026 https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/commits/0eead0080ac128d77b89781fb7c648c48b3d4e63
Clear filters https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
Please reload this pagehttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
Please reload this pagehttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
cargo_provider.py https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-4b6758b754116c8b7b307ab00ad99c4cb77cbfa4839049f4c22e8f0f922f007d
test_cargo_provider.py https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-f6851ca18f1e379b68cc67d878c74dd2a704e179792f6cca9d07d4f4716043df
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/blob/master/.github/CODEOWNERS#L1
commitizen/providers/cargo_provider.pyhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-4b6758b754116c8b7b307ab00ad99c4cb77cbfa4839049f4c22e8f0f922f007d
View file https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/blob/0eead0080ac128d77b89781fb7c648c48b3d4e63/commitizen/providers/cargo_provider.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-4b6758b754116c8b7b307ab00ad99c4cb77cbfa4839049f4c22e8f0f922f007d
Please reload this pagehttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-4b6758b754116c8b7b307ab00ad99c4cb77cbfa4839049f4c22e8f0f922f007d
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/blob/master/.github/CODEOWNERS#L1
tests/providers/test_cargo_provider.pyhttps://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-f6851ca18f1e379b68cc67d878c74dd2a704e179792f6cca9d07d4f4716043df
View file https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/blob/0eead0080ac128d77b89781fb7c648c48b3d4e63/tests/providers/test_cargo_provider.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-f6851ca18f1e379b68cc67d878c74dd2a704e179792f6cca9d07d4f4716043df
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-f6851ca18f1e379b68cc67d878c74dd2a704e179792f6cca9d07d4f4716043df
https://patch-diff.githubusercontent.com/commitizen-tools/commitizen/pull/1733/files#diff-f6851ca18f1e379b68cc67d878c74dd2a704e179792f6cca9d07d4f4716043df
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.