fix(ci): stop clap_usage changes from majoring usage-lib and usage-cli#745
Conversation
A clap_usage-only PR (#743) made release-plz propose v5.0.0 for usage-lib and usage-cli hours after v4.0.0 shipped, with no source change in either. `git cliff --bumped-version` reads the whole repo, so the `!` on a clap_usage commit majored everything, while `cargo set-version --exclude clap_usage` then applied that version to every crate except the one that actually broke. Scope the bump and the changelog to lib/ and cli/ so the version reflects the crates it is set on. Confirmed: scoped, there is nothing to bump since v4.0.0, which is correct — neither crate has changed. Also exit before opening a release PR when the bumped version equals the current one. Without that the fixed calculation would keep reopening a PR that bumps nothing, and #744 could not simply be closed because the next run would recreate it. Separately, publish clap_usage when its manifest is ahead of crates.io. The release path only ever published usage-lib and usage-cli, so clap_usage sat unpublished at 2.0.3 from 2025-01 until now despite the workspace building against a much newer version. Its version stays hand-managed, so the check is against the index rather than the usage-lib tag. `breaking_always_bump_major` is left alone: the policy is right, it was being applied to the wrong crates. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a028da7. Configure here.
Greptile SummaryThis PR adjusts release automation to separate clap_usage publishing from usage-lib and usage-cli version calculation.
Confidence Score: 3/5The PR is not yet safe to merge because clap_usage can still be published before its newly published usage-lib dependency is available in the crates.io index. The script invokes the two cargo publish commands consecutively, so normal registry propagation delay can make clap_usage dependency validation fail, aborting the release before usage-cli publication and tag creation. Files Needing Attention: tasks/release-plz Important Files Changed
Reviews (2): Last reviewed commit: "fix(ci): publish clap_usage in dependenc..." | Re-trigger Greptile |
…g call Two problems with the previous commit: clap_usage was published from a block at the top of the script, before usage-lib. It depends on usage-lib at the workspace version, so on a release where both advance, cargo would reject the publish for an unpublished dependency and `set -e` would abort before usage-lib went out at all. It is now a function called in dependency order — after usage-lib, before usage-cli — plus once more on the path where usage-lib is already released and only clap_usage is behind, which is today's situation. The bump was scoped to lib/ and cli/ but `git cliff --bump` for CHANGELOG.md and the PR body were not, so a clap_usage breaking commit could still drive the changelog to a major while cargo set-version applied the scoped version. All four git cliff invocations are scoped now. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Both findings were real; fixed. clap_usage published before usage-lib (cursor, and greptile independently) — correct, and it would have been worse than a failed clap_usage publish. It depends on usage-lib at the workspace version, so on a release where both advance, cargo rejects the publish for an unpublished dependency and Now a function called in dependency order — Changelog bump not path scoped (cursor) — also correct. I scoped Dry run on the current state is unchanged and still what we want:
This comment was generated by an AI coding assistant. |

#744 proposes v5.0.0 for
usage-libandusage-cli— hours after v4.0.0 shipped, with no source change in either crate. This fixes the cause, so it stops being regenerated.Why v5
tasks/release-plzcomputes one version for the whole repo:#743 was
feat(clap_usage)!:. git-cliff saw the!and majored the repo;set-versionthen applied 5.0.0 to every crate except the one that actually broke. So the two crates that didn't change get a major, andclap_usagegets nothing.Scoped to the crates the version is actually set on, there is nothing to bump:
Which is correct — neither crate has changed since v4.0.0.
Three changes
Scope the bump and changelog to
lib/andcli/. The version now reflects the crates it's set on.Exit before opening a release PR when the bumped version equals the current one. Without this the corrected calculation would keep reopening a PR that bumps nothing — and it's why #744 can't just be closed today: the next run recreates it. With this, closing it sticks.
Publish
clap_usagewhen its manifest is ahead of crates.io. The publish path only ever ran:clap_usageisn't there, which is why it sat unpublished at 2.0.3 from 2025-01 until now while the workspace built against a far newer version — and why the trusted-publisher config for it has never been exercised. Its version stays hand-managed, so the check is against the crates.io index rather than the usage-lib tag, and it publishes in dependency order (usage-lib→clap_usage→usage-cli).breaking_always_bump_major = trueis deliberately left alone. The policy is right; it was being applied to the wrong crates.Dry run
Exactly the two intended outcomes:
clap_usage4.0.0 finally ships, and no spurious v5.After merging
The next release-plz run will not recreate #744, so it can be closed.
clap_usage4.0.0 publishes through trusted publishing on that run.This PR was generated by an AI coding assistant.
Note
Medium Risk
Changes release tagging, changelog generation, and crates.io publish order; mistakes could skip needed releases or publish the wrong crate version.
Overview
Fixes release automation so breaking
clap_usagecommits no longer force a major bump onusage-lib/usage-cliwhen those crates did not change.Version and changelog from
git cliffare now limited tolib/**andcli/**, matching wherecargo set-versionapplies. If the bumped version equals the currentusage-libversion, the script exits without opening a release PR, so empty v5-style bumps stop recurring.Adds
publish_clap_usage_if_needed: compares the manifest version to crates.io and publishesclap_usageafterusage-lib(and again on the tag path when the workspace is already released), since that crate was previously never published by this script.Reviewed by Cursor Bugbot for commit cee8990. Bugbot is set up for automated code reviews on this repo. Configure here.