Skip to content

fix(version): Keep auto and pre below 1.0.0 on breaking changes - #962

Merged
BYK merged 1 commit into
masterfrom
fix/auto-version-0x
Nov 5, 2026
Merged

BYK merged 1 commit into
masterfrom
fix/auto-version-0x

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Right now craft prepare auto releases 1.0.0 from a 0.x version as soon as one breaking-change commit (type!:) lands. Before 1.0.0, a breaking change should bump the minor version. Shipping 1.0.0 should be an explicit choice. Requested by BYK in getsentry/junior#2745.

With this change, when the current version is below 1.0.0, auto and pre turn a major bump picked from the commits into minor and log why. major and exact versions passed on purpose still release 1.0.0.

After 0.5.0 plus a feat!: commit Before After
craft prepare auto 1.0.0 0.6.0
craft prepare pre 1.0.0-alpha.0 0.6.0-alpha.0
craft prepare major 1.0.0 1.0.0

currentVersion is now computed before the bump type so the check can read it. The value is the same as before. The versioning docs describe the new rule.

There's no minVersion gate. Today a 0.x repo on auto either never has breaking commits or gets an accidental 1.0.0.

Known gap: craft changelog --format json and the PR changelog preview still report the raw major bump type. I left them unchanged to keep this fix small.

Verification

  • New e2e cases in prepare-dry-run.e2e.test.ts cover auto, pre and major after 0.5.0 plus feat!:. I couldn't run that file in my sandbox, because its git wrapper rejects the test repos' commit identity. CI runs them.
  • I ran the same scenario by hand with the built dist/craft:
    • auto: 0.5.0 -> 0.6.0
    • pre: 0.5.0 -> 0.6.0-alpha.0
    • major: 0.5.0 -> 1.0.0
    • Released 3.9.0 on auto: 0.5.0 -> 1.0.0
  • prepare.test.ts and autoVersion.test.ts pass (29 tests). tsc, eslint and prettier pass.

via @BYK.

--

View Session in Sentry

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-11-05 18:28 UTC

@BYK
BYK merged commit 82dd94c into master Nov 5, 2026
29 checks passed
@BYK
BYK deleted the fix/auto-version-0x branch November 5, 2026 18:28
BYK added a commit to getsentry/junior that referenced this pull request Nov 5, 2026
> [!WARNING]
> **Merge this only after a Craft 3.x release that includes
getsentry/craft#962 is out.** Until then, Craft's default categories
make `bump=auto` (the default) release **1.0.0** on the next `type!:`
commit.

This deletes `.github/release.yml`, so Craft uses its default changelog
categories. BYK asked for this on #2745: use the defaults and fix Craft
instead of keeping a local override.

The file was a copy of Craft's defaults with one difference: breaking
changes were `semver: minor`, so `auto` couldn't release 1.0.0 while
Junior is 0.x. getsentry/craft#962 builds that rule into Craft. Below
1.0.0, `auto` and `pre` treat a breaking change as a minor bump, and
only an explicit `major` or exact version releases 1.0.0. The release
workflow uses the floating `getsentry/craft@v3` tag, so the fix reaches
Junior as soon as Craft releases it.

Nothing else referenced the file. `releasing.md` already says breaking
changes bump the minor version, and that stays true once the fix is
released.

**Verification**
- `pnpm release:check` and prettier pass.
- On a test repo at 0.5.0 with a `feat!:` commit:
- Craft with #962: `auto` → 0.6.0, `pre` → 0.6.0-alpha.0, `major` →
1.0.0.
  - Released Craft 3.9.0: `auto` → 1.0.0. That's why this PR must wait.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ac8d3ce009cefcaeb24db801614e507ab -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3Ac8d3ce009cefcaeb24db801614e507ab/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant