-
Notifications
You must be signed in to change notification settings - Fork 46
refactor(scripts): refactor dev-tools and lib scripts to use CIHelpers module #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor(scripts): refactor dev-tools and lib scripts to use CIHelpers module #482
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this 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_ACTIONSchecks and::error::output withWrite-CIAnnotationcalls 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 |
There was a problem hiding this 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.
There was a problem hiding this 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.
|
@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
e3c2e5d to
e8642ba
Compare
WilliamBerryiii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
|
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. |
There was a problem hiding this 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
There was a problem hiding this 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.
…ency 🔧 - Generated by Copilot
|
@agreaves-ms or @katriendg ... can you do a quick review of this because I made some small changes on the cleanup for the tests. |
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:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderagent and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md)Other:
.ps1,.sh,.py)Sample Prompts (for AI Artifact Contributions)
User Request:
Execution Flow:
Output Artifacts:
Success Indicators:
For detailed contribution requirements, see:
Testing
Checklist
Required Checks
AI Artifact Contributions
/prompt-analyzeto review contributionprompt-builderreviewRequired Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run lint:md-linksnpm run lint:psSecurity Considerations
Additional Notes