-
Notifications
You must be signed in to change notification settings - Fork 2.1k
inner loop, update changelog script, add unit test #47373
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
Conversation
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 the changelog automation script by extracting helper functions into a reusable PowerShell module (ChangelogAutomationHelper.psm1), adds comprehensive unit tests using the Pester framework, and introduces a pipeline to run these tests automatically.
Key changes:
- Helper functions moved from the main script to a dedicated module for better code organization and testability
- Unit test suite added covering most functions (Get-MavenArtifactInfo, Get-LatestReleasedStableVersion, Get-BuiltJarPath, New-ChangelogContent, Update-ChangelogFile)
- Pipeline configuration added to run Pester tests automatically
- Main script simplified to import and use the module functions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| eng/scripts/tests/Automation-Sdk-UpdateChangelog.tests.ps1 | New unit test file with comprehensive test coverage for changelog automation functions using Pester framework |
| eng/scripts/modules/ChangelogAutomationHelper.psm1 | New PowerShell module containing refactored helper functions with proper documentation and error handling |
| eng/scripts/Automation-Sdk-UpdateChangelog.ps1 | Refactored to import the new module, removing ~480 lines of duplicate function definitions |
| eng/pipelines/templates/stages/powershell-tests.yml | New pipeline configuration to run Pester tests automatically on Windows agents |
weshaggard
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.
I made a suggestion about the pipeline but that can go in a follow-up PR.
- Test changelog updates when source code changes - Test idempotent behavior (multiple runs produce identical output) - Validate unreleased section is preserved after updates - Remove mocks to test actual file update behavior Resolves: #47373 (comment)
Description
Fix Azure/azure-sdk-tools#12382
Follow up on this PR: #47079 (comment)
Add UT to test the inner loop, update changelog script.
Code changes:
Automation-Sdk-UpdateChangelog.ps1into moduleChangelogAutomationHelper.psm1for better code reuse and for better testing, by looking at Pester's document. Not a powershell expert. Please let me know if you have better suggestions. Thank you! @raych1 @weshaggardTest result:

--- Update at 2025.11.26------
Removed module file and add helper function directly in commit ee91641
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines