Commit 8d1dac7
authored
🪲 [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`): the `major`/`minor`/`patch` label
evaluation was moved out from behind the `if ($shouldPublish)` guard so
it always runs. When no bump label is present and `AutoPatching` is
disabled, the run still previews a patch version but sets `ShouldPublish
= $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`: added
`ReleaseDecision` and `EndToEnd` cases for `None + minor` and `None +
major` previews. All existing `ReleaseDecision`, `EndToEnd`, and
`NextModuleVersion` cases are unchanged.
- Validation: 157/157 Pester tests pass; PSScriptAnalyzer clean.
- E2E: `MariusStorhaug/MariusTestModule` PR #34 (labelled `Minor`, no
`prerelease` label) now previews `v0.5.0-teste2eimporttestdata001` with
`ShouldPublish = False` (previously `v0.4.2-…`).
- Relates to `PSModule/Process-PSModule#378`.1 parent bc63f07 commit 8d1dac7
2 files changed
Lines changed: 85 additions & 22 deletions
File tree
- scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
232 | 242 | | |
233 | 243 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
249 | 248 | | |
250 | 249 | | |
251 | 250 | | |
| |||
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
105 | 139 | | |
106 | 140 | | |
107 | 141 | | |
| |||
412 | 446 | | |
413 | 447 | | |
414 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
415 | 479 | | |
416 | 480 | | |
417 | 481 | | |
| |||
0 commit comments