🪲 [Fix]: Version previews reflect the version-bump label regardless of release type#9
Merged
Marius Storhaug (MariusStorhaug) merged 2 commits intoJul 10, 2026
Conversation
The major/minor/patch label evaluation was gated behind ShouldPublish, so on a pull_request event (ReleaseType None) the resolver ignored the labels and always previewed a patch prerelease. Now the bump labels are always evaluated, so the resolved version reflects what WOULD be created; ReleaseType (and the prerelease label that drives it) only controls whether and how we publish. Adds ReleaseDecision + EndToEnd tests for None + minor/major previews. All existing cases are unchanged (152/152 pass).
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 20:56
View session
There was a problem hiding this comment.
Pull request overview
This PR updates the release decision logic so major/minor/patch bump labels are always evaluated when resolving the next version, even when ReleaseType=None (e.g., pull_request previews). This ensures previews reflect the same increment that would be used on a publish run; ReleaseType only governs publishing behavior.
Changes:
- Removed the
$shouldPublishgate around version-bump label evaluation inResolve-ReleaseDecision. - Added test data cases covering
ReleaseType=None+ version-bump labels (with prerelease preview behavior).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/Resolve-PSModuleVersion.Helpers.psm1 | Always compute major/minor/patch bump decisions from labels; keep publishing gated by ReleaseType/ShouldPublish. |
| tests/Resolve-PSModuleVersion.Helpers.Tests.Data.psd1 | Adds new ReleaseType=None preview scenarios to test data (ReleaseDecision + NextModuleVersion/EndToEnd datasets). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closed
6 tasks
Copilot review noted the description claims a None+major EndToEnd/NextModuleVersion case but only None+minor was present. Adds the missing major preview case (1.0.1 -> v2.0.0-featnonemajor001, ShouldPublish=false) so the new label-always-evaluated behavior is covered end-to-end for major bumps too.
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 21:22
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, onpull_requestevents (ReleaseType = None) the resolver ignored the labels and always previewed a patch prerelease, which made pull request previews misleading.ReleaseType— and theprereleaselabel that drives it — now only controls whether and how a version is published, never the size of the version increment.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.
minorlabel, noprereleaselabelx.y.z+1patch previewx.(y+1).0minor preview (still not published)majorlabel, noprereleaselabelx.y.z+1patch preview(x+1).0.0major preview (still not published)prereleaselabelprereleasestill gates publishingmainwithminorlabelTechnical 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.MariusStorhaug/MariusTestModulePR #34 (labelledMinor, noprereleaselabel) now previewsv0.5.0-teste2eimporttestdata001withShouldPublish = False(previouslyv0.4.2-…).PSModule/Process-PSModule#378.