Repository navigation
Label a one-package release with its version, not its last character - #54
Merged
Merged
Conversation
When the release plan holds one package, $plan.Version is a single string, Sort-Object hands it back as a string, and [-1] took its last character, so a plan releasing 4.5.3 alone gave the run the label 3, which the publish's version check refuses. The sort is now collected into an array first.
This was referenced Nov 13, 2026
jwrosewell
marked this pull request as ready for review
November 13, 2026 19:10
jwrosewell
added a commit
that referenced
this pull request
Nov 14, 2026
The scripts in `ci/` decide what a pull request builds and what a publish releases, and each has Pester tests beside it. `rc` holds five such files, being `ci/packages.Tests.ps1`, `ci/dispatch.Tests.ps1`, `ci/check-environment-variable-names.Tests.ps1`, `ci/get-next-package-version.Tests.ps1` from [#54](#54) and `ci/select-options.Tests.ps1` from [#33](#33). Only the environment variable name tests ran in a workflow. The rest ran only by hand or on a temporary branch, as [#47](#47), [#54](#54) and [#60](#60) each say under what remains, so a change to the release plan or the dispatcher could break them unseen.
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.
Problem
ci/get-next-package-version.ps1line 16 onrclabels a publish with the highest version in the release plan.When the plan holds one package,
$plan.Versionand the sort give back that one version as a string, not as an array of one, and[-1]then takes the string's last character. A plan that releases one package at 4.5.3 gives the run the label3, which the publish's version check refuses. So the first release in which only one package changes would fail to publish. With the release plan now leaving out documentation, tests and examples (#60), a release of one package is more likely.Change
The sort is collected with the array subexpression operator
@()before the last item is taken, asci/packages.ps1line 311 already does. The PowerShell operators reference says of@( ), "Returns the result of one or more statements as an array. The result is always an array of 0 or more objects."The other indexing in the CI scripts reads
[version]objects rather than strings, and PowerShell gives a single object back for[-1], so only this line changes.ci/get-next-package-version.Tests.ps1is new. It runs the script beside a stand-inpackages.ps1whose release plan is the versions each test gives, and checks the label for one package, for several, and for none.Checks
No workflow in this repository runs the Pester tests in
ci/, so each run below is a temporary branch holding a workflow that runs everyci/*.Tests.ps1with Pester onubuntu-latestandwindows-latest, and then prints the release plan of the branch.rcat df0949d7 with the new test and without the fix, run 43474381584, failed on both.Tests Passed: 132, Failed: 1, the failure beinglabels a plan of one package with its whole version.Tests Passed: 133, Failed: 0.This draft changes only CI scripts and their tests, with no package code. James Rosewell decided at about 11:35 UTC on 12 November, for such a change, "rebuild and include, but the change doesn't impact the code so no need to run the full builds." So it has no full build of its own, and its pull request checks are its quick checks. All three passed on this head, being run 43474367014 (environment variable names), run 43474367564 (only rc into main) and run 43474367167 (link campaign tags).
Head bcbb12fe is the earlier fix with
rcat df0949d merged in. The last release intomainwas #114, merged at 06:22 UTC on 13 November.What remains
Nothing in this draft. No workflow runs the tests in
ci/, as #47 and #60 also note.