Skip to content

build(release): the rehearsal measures Description and the package's tags against the Gallery's limits - #14

Merged
fadwen merged 1 commit into
feat/get-credential-precisionfrom
build/gallery-metadata-limits
Oct 6, 2026
Merged

fadwen merged 1 commit into
feat/get-credential-precisionfrom
build/gallery-metadata-limits

Conversation

@fadwen

@fadwen fadwen commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

The Gallery refused 0.27.0's first upload because ReleaseNotes had passed 10,600 characters, and since #8 the release rehearsal measures that field. Two more fields carry a limit the Gallery enforces, NuGet's 4,000 characters: the manifest's Description, and the package's tags. The tags are not the manifest's alone. The publish adds PSModule, a PSEdition_ tag per compatible edition, PSFunction_ and PSCommand_ for every exported function, and PSIncludes_Function. That is the list the Gallery shows for 0.27.0: 61 tags, 1,935 characters for 27 commands, so each new command costs about twice its name, and a module that keeps adding commands reaches the limit without touching its Tags key (PowerShellGetv2 #344 is a module that did: "A nuget package's Tags property may not be more than 4000 characters long").

Stacked on #13 (base branch), which is stacked on #12, #11 and #10; the diff is this change only. Merge #10, #11, #12, #13, then this; GitHub retargets each to main as its parent merges and the checks run then.

Changes

  • Build/Publish-Module.ps1. Get-PublishedTag builds the tag list the way the publish does, from the manifest's Tags, CompatiblePSEditions and ExportedFunctions. The rehearsal refuses a manifest whose Description, tags or ReleaseNotes pass its limit and reports the three lengths: Gallery metadata: Description 179/4000, Tags 1935/4000, ReleaseNotes 2673/10600 characters.
  • Tests/Unit/Module.Contract.Tests.ps1. The same three limits, so a pull request fails before the tag-driven release does.

Verification

  • The tag list Get-PublishedTag builds for the current manifest is the Gallery's list for 0.27.0, compared with Find-PSResource as a set: the same 61 tags, 1,935 characters.
  • Build/Publish-Module.ps1 -WhatIf passes and prints the three lengths. The contract test passes on PowerShell 7.6.6 and Windows PowerShell 5.1 (15 of 15). PSScriptAnalyzer (Error and Warning) is clean on the two changed files; no line over 115 characters.

Notes

  • The 4,000 limits are NuGet's, applied by the Gallery; the only one of the three the Gallery has stated to this module is the 10,600 for ReleaseNotes. A module with cmdlets or DSC resources would see further automatic tags (PSCmdlet_, PSDscResource_); this module exports functions only, and the helper builds what it exports.

@fadwen fadwen left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes on the lines whose reason the diff does not show.

Comment thread Build/Publish-Module.ps1
}

# NuGet's limit on a package description, which the Gallery applies.
$descriptionLimit = 4000

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one limit of the three the Gallery has not stated to this module. 4,000 is the length of the NuGet gallery's description column, and the figure the Gallery quoted for tags in PowerShell/PowerShellGetv2#344.

$text = switch ($Field) {
'ReleaseNotes' { "$($manifest.ReleaseNotes)" }
'Description' { "$($manifest.Description)" }
'Tags' {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeated rather than dot-sourced from Build/Publish-Module.ps1: that script requires PowerShell 7.4 and PSResourceGet and runs its gates on load, and this test runs under Windows PowerShell 5.1 too.

@fadwen
fadwen added this pull request to stack #15 October 6, 2026 06:46
…tags against the Gallery's limits

The Gallery refused 0.27.0's first upload over the length of ReleaseNotes,
and the rehearsal has measured that field since. Two more fields carry a
limit it enforces, NuGet's 4,000 characters: the Description, and the
package's tags, which are not the manifest's alone. The publish adds
PSModule, a PSEdition_ tag per compatible edition, PSFunction_ and
PSCommand_ for every exported function, and PSIncludes_Function; that is
the list the Gallery shows for 0.27.0, 61 tags and 1,935 characters for
27 commands, so each new command costs about twice its name.

Build/Publish-Module.ps1 builds that list from the manifest, measures
all three fields, refuses a manifest over a limit and reports the three
lengths. The module contract test holds the same three limits, so a pull
request fails before the tag-driven release does.
@fadwen
fadwen force-pushed the build/gallery-metadata-limits branch from 0fa27ab to 2bb7005 Compare October 6, 2026 06:52
@fadwen
fadwen merged commit f20cfe5 into main Oct 6, 2026
4 checks passed
@fadwen
fadwen deleted the build/gallery-metadata-limits branch October 6, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant