🐛 fix(module): prepare branch for PR readiness - #192
Conversation
Remove aliases from FunctionsToExport, keep command aliases in AliasesToExport, relocate the MkDocs CI helper under .github/cicd-scripts, and fix Pester export/integration checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
This PR aligns the module manifest, tests, and CI automation around a clearer export contract: only real functions belong in FunctionsToExport, while command aliases belong exclusively in AliasesToExport. It also relocates the MkDocs navigation automation script into a CI-focused directory and tightens Pester lifecycle usage in an integration test.
Changes:
- Updates manifest automation + tests to distinguish exported functions vs exported aliases (and validate aliases resolve to module commands).
- Moves the MkDocs nav automation script to
.github/cicd-scriptsand updates workflows/tests/docs accordingly. - Fixes integration test cleanup by moving
Remove-ModuleintoAfterAllwithin the Pester lifecycle.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Tests/Unit/ExportedFunctions.Tests.ps1 | Updates export validation to treat aliases separately and ensure aliases resolve to module functions. |
| src/Tests/Integration/SampleIntegrationTest.Tests.ps1 | Moves module cleanup into AfterAll to stay within Pester lifecycle blocks. |
| src/PSPreworkout/PSPreworkout.psd1 | Removes alias entries from FunctionsToExport; keeps them in AliasesToExport. |
| src/PSPreworkout.build.ps1 | Updates manifest automation to extract function-level aliases via AST and export aliases only to AliasesToExport. |
| src/Draft/Update-MkDocsNavigation.Tests.ps1 | Updates tests to point at the relocated MkDocs navigation script and reflect alias handling expectations. |
| Scripts/README.md | Removes MkDocs navigation automation documentation from Scripts/ now that it’s CI-scoped elsewhere. |
| docs/MKDOCS-NAVIGATION-AUTOMATION.md | Updates documentation to reference the new .github/cicd-scripts location and revised alias/export model. |
| .github/workflows/Validate Module Manifest.yml | Updates alias extraction and validation rules so aliases are not allowed in FunctionsToExport. |
| .github/workflows/Update MkDocs Navigation.yml | Runs the MkDocs navigation script from .github/cicd-scripts. |
| .github/CONTRIBUTING.md | Documents the new convention: aliases should not be added to FunctionsToExport. |
| .github/cicd-scripts/Update-MkDocsNavigation.ps1 | Updates script docs/logic to rely on FunctionsToExport containing only functions (no alias filtering list). |
Comments suppressed due to low confidence (1)
src/Draft/Update-MkDocsNavigation.Tests.ps1:137
- This test hard-codes a specific set of alias names to assert they are not categorized. Since the PR is moving toward treating aliases as data (
AliasesToExport) rather than a fixed list, consider deriving the aliases from the manifest (e.g.,Import-PowerShellDataFileand readAliasesToExport) to avoid the test becoming stale whenever aliases change.
It 'should not categorize aliases from AliasesToExport' {
if ($null -eq $categorized) {
Set-ItResult -Skipped -Because "Manifest file not accessible in test environment"
return
}
$allFunctions = $categorized['Customize'] + $categorized['Develop'] + $categorized['Daily Functions']
$allFunctions | Should -Not -Contain 'Edit-HistoryFile'
$allFunctions | Should -Not -Contain 'Get-Assembly'
$allFunctions | Should -Not -Contain 'Get-PSPortable'
$allFunctions | Should -Not -Contain 'Init-PSEnvConfig'
$allFunctions | Should -Not -Contain 'New-Script'
$allFunctions | Should -Not -Contain 'Show-LoadedAssemblies'
}
Move Update-MkDocsNavigation.Tests.ps1 from Draft into the Unit test suite and keep the CI helper dot-source safe for Pester. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace Write-Host usage with PowerShell information/error streams and adjust helper function names/ShouldProcess support to satisfy PSScriptAnalyzer without changing navigation behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
FunctionsToExportand keep command aliases inAliasesToExport.github/cicd-scriptsValidation
Test-ModuleManifestInvoke-Pester(244 passed, 0 failed, 3 skipped)Invoke-Build -File .\src\PSPreworkout.build.ps1 BuildNoIntegration