Skip to content

fix(#155): finalize existing prerelease versions during bump planning#156

Merged
stiwicourage merged 2 commits into
developfrom
bug/155-bug-prerelease-bump-should-finalize-the-current-version-instead-of-incrementing-it
May 3, 2026
Merged

fix(#155): finalize existing prerelease versions during bump planning#156
stiwicourage merged 2 commits into
developfrom
bug/155-bug-prerelease-bump-should-finalize-the-current-version-instead-of-incrementing-it

Conversation

@stiwicourage
Copy link
Copy Markdown
Owner

Summary

Fix nova bump --what-if so stable bumps finalize an existing prerelease instead of advancing to the next semantic version.

Before this change, a project on a prerelease like 2.0.0-preview01 could incorrectly plan:

2.0.0-preview01 -> 2.1.0

when the inferred label was Minor.

After this change, stable bump planning now correctly finalizes the current semantic core:

2.0.0-preview01 -> 2.0.0

unless the user explicitly requests prerelease continuation with --preview.

Problem

The stable bump path treated prerelease versions as if they should continue through normal semantic increment logic based on the inferred label.

That caused incorrect plans such as:

  • 2.0.0-preview01 -> 2.1.0

instead of finalizing the current prerelease line:

  • 2.0.0-preview01 -> 2.0.0

The intended rule is general: if the current version already contains a prerelease suffix such as preview, beta, or rc, the default stable next step should be to remove that suffix and finalize the same semantic version.

What changed

Release logic

  • Updated stable version-part planning so any existing prerelease is finalized on the current semantic core.
  • Removed the old logic that only finalized prereleases when the inferred label matched a derived target label.

Tests

  • Updated release-internal coverage to verify prerelease finalization regardless of inferred label.
  • Updated bump workflow expectations for prerelease-to-stable transitions.
  • Added an installed CLI regression test covering nova bump --what-if from 2.0.0-preview01 to 2.0.0.

Documentation

  • Clarified the default prerelease-finalization rule in:
    • README.md
    • docs/NovaModuleTools/en-US/Update-NovaModuleVersion.md
  • Added an unreleased changelog entry for the fix.

Example

Before

Version plan: 2.0.0-preview01 -> 2.1.0 | Label: Minor | Commits: 26

After

Version plan: 2.0.0-preview01 -> 2.0.0 | Label: Minor | Commits: 26

Validation

Ran targeted regression coverage for release planning and CLI behavior:

  • tests/CoverageGaps.ReleaseInternals.Tests.ps1
  • tests/NovaCommandModel.BumpAndCli.Tests.ps1
  • tests/NovaCommandModel.StandaloneCli.Tests.ps1

Result:

  • 175 tests passed
  • 0 failed

Also verified:

  • direct reproduction against the built module now returns 2.0.0
  • local pre-commit Code Health safeguard passes

User impact

This makes nova bump align with the documented prerelease-finalization behavior and avoids skipping over the intended stable release when a project is already on a prerelease version.

- Update `Update-NovaModuleVersion` to finalize current prerelease versions before incrementing.
- Adjust tests to reflect changes in version resolution logic.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

codescene-delta-analysis[bot]

This comment was marked as outdated.

- clarify steps for reading prompt and template files
- enforce structure for PR description output
- ensure creation of output folder if missing
@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@stiwicourage stiwicourage merged commit f987c7e into develop May 3, 2026
12 checks passed
stiwicourage added a commit that referenced this pull request May 3, 2026
@stiwicourage stiwicourage deleted the bug/155-bug-prerelease-bump-should-finalize-the-current-version-instead-of-incrementing-it branch May 12, 2026 05: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.

[Bug]: prerelease bump should finalize the current version instead of incrementing it

1 participant