Skip to content

Conversation

@AprilDeFeu
Copy link
Owner

  • Added a local pre-commit hook to run PowerShell Pester tests and save results before commit.
  • Updated .pre-commit-config.yaml to include the new hook.
  • Enhanced .github/workflows/ci.yml to skip expensive PowerShell tests in CI if recent local results are present.
  • Ensured all changes are compatible with the repository's QA and security framework.

This PR improves developer workflow, reduces CI costs, and enforces robust PowerShell script testing.

- Add local pre-commit hook to run PowerShell Pester tests and save results before commit
- Update .pre-commit-config.yaml to include the new hook
- Enhance .github/workflows/ci.yml to skip expensive PowerShell tests in CI if recent local results are present
- Ensure all changes are compatible with the repository's QA and security framework
Copilot AI review requested due to automatic review settings November 14, 2025 08:30
@AprilDeFeu
Copy link
Owner Author

@copilot There were some issues with the PowerShell tests. Open a PR to deal with those and with the feedback from your review of this PR.

Copy link
Contributor

Copilot AI commented Nov 14, 2025

@AprilDeFeu I've opened a new pull request, #16, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

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 adds a pre-commit hook to run PowerShell Pester tests locally and optimizes CI by conditionally skipping tests when recent local results are available. The changes also modify tests to run without admin rights and introduce a destructive mode selection feature in the PowerShell script.

Key changes:

  • New pre-commit hook (.githooks/pre-commit.ps1) to run and save Pester test results
  • CI workflow modified to skip expensive tests when local results exist and are recent (<2 days old)
  • Test file refactored to use Pester 4 syntax and removed admin-requiring test contexts

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
.githooks/pre-commit.ps1 New pre-commit hook that runs Pester tests and saves results to tests/results/
.pre-commit-config.yaml Adds configuration for the new PowerShell Pester test hook
.github/workflows/ci.yml Adds logic to check for and use local test results, conditionally skipping CI tests
tests/unit/PowerShell/system-maintenance.Tests.ps1 Converts tests to Pester 4 syntax, removes admin-requiring contexts, adds hardcoded fallback path
PowerShell/system-administration/maintenance/system-maintenance.ps1 Adds Begin block, removes Confirm-Action helper, adds destructive mode prompt with Read-Host, wraps disk cleanup in destructive mode check

Copilot AI and others added 3 commits November 14, 2025 08:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 9 comments.

@AprilDeFeu
Copy link
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Nov 15, 2025

@AprilDeFeu I've opened a new pull request, #17, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits November 15, 2025 20:20
…se tests, improve automation support

Co-authored-by: AprilDeFeu <[email protected]>
Fix runtime errors and automation blockers from PR #15 review feedback
@AprilDeFeu
Copy link
Owner Author

@copilot Deal with the Codacy Code Analysis feedback and also apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Nov 16, 2025

@AprilDeFeu I've opened a new pull request, #18, to work on those changes. Once the pull request is ready, I'll request review from you.

AprilDeFeu and others added 13 commits November 15, 2025 19:39
Fix PSScriptAnalyzer warnings and remove unused parameter
…e.ps1

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
…e.ps1

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
…e.ps1

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
…e.ps1

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
…e.ps1

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
…e.ps1

Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
@AprilDeFeu AprilDeFeu merged commit 2e61933 into main Nov 16, 2025
6 checks passed
@AprilDeFeu AprilDeFeu deleted the feat/testing-framework branch November 16, 2025 04:36
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.

2 participants