Skip to content

Release a prerelease of X.Y.0 as X.Y.0 on a Minor or Major bump - #228

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/ktsubuild-168-first-release-version
Oct 8, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/ktsubuild-168-first-release-version

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #168

What changed

VersionCalculator.CalculateNewVersion now follows semver inc / npm semantics for Minor and Major bumps from a prerelease, as decided on the issue:

  • Minor on X.Y.0-pre.N gives X.Y.0. Every other version increments Minor as before.
  • Major on X.0.0-pre.N gives X.0.0. Every other version increments Major as before.

A repository with no tags starts from v{initialVersion}-pre.0, so its first release is now initialVersion (1.0.0 by default) when the first bump is Minor or Major. Before this change it was 1.1.0 or 2.0.0.

Tests

  • GetVersionInfoAsync_NoTags_FirstReleaseIsInitialVersion: no tags with Minor → 1.0.0, no tags with Major → 1.0.0, and initialVersion: "0.1.0" with Minor → 0.1.0.
  • GetVersionInfoAsync_BumpFromPrerelease: 1.3.0-pre.2 with Minor → 1.3.0 (the case the maintainer decision asked for) and 2.0.0-pre.1 with Major → 2.0.0. Two cases that should not change: 1.2.4-pre.3 with Minor → 1.3.0, and 1.3.0-pre.2 with Major → 2.0.0.

With the fix reverted, the 5 new cases that cover the changed behaviour fail and the 2 unchanged cases pass. With the fix in place the full suite passes (771/771). The Sonar analyzers report nothing new for VersionCalculator.cs in a local build with sonar-local.props.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826


Generated by Claude Code

A repository with no tags starts from v{initialVersion}-pre.0, and a Minor
or Major bump always incremented, so a new library's first release was
1.1.0 or 2.0.0 instead of 1.0.0. Minor on X.Y.0-pre.N now gives X.Y.0 and
Major on X.0.0-pre.N gives X.0.0, as semver inc does. Other versions
increment as before.

Fixes #168

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit e7f7128 into main Oct 8, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the claude/ktsubuild-168-first-release-version branch October 8, 2026 04:48
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.

A repository's first release is versioned 1.1.0 or 2.0.0 instead of initialVersion (1.0.0) when its first bump is Minor or Major

2 participants