fix(release): keep ReleaseNotes within the Gallery's limit - #57
Merged
Merged
Conversation
The PowerShell Gallery refused the 1.5.0 upload: the manifest's ReleaseNotes was 12699 characters and the Gallery accepts at most 10600. Every release since 1.0.0 had prepended a paragraph and none had removed one. Nothing was published under 1.5.0. ReleaseNotes now carries the current release only, with a link to CHANGELOG.md, which already holds every release in more detail. Publish-Module.ps1 now refuses a manifest whose ReleaseNotes exceeds 10600 characters or whose Description exceeds 4000, before it stages anything, and a contract test holds the manifest to both limits so a pull request fails rather than the tag-driven release.
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.
Summary
The PowerShell Gallery refused the 1.5.0 package on upload:
The manifest's
ReleaseNoteswas 12,699 characters. Each release from 1.0.0 to 1.5.0 had prepended its paragraph and none had removed one, so the field grew by a release every time. The limit is enforced only on upload, so every earlier gate passed: the unit suite,Publish-Module.ps1 -WhatIf, and the release workflow up to the publish step. The Gallery still lists 1.4.0 as the latest version; nothing was published as 1.5.0.Changes
TestEnvironment.psd1:ReleaseNotescarries the 1.5.0 paragraph only, followed by a link toCHANGELOG.md, which already describes every release in more detail. It is now 2,200 characters. A comment above the field records why it holds one release.Build/Publish-Module.ps1: a manifest whoseReleaseNotesexceeds 10,600 characters, or whoseDescriptionexceeds 4,000 (NuGet's package description limit), is refused with a message naming the field and its length. The check runs in the manifest section, before staging, so it also stops a-WhatIfrehearsal.Tests/Unit/Module.Contract.Tests.ps1: a new test holds the manifest to both limits, so a pull request fails rather than the tag-driven release.CHANGELOG.md: the 1.5.0 entry records the fix.The version stays 1.5.0, because that number has not been consumed on the Gallery.
Verification
Test-ModuleManifestreads version 1.5.0 with 2,200 characters of release notes. The manifest keeps its UTF-8 byte order mark../Build/Publish-Module.ps1 -WhatIf: stages and verifiesTestEnvironment 1.5.0 -> PSGallery.Releasing after merge
Tag
v1.5.0currently points at the merge commit of #56, which carries the oversized manifest. Re-running the release from that tag would fail the same way. Once this is merged, the tag needs to point at the new merge commit:The alternative is to leave
v1.5.0where it is and release as 1.5.1, which means bumpingModuleVersionand the changelog heading first.