Skip to content

ci: pick the release bump from the commits, require a reason to override - #18729

Merged
GermanJablo merged 1 commit into
mainfrom
ci/release-bump-from-commits
Oct 20, 2026
Merged

GermanJablo merged 1 commit into
mainfrom
ci/release-bump-from-commits

Conversation

@GermanJablo

@GermanJablo GermanJablo commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Why

The bump is chosen by hand and nothing checks it. A patch for a release with feat: commits ships without any warning.

What

bump now defaults to auto, which is computed from the commits and is always prerelease on a prerelease line. Any other bump fails before touching git unless override_reason is filled in. The reason is recorded as a notice on the run.

Needs porting to 3.x once #18717 lands.

Related: PYLD-4162

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: payloadcms/payload/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c15bbf4-d019-473e-8d75-f71562a27f8b
📥 Commits

Reviewing files that changed from the base of the PR and between f3c51aa and fddb044.

📒 Files selected for processing: 2
  • tools/releaser/src/release-bump.spec.ts
  • tools/releaser/src/release-bump.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The release workflow and CLI now default to automatic bump selection. The releaser recommends a bump from the current version and commits. A non-auto requested bump requires a nonblank override reason.

Changes: Release bump selection

Layer / File(s) Summary
Bump recommendation and resolution
tools/releaser/src/lib/resolveBump.ts
The releaser recommends prerelease for prerelease versions. For other versions, it uses the commit-derived bump or defaults to patch. A non-auto requested bump requires a nonblank override reason.
Release command and workflow integration
.github/workflows/release-bump.yml, tools/releaser/src/release-bump.ts, tools/releaser/src/release-bump.spec.ts
The command obtains a recommendation from commits since the current version tag and resolves the requested bump. Overrides produce a notice with an escaped reason. The workflow defaults to auto and passes the override reason. Tests use automatic bump requests.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Workflow as Release workflow
  participant CLI as release-bump CLI
  participant Releaser as runReleaseBump
  participant Git as getRecommendedBump
  participant Resolver as resolveBump
  Workflow->>CLI: Pass bump and override reason
  CLI->>Releaser: Run release bump
  Releaser->>Git: Get bump from version tag to HEAD
  Git-->>Releaser: Return commit-derived bump
  Releaser->>Resolver: Resolve request against recommendation
  Resolver-->>Releaser: Return resolved bump or require override reason
Loading
Merge Risk: ⚪ Minimal · up to fddb0

Release bump selection now defaults to automatic selection from commits and requires a reason for manual overrides. No actionable merge-blocking risk was found in the supplied changes.

Architecture risk: 🔵 Low · up to fddb0

The change affects 1 system.

Changed systems: tools

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tools (service) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in tools/releaser/src/lib/resolveBump.ts: Adds the AUTO_BUMP constant and recommendBump, which returns prerelease for prerelease versions and otherwise uses the commit-derived bump or defaults to patch when it is null.
  • observed — Modified behavior in tools/releaser/src/lib/resolveBump.ts: Adds resolveBump: requests equal to AUTO_BUMP select the recommendation without an override; other requests require a nonblank trimmed reason or throw an error, then return the requested bump marked as an override.
  • observed — Modified behavior in tools/releaser/src/release-bump.spec.ts: The test dependency fixture adds a mocked getCommitBump returning 'minor'.
  • observed — Modified behavior in tools/releaser/src/release-bump.spec.ts: The main release-flow test now requests automatic bump selection instead of explicitly requesting a prerelease bump.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the main changes: automatic release bump selection from commits and a required reason for manual overrides.
Description check Passed The description directly explains the automatic bump behavior, prerelease handling, override validation, notice logging, and related follow-up work.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.

Comment @coderabbitai help to get the list of available commands.

@GermanJablo
GermanJablo added this pull request to stack #18802 October 16, 2026 21:38
@GermanJablo
GermanJablo force-pushed the ci/post-release-templates-dist-tag branch from fd58a14 to c25aaed Compare October 16, 2026 21:54
@GermanJablo
GermanJablo force-pushed the ci/release-bump-from-commits branch from 797af32 to e94cacf Compare October 16, 2026 21:54
@GermanJablo
GermanJablo removed this pull request from stack #18802 October 19, 2026 16:06
@GermanJablo
GermanJablo changed the base branch from ci/post-release-templates-dist-tag to main October 19, 2026 16:07
@GermanJablo
GermanJablo force-pushed the ci/release-bump-from-commits branch from e94cacf to 5fb3d96 Compare October 19, 2026 16:07
@GermanJablo
GermanJablo marked this pull request as ready for review October 19, 2026 16:14
@GermanJablo
GermanJablo force-pushed the ci/release-bump-from-commits branch from 5fb3d96 to f3c51aa Compare October 19, 2026 16:26
Comment thread tools/releaser/src/lib/resolveBump.ts Resolved
@GermanJablo
GermanJablo force-pushed the ci/release-bump-from-commits branch from f3c51aa to fddb044 Compare October 20, 2026 13:49
@GermanJablo
GermanJablo enabled auto-merge (squash) October 20, 2026 14:19
@GermanJablo
GermanJablo merged commit 103939e into main Oct 20, 2026
24 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚀 This is included in version v4.0.0-beta.4

denolfe pushed a commit that referenced this pull request Oct 22, 2026
…ide (3.x) (#18919)

Port of [#18729](#18729) to
`3.x`.

On `main` the beta always resolves to `prerelease`, so the check mostly
matters here, where `patch` vs `minor` is picked by hand. `bump` now
defaults to `auto` (computed from the commits since the last tag).
`patch` or `minor` fail before touching git unless `override_reason` is
filled in, and the reason is recorded as a notice on the run.

`getRecommendedBump` on `3.x` already maps `major` to `minor`, so `auto`
never leaves the v3 line.

Related: PYLD-4162

Co-authored-by: German Jablonski <[email protected]>
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.

2 participants