Skip to content

⚙️ [Maintenance]: Hard-lock Pester test dependency to 5.8.0 by GUID#17

Open
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
mainfrom
fix/hardlock-pester-5.8.0
Open

⚙️ [Maintenance]: Hard-lock Pester test dependency to 5.8.0 by GUID#17
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
mainfrom
fix/hardlock-pester-5.8.0

Conversation

@MariusStorhaug

Copy link
Copy Markdown
Member

Re-establishes a hard-locked Pester test dependency for PSCustomObject, consistent with the other module repos. The pin was previously removed in #16 (which closed #15) to unblock CI; this restores it as an exact, GUID-pinned dependency per the agreed hard-lock strategy.

#Requires -Modules @{ ModuleName = 'Pester'; RequiredVersion = '5.8.0'; GUID = 'a699dea5-2c73-4616-a270-1f7abb777e71' }

Why 5.8.0 + GUID

  • Exact version = reproducible and supply-chain-safe (no silent drift to a newer or compromised release).
  • GUID pins module identity (anti-name-squat). Both the version and the GUID are enforced by PowerShell at discovery time (verified locally).
  • No version comment — unlike a GitHub Actions @<sha>, RequiredVersion already states the version in plain text, and #Requires rejects a GUID without a version key.

Context: #15, #16. Part of the dependency-management epic PSModule/Process-PSModule#356.

Note

This pin fully holds once Invoke-Pester installs the pinned version instead of the latest (today it installs newest, so a future Pester release would re-break exact pins). Tracked in PSModule/Invoke-Pester#68.

Copilot AI review requested due to automatic review settings July 5, 2026 17:17
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

No Significant Changes Detected

This PR does not contain changes to files that would trigger a new release:

Pattern Description
^src/ Matches files where path matches this pattern
^README\.md$ Matches files where path matches this pattern

Build, test, and publish stages will be skipped for this PR.

If you believe this is incorrect, please verify that your changes are in the correct locations.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reintroduces a #Requires -Modules directive in the test entrypoint to enforce a specific Pester dependency (version + GUID) for reproducible test execution.

Changes:

  • Adds #Requires -Modules to tests/PSCustomObject.Tests.ps1 pinning Pester to 5.8.0 and a specific module GUID.
  • Shifts the test file header so the #Requires directive is evaluated before any test code/attributes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,6 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
#Requires -Modules @{ ModuleName = 'Pester'; RequiredVersion = '5.8.0'; GUID = 'a699dea5-2c73-4616-a270-1f7abb777e71' }
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

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.

Test discovery fails: pinned Pester 5.7.1 conflicts with installed Pester 5.8.0

2 participants