🪲 [Fix]: Version previews reflect the version-bump label regardless of release type (#9)
Version-bump labels (major, minor, patch) are now always evaluated when resolving a module version, so the version a run reports always matches what those labels would produce. Previously, on pull_request events (ReleaseType = None) the resolver ignored the labels and always previewed a patch prerelease, which made pull request previews misleading. ReleaseType — and the prerelease label that drives it — now only controls whether and how a version is published, never the size of the version increment.
- Part of PSModule/Process-PSModule#378
Fixed: Pull request previews now reflect the version-bump label
The resolved version on a non-publishing run now reflects the bump label instead of always showing a patch. Publishing behavior is unchanged — only the previewed version changes for label combinations that were previously never evaluated.
| Situation | Before | After |
|---|---|---|
Open PR, minor label, no prerelease label |
x.y.z+1 patch preview |
x.(y+1).0 minor preview (still not published) |
Open PR, major label, no prerelease label |
x.y.z+1 patch preview |
(x+1).0.0 major preview (still not published) |
PR with prerelease label |
publishes a prerelease | unchanged — prerelease still gates publishing |
Merge to main with minor label |
minor release | unchanged |
Technical Details
scripts/Resolve-PSModuleVersion.Helpers.psm1(Resolve-ReleaseDecision): themajor/minor/patchlabel evaluation was moved out from behind theif ($shouldPublish)guard so it always runs. When no bump label is present andAutoPatchingis disabled, the run still previews a patch version but setsShouldPublish = $false. Any run that is not a published full release continues to be surfaced as a prerelease (CreatePrerelease = $true).tests/Resolve-PSModuleVersion.Helpers.Tests.Data.psd1: addedReleaseDecisionandEndToEndcases forNone + minorandNone + majorpreviews. All existingReleaseDecision,EndToEnd, andNextModuleVersioncases are unchanged.- Validation: 157/157 Pester tests pass; PSScriptAnalyzer clean.
- E2E:
MariusStorhaug/MariusTestModulePR #34 (labelledMinor, noprereleaselabel) now previewsv0.5.0-teste2eimporttestdata001withShouldPublish = False(previouslyv0.4.2-…). - Relates to
PSModule/Process-PSModule#378.