Skip to content

Conversation

@chaosdinosaur
Copy link

@chaosdinosaur chaosdinosaur commented Feb 12, 2026

Pull Request

Description

  • Add CIHelpers module import, mocking, and cleanup to test files for Generate-PrReference.ps1 and Get-VerifiedDownload.ps1. Add error propagation tests verifying CI annotation handling paths.

  • Replace remaining inline $env:GITHUB_ACTIONS check and raw ::error:: output in Test-ActionVersionConsistency.ps1 catch block with Write-CIAnnotation.

Related Issue(s)

Fixes #352

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Note for AI Artifact Contributors:

  • Agents: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review .github/agents/ before creating new ones.
  • Skills: Must include both bash and PowerShell scripts. See Skills.
  • Model Versions: Only contributions targeting the latest Anthropic and OpenAI models will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected.
  • See Agents Not Accepted and Model Version Requirements.

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Sample Prompts (for AI Artifact Contributions)

User Request:

Execution Flow:

Output Artifacts:

Success Indicators:

For detailed contribution requirements, see:

Testing

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Additional Notes

Copilot AI review requested due to automatic review settings February 12, 2026 00:06
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.41%. Comparing base (67585f5) to head (8217d2a).

Files with missing lines Patch % Lines
scripts/security/Test-ActionVersionConsistency.ps1 0.00% 8 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #482      +/-   ##
==========================================
- Coverage   83.41%   83.41%   -0.01%     
==========================================
  Files          20       20              
  Lines        3510     3509       -1     
==========================================
- Hits         2928     2927       -1     
  Misses        582      582              
Flag Coverage Δ
pester 83.41% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scripts/security/Test-ActionVersionConsistency.ps1 84.06% <0.00%> (+0.45%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 refactors three utility scripts to use the shared CIHelpers module, replacing inline CI annotation patterns with standardized CIHelpers function calls. The changes include updating Test-ActionVersionConsistency.ps1 to use Write-CIAnnotation instead of raw ::error:: output, and adding test coverage for error propagation in Generate-PrReference.ps1 and Get-VerifiedDownload.ps1.

Changes:

  • Replaced inline $env:GITHUB_ACTIONS checks and ::error:: output with Write-CIAnnotation calls in Test-ActionVersionConsistency.ps1
  • Added CIHelpers module imports and cleanup to test files for Generate-PrReference.ps1 and Get-VerifiedDownload.ps1
  • Added error propagation tests to verify error handling paths

Reviewed changes

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

File Description
scripts/tests/lib/Get-VerifiedDownload.Tests.ps1 Adds CIHelpers import/cleanup and error propagation test, plus CIHelpers function mocks
scripts/tests/dev-tools/Generate-PrReference.Tests.ps1 Adds CIHelpers import/cleanup and error propagation test, plus CIHelpers function mocks
scripts/security/Test-ActionVersionConsistency.ps1 Replaces inline CI pattern with Write-CIAnnotation in catch block

Copilot AI review requested due to automatic review settings February 12, 2026 00:29
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 3 out of 3 changed files in this pull request and generated no new comments.

@chaosdinosaur chaosdinosaur marked this pull request as ready for review February 12, 2026 16:53
@chaosdinosaur chaosdinosaur requested a review from a team as a code owner February 12, 2026 16:53
Copilot AI review requested due to automatic review settings February 12, 2026 16:53
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 3 out of 3 changed files in this pull request and generated 2 comments.

@chaosdinosaur
Copy link
Author

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

…est cleanup

- Replace inline $env:GITHUB_ACTIONS check and ::error:: output with Write-CIAnnotation in Test-ActionVersionConsistency.ps1
- Standardize entry point guard to $script:SkipMain pattern
- Add CIHelpers module cleanup in AfterAll for Generate-PrReference and Get-VerifiedDownload test files

🔧 - Generated by Copilot
@chaosdinosaur chaosdinosaur force-pushed the refactor/scripts-cihelpers-devtools-lib-352 branch from e3c2e5d to e8642ba Compare February 12, 2026 23:54
Copilot AI review requested due to automatic review settings February 13, 2026 01:23
Copy link
Member

@WilliamBerryiii WilliamBerryiii left a comment

Choose a reason for hiding this comment

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

Nice!

@WilliamBerryiii
Copy link
Member

Thank you for this contribution, @chaosdinosaur! 🎉 Your refactoring of the dev-tools and lib scripts to use the CIHelpers module — along with the added test coverage for error propagation and CI annotation handling — cleans up the codebase and makes it more consistent. We appreciate the effort you put into this.

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 3 out of 3 changed files in this pull request and generated 3 comments.

…ttern

- extract Invoke-ActionVersionConsistency function with full param block
- replace HVE_SKIP_MAIN env var with MyInvocation.InvocationName guard
- add Remove-Module CIHelpers cleanup to test AfterAll block

🔧 - Generated by Copilot
- pipe Export-ConsistencyReport to Out-Host inside Invoke-ActionVersionConsistency
- prevents Write-Output json from contaminating function return value

🐛 - Generated by Copilot
Copilot AI review requested due to automatic review settings February 13, 2026 02:32
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 4 out of 4 changed files in this pull request and generated 2 comments.

@WilliamBerryiii
Copy link
Member

@agreaves-ms or @katriendg ... can you do a quick review of this because I made some small changes on the cleanup for the tests.

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.

refactor(scripts): refactor dev-tools and lib scripts to use CIHelpers module

3 participants