[DO NOT MERGE] Pester 6.0.0 release candidate update#1884
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughCI workflows and PowerShell build/test scripts now install Pester ChangesPester 6.0.0 Version Pinning
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s test and build tooling to run against the Pester 6.0.0 release candidate as a real-world compatibility check for an upcoming Pester release.
Changes:
- Pin Pester imports to v6 (
-RequiredVersion 6.0.0) in local/build test scripts. - Install Pester
6.0.0-rc1explicitly in CI workflows (since prereleases aren’t selected via minimum-version selection). - Update command-reference generation to install/import Pester v6.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| powershell/tests/pester.ps1 | Pins Pester import to v6 for the main test runner script. |
| build/Update-CommandReference.ps1 | Installs prerelease Pester and pins the import for command reference generation. |
| build/Test-PSModule.ps1 | Pins Pester import to v6 for module test execution. |
| .github/workflows/update-tag-documentation.yml | Installs Pester 6.0.0-rc1 in the tag-doc generation workflow. |
| .github/workflows/build-validation.yaml | Installs Pester 6.0.0-rc1 in the build-validation workflow matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| &$PSScriptRoot\Restore-PSModuleDependencies.ps1 -ModuleManifestPath $ModuleManifestPath -PSModuleCacheDirectory $PSModuleCacheDirectoryInfo.FullName | Out-Null | ||
|
|
||
| Import-Module Pester -MinimumVersion 5.0.0 | ||
| Import-Module Pester -RequiredVersion 6.0.0 |
|
|
||
| Import-Module PSModuleDevelopment | ||
| Import-Module Pester | ||
| Import-Module Pester -RequiredVersion 6.0.0 |
| if (-not (Get-Module Pester -ListAvailable | Where-Object { $_.Version -eq '6.0.0' })) { Install-Module Pester -RequiredVersion 6.0.0-rc1 -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck } | ||
|
|
||
| Import-Module Alt3.Docusaurus.Powershell | ||
| Import-Module PlatyPS | ||
| Import-Module Pester | ||
| Import-Module Pester -RequiredVersion 6.0.0 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@build/Update-CommandReference.ps1`:
- Around line 7-11: The Pester version check and import in
Update-CommandReference.ps1 are not prerelease-aware, so a GA 6.0.0 install can
bypass the intended rc1 path. Update the Pester lookup and Import-Module usage
to explicitly require the prerelease package/version, and make the same
prerelease-specific change in the other Pester import sites so they cannot
resolve to the stable 6.0.0 release.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b7cfa21d-acac-4316-8498-afcebc454546
📒 Files selected for processing (5)
.github/workflows/build-validation.yaml.github/workflows/update-tag-documentation.ymlbuild/Test-PSModule.ps1build/Update-CommandReference.ps1powershell/tests/pester.ps1
| if (-not (Get-Module Pester -ListAvailable | Where-Object { $_.Version -eq '6.0.0' })) { Install-Module Pester -RequiredVersion 6.0.0-rc1 -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck } | ||
|
|
||
| Import-Module Alt3.Docusaurus.Powershell | ||
| Import-Module PlatyPS | ||
| Import-Module Pester | ||
| Import-Module Pester -RequiredVersion 6.0.0 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
set -euo pipefail
printf 'Repo root: '; pwd
echo '--- update command reference file with line numbers ---'
cat -n build/Update-CommandReference.ps1 | sed -n '1,120p'
echo '--- search for Pester import/version patterns ---'
rg -n "Import-Module Pester|Get-Module Pester|6\.0\.0-rc1|6\.0\.0" -S .Repository: maester365/maester
Length of output: 13989
🌐 Web query:
PowerShellGet prerelease module version Get-Module Version PSData.Prerelease Import-Module RequiredVersion AllowPrerelease documentation
💡 Result:
To work with prerelease modules in PowerShell, you must use specific parameters when searching for, installing, or updating them [1][2][3]. When using PowerShellGet (versions 2.x and earlier), you must include the -AllowPrerelease switch in your commands [1][2][3]. Simply specifying a version string containing a prerelease label in -RequiredVersion is insufficient; the -AllowPrerelease parameter is required to authorize the operation [1][3]. For example, to install a specific prerelease version: Install-Module -Name -RequiredVersion - -AllowPrerelease [2][4] The -AllowPrerelease parameter applies to Find-Module, Install-Module, Update-Module, and Save-Module [1][3]. In newer versions of PowerShell (using Microsoft.PowerShell.PSResourceGet), the -Prerelease parameter is used instead [5][6]. Regarding module metadata, prerelease information is typically managed within the module manifest (.psd1 file) under the PrivateData.PSData section [7][8]. While the module object structure can store this data, it is often exposed via extended type system (ETS) properties in modern PowerShell versions to make the PreRelease label visible when running Get-Module [7][9]. Top results: [1][2][5][3][7]
Citations:
- 1: https://learn.microsoft.com/en-us/powershell/gallery/concepts/module-prerelease-support?view=powershellget-3.x
- 2: https://learn.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershellget-2.x
- 3: https://github.com/MicrosoftDocs/PowerShell-Docs-PSGet/blob/main/powershell-gallery/docs-conceptual/concepts/module-prerelease-support.md
- 4: https://github.com/MicrosoftDocs/PowerShell-Docs-PSGet/blob/main/powershell-gallery/powershellget-2.x/PowerShellGet/Install-Module.md
- 5: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.psresourceget/find-psresource?view=powershellget-3.x
- 6: https://learn.microsoft.com/en-us/powershell/module/powershellget/update-module?view=powershellget-3.x
- 7: (PowerShell 7) Get-Module exposes PreRelease without exposing PreRelease PowerShell/PowerShell#10845
- 8: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_module_manifests?view=powershell-7.6
- 9: Expose PreRelease label in PSModuleInfo formatter PowerShell/PowerShell#10316
🏁 Script executed:
set -euo pipefail
command -v pwsh >/dev/null || { echo "pwsh not available"; exit 0; }
pwsh -NoLogo -NoProfile -Command '
$PSVersionTable.PSVersion.ToString()
"---"
Get-Command Get-Module, Import-Module | Format-Table -AutoSize Name,Version,Source
"---"
# Show how module versions/prerelease are represented if Pester is present
Get-Module Pester -ListAvailable |
Select-Object Name, Version, ModuleBase, Path, @{n="Prerelease";e={ $_.PrivateData.PSData.Prerelease }} |
Format-Table -AutoSize
'Repository: maester365/maester
Length of output: 334
Make the Pester lookup prerelease-aware
Get-Module and Import-Module -RequiredVersion 6.0.0 both key off the base module version, so an installed GA 6.0.0 can satisfy this path and bypass 6.0.0-rc1. Pin the prerelease explicitly here and in the other Pester import sites.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@build/Update-CommandReference.ps1` around lines 7 - 11, The Pester version
check and import in Update-CommandReference.ps1 are not prerelease-aware, so a
GA 6.0.0 install can bypass the intended rc1 path. Update the Pester lookup and
Import-Module usage to explicitly require the prerelease package/version, and
make the same prerelease-specific change in the other Pester import sites so
they cannot resolve to the stable 6.0.0 release.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hi — Pester 6.0.0 is almost ready, and before I release it I'm trying it out
against real-world Pester v5 test suites.
This PR updates Pester to the 6.0.0 release candidate and makes the changes
needed for your tests to run on it. I opened it to learn two things:
final release instead of after.
You don't need to merge this, and I'd suggest you don't — it's only meant to
show what a v6 update would involve and to give me feedback. Please leave it
open, though: if more release candidates come out I'll push those updates here
too, and I'll close it myself afterwards.
This PR was co-authored by GitHub Copilot. If you'd rather not receive
AI-assisted PRs, just close it and I won't open one for the next release.
Thanks for the CI time this run used, and for maintaining a suite I could test
against.
— Jakub & Copilot
Summary by CodeRabbit
Bug Fixes
Tests