[MISC] Add 'auto' version bump to OSS create-release#2136
Conversation
Adds an 'auto' choice (now the default) to create-release.yaml that picks the OSS version bump from merged PR titles: a [FEAT]/[GATED-FEAT] PR merged since the last release -> minor, otherwise patch. These are the only feature PR types in the contribution guide, so this matches the documented SemVer intent without any new labeling. Details: - 'auto' resolves in a new "Resolve auto bump" step (main mode only; hotfix lines stay patch-only). Fail-safe is always patch, so a compare/PR query hiccup never over-bumps the public version. - Hotfix-mode input validation now accepts 'auto' (maps to patch). - compute-version consumes the resolved bump; dry-run/final summaries show "auto -> minor/patch" for an explicit audit trail. - 'auto' never selects major — that stays behind the confirm_major gate. Validated by replaying the classifier over the last 13 real releases: 12/13 matched the human bump; the lone diff was a discretionary minor with no FEAT PR (recoverable via manual minor override, which the notice points to). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
WalkthroughThe release workflow now accepts ChangesRelease workflow auto bump
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/create-release.yaml:
- Around line 190-193: The auto-bump classifier in the release workflow is
querying merged pull requests with gh pr list, but the job only has contents:
write, so it cannot read PR metadata. Update the permissions for the job that
runs resolve-bump to include pull-requests: read alongside the existing contents
permission so FEAT_COUNT and the auto bump logic can evaluate merged PR titles
correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6525cb9c-9123-4206-920e-37cf6d5188a3
📒 Files selected for processing (1)
.github/workflows/create-release.yaml
- Add `pull-requests: read` to the job (the permissions block sets unlisted scopes to none, so `gh pr list` would 403 and 'auto' would silently always fall back to patch). [CodeRabbit] - BUMP_TYPE falls back to 'patch' instead of 'auto' when resolved is empty, avoiding a latent "Unknown bump type: 'auto'" job failure. [Greptile] - Surface a warning when the merged-PR query hits the 200-result cap instead of silently under-counting FEAT PRs. [Greptile] Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
From a multi-agent review of the auto-bump step:
- Guard the jq parses: malformed/non-array stdout now degrades to patch
instead of crashing the job under set -e/pipefail (upholds the "never fail
the release outright" invariant). Also validates TOTAL/FEAT_COUNT are numeric
before arithmetic.
- Detect gh failure by exit status (if ! PR_JSON=$(...)) and surface captured
stderr, so a permanent 403 (e.g. dropped pull-requests scope) is diagnosable
rather than a cause-free warning that silently patches forever.
- Add '// empty' to the published_at lookup for consistency with get-latest,
so a JSON null can't leak through as the literal "null".
- Only emit the truncation warning when no FEAT was found within the cap (the
only case where truncation could change the outcome).
- Fix an inaccurate comment ("silently" -> "with a warning") and reword the
self-referential permissions comment.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Unstract test resultsPer-group results
Critical paths
|



What
Adds an
autochoice (now the default) toversion_bumpincreate-release.yaml. Whenautois selected, the workflow derives the OSS bump from merged PR titles:[FEAT]or[GATED-FEAT]PR merged since the last release → minorThese are the only feature PR types in the Contribution Guidelines, so this matches the documented SemVer intent with no new labeling discipline.
Why
Cutting an OSS release currently requires a human to pick
patch/minorevery time — an easy thing to get wrong (a feature shipped as a patch drifts the public version). This is also a prerequisite for making the enterprise RC build trigger OSS releases hands-free: the RC workflow can dispatchversion_bump=autoinstead of guessing.How
Resolve auto bumpstep (runs only whenversion_bump == 'auto'), placed after the existingEnsure there are new commitsno-op guard:automaps topatchthere.[FEAT]/[GATED-FEAT]PRs merged intomainafter the base release'spublished_at.patch— a compare/PR-list query hiccup never over-bumps the public version.::noticewith the decision, including a "re-run withversion_bump=minorto override" hint when it lands on patch.auto(maps topatch).compute-versionconsumes the resolved bump via a passthrough expression (auto→ resolved, otherwise the raw input).auto -> minor/patchfor an explicit audit trail.autonever selectsmajor— that stays behind theconfirm_majorgate.Can this PR break any existing features?
Low risk.
patch/minor/majorbehave exactly as before (the resolve step is gated onautoand the passthrough expression falls through for non-auto). Only the default changes frompatchtoauto. Worst case forautois a query failure, which deterministically falls back topatch— the pre-existing behavior — and is still overridable by selecting a bump explicitly.Notes on Testing
gh/jqcommands in the resolve step were run against the live repo and return the expected result (v0.177.6→patch, 0 FEAT PRs since).v0.176.5 → v0.177.0) with zeroFEAT/GATED-FEATPRs across the whole0.176.xline — i.e. a bump not driven by the convention, recoverable via the manualminoroverride the notice points to.dry_run=truedispatch after merge to eyeball the resolved bump before a real release.Related Issues or PRs
Enables defaulting the enterprise RC build's OSS-release trigger to
auto(follow-up inunstract-cloud).🤖 Generated with Claude Code