Skip to content

feat: Migrate updatable help to the PlatyPS 1.x cabinet pipeline - #176

Merged
tablackburn merged 2 commits into
mainfrom
feature/152-platyps-1x-updatable-help
Aug 26, 2026
Merged

feat: Migrate updatable help to the PlatyPS 1.x cabinet pipeline#176
tablackburn merged 2 commits into
mainfrom
feature/152-platyps-1x-updatable-help

Conversation

@tablackburn

Copy link
Copy Markdown
Contributor

Closes #152. Closes #101. Closes #169. Part of #105 (PlatyPS migration), Phase 2 of #120.

The last link in the PlatyPS chain. #157 (1.0.0-preview1) is unblocked once this lands.

Build-PSBuildUpdatableHelp now works, which it never did

The port itself was small. New-HelpCabinetFile maps cleanly onto the old call:

0.14.x New-ExternalHelpCab 1.x New-HelpCabinetFile
CabFilesFolder CabinetFilesFolder
LandingPagePath MarkdownModuleFile
OutputFolder OutputFolder

The three defects in #169 were the actual work, and any one of them alone was fatal:

  1. the module landing page the cabinet needs was never generated,
  2. $moduleOutDir was undefined anywhere in the module or the psake file, and
  3. the task passed no -Module, so it defaulted from an unset caller-scope variable.

So there was no working behavior to port — which is why this ticket ran well past "swap one
cmdlet".

It refuses rather than half-producing

New-HelpCabinetFile requires a HelpInfoUri. Measured with and without one:

NoUri:   CAB THREW: Cannot bind argument to parameter 'URI' because it is an empty string.
         -> NoUri_..._en-US_HelpContent.cab      <- cabinet still written
         -> NoUri_..._en-US_HelpContent.zip      <- but NO HelpInfo.xml
WithUri: CAB: succeeded
         -> WithUri_..._en-US_HelpContent.cab
         -> WithUri_..._en-US_HelpContent.zip
         -> WithUri_..._HelpInfo.xml

Without the URI you get cabinet files and no HelpInfo.xml — which is the file Update-Help
resolves them through. That is output that looks complete and cannot be used, so the function
checks the manifest first and produces nothing. Neither of this repository's fixtures had a
HelpInfoUri; both gained a placeholder, and there is a migration-guide entry telling consumers
to add a real one.

The landing page

Build-PSBuildMarkdown now passes -WithModulePage. #173 deliberately did not: 0.14.x produced
no landing page, and generating one puts a new file in every consumer's docs tree. The cabinet
needs it — it carries the module GUID, locale, and help version — so the change belongs here, with
its own migration entry.

It stays excluded from MAML generation. A module page in an export batch aborts the entire export
and writes nothing (PowerShell/platyPS#862,
filed from this work), and the existing Measure-PlatyPSMarkdown filter already handles it.

The task-level regression, which is the part that matters

Defect 3 lived in the wiring, not the function. Every function-level fix could pass while
GenerateUpdatableHelp stayed broken, because the task supplied neither the module name nor the
module output path — and the unit tests pass -Module explicitly, so by construction they cannot
catch it. That was Copilot's argument on #170 and it was correct.

tests/build.tests.ps1 now runs the task, through the same child-process pattern the other
build contexts use, since psake cannot nest:

Task: GENERATEMARKDOWN
Task: GENERATEMAML
Task: BUILDHELP
Task: GENERATEUPDATABLEHELP
psake succeeded executing ./psakeFile.ps1
 Context Updatable help task
   [+] Produces a help cabinet
   [+] Produces the help info manifest

Verification

  • Full suite 470 passed, 0 failed (was 460)
  • All previously skipped cabinet assertions are unskipped and passing — nothing in
    Build-PSBuildHelp.tests.ps1 is skipped now
  • Cabinet naming pinned to <Module>_<GUID>_<locale>_HelpContent.cab
  • A guard test asserts that a missing HelpInfoUri writes nothing, not a partial cabinet
  • Windows-only paths gated on $IsWindows -or $null -eq $IsWindows, so Windows PowerShell 5.1
    takes the Windows branch

Also in here

The header of Build-PSBuildHelp.tests.ps1 claimed nothing observed these functions. That was
wrong and I put it on #120 too. build.tests.ps1 has been exercising GenerateMarkdown and
GenerateMAML end to end all along via tests/TestModule. Header corrected; the #120 row still
needs the same fix.

Closes #152. Closes #101. Closes #169. Part of #105, Phase 2 of #120.

Build-PSBuildUpdatableHelp produces a cabinet, its zip, and a HelpInfo.xml.
It never could before. #169 recorded three defects, and every one of them
alone was fatal: the module landing page New-ExternalHelpCab needs was
never generated, $moduleOutDir was undefined anywhere in the codebase, and
the task passed no -Module so the parameter defaulted from an unset
caller-scope variable.

New-HelpCabinetFile maps cleanly onto the old call --
CabinetFilesFolder / MarkdownModuleFile / OutputFolder against
CabFilesFolder / LandingPagePath / OutputFolder -- so the port itself was
small. The defects were the work.

Build-PSBuildMarkdown now passes -WithModulePage. #173 deliberately did
not, because 0.14.x produced no landing page and adding one puts a new
file in every consumer's docs tree; the cabinet needs it, so it lands here
with its migration-guide entry. It stays filtered out of the MAML export,
where a module page aborts the whole batch (PowerShell/platyPS#862).

The function refuses when the manifest declares no HelpInfoUri. Measured:
without one, New-HelpCabinetFile writes the cabinet and the zip and then
fails before the HelpInfo.xml that Update-Help resolves them through,
leaving output that looks complete and cannot be used. Both test fixtures
gained a placeholder URI for the same reason.

Defect 3 lived in the task rather than the function, so a function-level
test could never catch it: build.tests.ps1 now runs the GenerateUpdatableHelp
task itself through the child-process pattern the other build contexts use,
and asserts both artifacts. That was Copilot's point on #170 and it was
right.

Also corrects the header of Build-PSBuildHelp.tests.ps1, which claimed
nothing observed these functions. build.tests.ps1 has covered
GenerateMarkdown and GenerateMAML end to end all along.

Suite: 470 passed, 0 failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AKaM9i6NyMFDcJNeC34h5
Copilot AI lite review requested due to automatic review settings August 25, 2026 22:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Test Results

    4 files  ± 0    740 suites  +16   4m 56s ⏱️ +55s
  472 tests +10    470 ✅ +11   2 💤  -  1  0 ❌ ±0 
1 892 runs  +40  1 831 ✅ +30  61 💤 +10  0 ❌ ±0 

Results for commit 2e6e872. ± Comparison against base commit 48366eb.

This pull request removes 2 and adds 12 tests. Note that renamed tests count towards both.
Help building functions.Build-PSBuildUpdatableHelp.returns without throwing
Help building functions.Build-PSBuildUpdatableHelp.writes nothing
Build.Updatable help task.Produces a help cabinet
Build.Updatable help task.Produces the help info manifest
Help building functions.Build-PSBuildMarkdown.replaces the landing page on rebuild rather than leaving it stale
Help building functions.Build-PSBuildUpdatableHelp refuses to half-produce.declines when the manifest declares no HelpInfoUri
Help building functions.Build-PSBuildUpdatableHelp.completes without error
Help building functions.Build-PSBuildUpdatableHelp.names the cabinet for the module, its GUID, and the locale
Help building functions.Build-PSBuildUpdatableHelp.produces a cabinet file
Help building functions.Build-PSBuildUpdatableHelp.produces the help info manifest
Test help for Build-PSBuildUpdatableHelp.Parameter ModulePath.Has correct [mandatory] value
Test help for Build-PSBuildUpdatableHelp.Parameter ModulePath.Has correct parameter type
…

♻️ This comment has been updated with latest results.

The landing page was never refreshed after the first build. The refresh
pass filters to CommandHelp documents, which excludes it, and the move
loop then skipped it because a copy already existed -- under a comment
claiming it had "already refreshed above", which was true of command help
and false of the module page. It is now always replaced.

The review's stated consequence does not hold, and it is worth recording
why. It argued that a stale page freezes HelpContentVersion so Update-Help
stops fetching after a version bump. Measured: "Help Version" is a constant
1.0.0.0 that New-MarkdownCommandHelp does not derive from ModuleVersion --
the fixture is 0.1.0 and its page still reads 1.0.0.0 -- so a version bump
never moved it either way. Update-MarkdownModuleFile is no help: it leaves
the version alone and rewrites the body, losing prose.

What does go stale is the module GUID, which stamps the cabinet file name,
and the command index, which is the page's whole body. Both justify always
replacing it, and the test asserts the GUID case because that one silently
misnames the cabinet.

Also from the review, all correct:

- OutputPath was cleared before anything was known to be writable, so a run
  where every locale hit a guard deleted the previous cabinet and replaced
  it with nothing. The work is now resolved first and the wipe skipped when
  there is none, matching the refuse-before-producing posture of the guards
  above it.
- The changelog's #105 entry still said updatable help "warns and returns
  until the cabinet pipeline migrates in #152" -- in the release that is
  #152. Rewritten, with updatable help left to the Fixed entry.
- Unreleased carried two "### Fixed" headings. Merged.
- Three new $*Params variables contradicted shorthand.instructions.md and
  the test file added alongside them. Renamed to Parameters.

Suite: 471 passed, 0 failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AKaM9i6NyMFDcJNeC34h5
@tablackburn
tablackburn merged commit 9177803 into main Aug 26, 2026
9 checks passed
@tablackburn
tablackburn deleted the feature/152-platyps-1x-updatable-help branch August 26, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants