Context
Per the naming standard in MSXOrg/docs (linked below), an action's private helper module must be named after the action (<ActionRepo>.Helpers) instead of the generic Helpers. A module named Helpers collides with the shared framework Helpers module (installed by PSModule/Install-PSModuleHelpers, and loaded into the test session by PSModule/Invoke-Pester). Two modules named Helpers in one session break module resolution and make Pester Mock -ModuleName Helpers ambiguous.
Concrete failure and fix template: PSModule/Resolve-PSModuleVersion#4 — renamed the helper module, updated the entry-script import and the test -ModuleName, and kept the framework Import-Module -Name 'Helpers' line. RuntimeException: Multiple script or manifest modules named 'Helpers' are currently loaded.
Scope — rename in every action repo that ships a generic helper module
Confirmed via org-wide code search (filename:Helpers.psm1 org:PSModule):
Special case (do NOT blindly rename):
Per-repo change checklist
For each affected action:
git mv the module file to <ActionRepo>.Helpers.psm1 (and the matching test file, if any).
- Update the entry-script import path to
Import-Module -Name "$PSScriptRoot/<ActionRepo>.Helpers.psm1", keeping the framework Import-Module -Name 'Helpers' line.
- Update tests:
-ModuleName '<ActionRepo>.Helpers' plus the module import path and any data-file path.
- Verify CI green (Action-Test / Pester). The collision only reproduces where the framework
Helpers is loaded, so validate locally by pre-loading a dummy module named Helpers before Invoke-Pester.
- Release the action.
Audit for completeness
Code search only indexes default branches and files literally named Helpers.psm1. Before closing, audit all action repos (any repo with a root action.yml) for any helper/script module whose name is not <ActionRepo>.Helpers:
# per action repo (check scripts/ and src/)
gh api repos/PSModule/<repo>/contents/scripts --jq '.[].name'
gh api repos/PSModule/<repo>/contents/src --jq '.[].name'
Acceptance criteria
Related
Context
Per the naming standard in MSXOrg/docs (linked below), an action's private helper module must be named after the action (
<ActionRepo>.Helpers) instead of the genericHelpers. A module namedHelperscollides with the shared frameworkHelpersmodule (installed byPSModule/Install-PSModuleHelpers, and loaded into the test session byPSModule/Invoke-Pester). Two modules namedHelpersin one session break module resolution and make PesterMock -ModuleName Helpersambiguous.Concrete failure and fix template: PSModule/Resolve-PSModuleVersion#4 — renamed the helper module, updated the entry-script import and the test
-ModuleName, and kept the frameworkImport-Module -Name 'Helpers'line.RuntimeException: Multiple script or manifest modules named 'Helpers' are currently loaded.Scope — rename in every action repo that ships a generic helper module
Confirmed via org-wide code search (
filename:Helpers.psm1 org:PSModule):src/Helpers.psm1->Debug.Helpers.psm1src/Helpers.psm1->Get-PesterCodeCoverage.Helpers.psm1src/Helpers.psm1->Invoke-Pester.Helpers.psm1scripts/ResolveVersion.psm1(from Lock workflow to use v0 of actions #4) toResolve-PSModuleVersion.Helpers.psm1Special case (do NOT blindly rename):
src/Helpers/Helpers.psm1, which is the shared canonicalHelpersmodule imported across actions. Keep it namedHelpers; document the carve-out.Per-repo change checklist
For each affected action:
git mvthe module file to<ActionRepo>.Helpers.psm1(and the matching test file, if any).Import-Module -Name "$PSScriptRoot/<ActionRepo>.Helpers.psm1", keeping the frameworkImport-Module -Name 'Helpers'line.-ModuleName '<ActionRepo>.Helpers'plus the module import path and any data-file path.Helpersis loaded, so validate locally by pre-loading a dummy module namedHelpersbeforeInvoke-Pester.Audit for completeness
Code search only indexes default branches and files literally named
Helpers.psm1. Before closing, audit all action repos (any repo with a rootaction.yml) for any helper/script module whose name is not<ActionRepo>.Helpers:Acceptance criteria
<ActionRepo>.Helpers(except the documentedInstall-PSModuleHelperscarve-out).HelpersexceptInstall-PSModuleHelpers.Related