Skip to content

Bug/260 setting max pester version below 6#261

Merged
stiwicourage merged 7 commits into
developfrom
bug/260-setting-max-pester-version-below-6
Jul 15, 2026
Merged

Bug/260 setting max pester version below 6#261
stiwicourage merged 7 commits into
developfrom
bug/260-setting-max-pester-version-below-6

Conversation

@stiwicourage

Copy link
Copy Markdown
Owner

Summary

  • Managed Nova test workflows now resolve and import only supported installed Pester versions from 5.7.1 through 5.10.0, fail early when only unsupported Pester 6.x versions are available, and reuse an already loaded supported Pester 5.x module before selecting another installation.
  • scripts/build/ci/Invoke-NovaModuleToolsCI.ps1 now runs Invoke-NovaTest and Test-NovaBuild in fresh pwsh sessions against the built module so CI exercises the same module boundary that GitHub Actions uses and avoids the Pester assembly-loader conflict seen in the failing workflow.
  • Public-command integration coverage was hardened by normalizing isolated-session output before matching expected error text, so ANSI formatting and wrapped lines no longer make the regression tests flaky.
  • This change was needed because the repository and CI could pick up unsupported Pester 6.x installs or trip the Pester loader after importing an installed Gallery copy of NovaModuleTools, building the local module, and then switching Pester versions in the same session.
  • Closes Setting max pester version below 6 #260.

Affected area

  • nova CLI or command routing
  • Public PowerShell cmdlet behavior
  • Scaffolding or project.json handling
  • Build, test, analyzer, coverage, or CI helper flow
  • Package, raw upload, or package metadata workflow
  • Publish, release, or GitHub Actions automation
  • Self-update or notification preference behavior
  • Contributor documentation (README.md, CONTRIBUTING.md, repository workflow docs)
  • End-user docs (docs/*.html)
  • Command help (docs/NovaModuleTools/en-US/*.md)
  • src/resources/example/
  • Dependency or manifest changes (project.json, workflow dependencies, release tooling)
  • Security-sensitive change
  • Documentation-only change
  • Agentic Copilot Workflow + scaffold mirror + scaffold-sync guardrail test.
  • Other

Review guidance

  • Start with src/private/quality/GetNovaTestWorkflowContext.ps1 and src/private/quality/InvokeNovaTestWorkflow.ps1 to review the supported-Pester selection/import flow and how the chosen module specification is carried into the Pester execution host.
  • Then review scripts/build/ci/Invoke-NovaModuleToolsCI.ps1 to see the fresh-session CI validation change that prevents the mixed-session loader issue.
  • Finish with tests/private/quality/, tests/public/InvokeNovaTest.Integration.Tests.ps1, tests/public/TestNovaBuild.Integration.Tests.ps1, tests/TestHelpers/PublicCommandIntegration.ps1, and tests/Invoke-NovaModuleToolsCI.Tests.ps1 for the regression coverage and CI helper assertions.
  • Trade-off / follow-up: the supported Pester window is intentionally strict (5.7.1 through 5.10.0). If Nova later adopts Pester 6.x, the selection logic, docs, and regression tests should be updated together rather than widened implicitly.

Validation

  • Invoke-NovaBuild
  • Invoke-NovaTest
  • Test-NovaBuild
  • ./scripts/build/Invoke-ScriptAnalyzerCI.ps1
  • ./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1
  • Targeted Nova workflow validated (% nova build, % nova test, % nova merge, % nova deploy, % nova publish, % nova release, % nova update, % nova notification, or % nova init as relevant)
  • Docs/example only; executable validation not needed

Validation notes:

pwsh -NoLogo -NoProfile -File ./scripts/build/Invoke-ScriptAnalyzerCI.ps1
- Passed with no PSScriptAnalyzer findings.

pwsh -NoLogo -NoProfile -Command "Set-Location '/Users/stiwi.courage/workspace/couragedk/NovaModuleTools'; Invoke-NovaTest"
- Passed: 1218 tests passed, 0 failed, 4 skipped.
- Produced artifacts/UnitTestResults.xml and artifacts/coverage.xml.

pwsh -NoLogo -NoProfile -Command "Set-Location '/Users/stiwi.courage/workspace/couragedk/NovaModuleTools'; Test-NovaBuild"
- Passed: 26 tests passed, 0 failed.
- Produced artifacts/TestResults.xml.

pwsh -NoLogo -NoProfile -File ./run.ps1
- Passed end-to-end local quality loop.
- This path also exercised Invoke-NovaBuild successfully before the fresh-session Invoke-NovaTest/Test-NovaBuild runs.

pwsh -NoLogo -NoProfile -File ./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1 -OutputDirectory ./artifacts
- Passed CI-parity flow.
- Confirmed artifacts/TestResults.xml, artifacts/UnitTestResults.xml, and artifacts/coverage.xml were produced.

CodeScene change-set check against origin/develop
- Passed: quality_gates = passed.

Documentation and release follow-up

  • README.md reviewed and updated if contributor workflow, architecture, CI, release, or automation changed
  • CONTRIBUTING.md reviewed; no update was needed because the contributor expectations and review flow did not change
  • CHANGELOG.md reviewed and updated if the change matters to users, maintainers, or contributors
  • RELEASE_NOTE.md reviewed and updated if the change affects public cmdlet usage, CLI usage, configuration semantics, or migration expectations
  • docs/NovaModuleTools/en-US/ help updated if a public command or CLI behavior changed
  • docs/*.html updated if end-user workflows or examples changed
  • src/resources/example/ reviewed and updated if the real-world project layout, package model, or upload workflow changed
  • No documentation, changelog, release-note, or example updates were needed

Maintainability, compatibility, and risk

  • Code Health / maintainability impact considered
  • No breaking change
  • Breaking change
  • Security-sensitive change
  • CI, workflow, or release-pipeline impact
  • Dependency-review impact

Risk, rollout, or rollback notes:

Patch-level fix only. The branch keeps project.json at 3.3.1-preview, so the current unreleased entries are ready to flow into the next stable 3.3.1 release while remaining safe on develop's prerelease line.

Primary risk:
- The supported Pester window is intentionally narrow (5.7.1 through 5.10.0). That is the desired behavior for this fix, but any future move to Pester 6.x must update the selection logic, docs, and tests together.

Rollback:
- Revert the Pester module-selection/import changes under src/private/quality/.
- Revert the fresh-session CI helper update in scripts/build/ci/Invoke-NovaModuleToolsCI.ps1.
- Revert the integration/output-normalization test updates if the behavior itself is rolled back.

Important

Do not use a public pull request to disclose a vulnerability before coordinated handling.
Use the private reporting path in SECURITY.md for new security issues.

…andling

- `Invoke-NovaTest`, `Test-NovaBuild`, and `% nova test` now only use Pester versions from `5.7.1` to `5.10.0`, failing with a clear error for unsupported `Pester 6.x`.
- Updated documentation to reflect the new Pester version requirements.
- Reuse already loaded supported Pester 5.x version before switching
- Ensure early failure with clear error when unsupported Pester 6.x is present
- Introduced new functions for command generation and execution
- Improved error handling for validation command failures
- Updated logging to capture command execution details
- resolve script path and load content once for efficiency
- update test assertions to use loaded script content
- resolve script path and load content once for efficiency
- update test assertions to use loaded script content
- replace output joining with Get-NovaPublicCommandIntegrationOutputText for better formatting
- normalize whitespace in output assertions for consistency
@stiwicourage stiwicourage linked an issue Jul 15, 2026 that may be closed by this pull request
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

…rModuleVersionSupported

- implement default value handling in Get-NovaPesterVersionText
- validate null candidate version in Test-NovaPesterModuleVersionSupported

@codescene-access codescene-access Bot 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.

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@codescene-access codescene-access Bot 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.

Code Coverage Gates Passed
Overall Coverage: 99.8% (required = 95%)
New & Changed Code Coverage: 100% (required = 99%)

Review details by gate
  • Overall Coverage

    • Pass/Fail Reason:
      The overall coverage gate was checked for all code and meets the goal: 99.8% covered >= threshold = 95%
    • Action:
      You have 294 files with a sum of 4170 covered and 7 uncovered lines of code.
  • New & Changed Code Coverage

    • Pass/Fail Reason:
      New or changed code meets coverage goal: 100% covered >= threshold = 99%
    • Action:
      You modified 2 files, and covered 76 added/modified lines of code.

@stiwicourage
stiwicourage merged commit 97003e6 into develop Jul 15, 2026
14 checks passed
stiwicourage added a commit that referenced this pull request Jul 15, 2026
* chore: prepare develop for next prerelease

* fix: update project description for clarity and consistency

* fix: update MaximumVersion for Pester module in project.json

* Bug/260 setting max pester version below 6 (#261)

* fix(#260): enforce supported Pester version range and improve error handling
- `Invoke-NovaTest`, `Test-NovaBuild`, and `% nova test` now only use Pester versions from `5.7.1` to `5.10.0`, failing with a clear error for unsupported `Pester 6.x`.
- Updated documentation to reflect the new Pester version requirements.

* fix(#260): improve Pester version handling in Nova test workflows
- Reuse already loaded supported Pester 5.x version before switching
- Ensure early failure with clear error when unsupported Pester 6.x is present

* fix(#260): enhance Nova module validation commands and logging
- Introduced new functions for command generation and execution
- Improved error handling for validation command failures
- Updated logging to capture command execution details

* fix(#260): improve run.ps1 script content handling in tests
- resolve script path and load content once for efficiency
- update test assertions to use loaded script content

* fix(#260): improve run.ps1 script content handling in tests
- resolve script path and load content once for efficiency
- update test assertions to use loaded script content

* fix(#260): enhance output handling in integration tests
- replace output joining with Get-NovaPublicCommandIntegrationOutputText for better formatting
- normalize whitespace in output assertions for consistency

* fix(#260): add tests for Get-NovaPesterVersionText and Test-NovaPesterModuleVersionSupported
- implement default value handling in Get-NovaPesterVersionText
- validate null candidate version in Test-NovaPesterModuleVersionSupported
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.

Setting max pester version below 6

1 participant