inner loop, update-changelogcontent tool, add script to integrate#47079
inner loop, update-changelogcontent tool, add script to integrate#47079haolingdong-msft merged 13 commits intomainfrom
Conversation
|
One question (may actually to EngSys), is about how best to unit test Powershell script. Searched the net, but didn't find something apparent. |
Great question, I'm also searching this and I asked @msyyc the same question. Python is testing the script written by python, powershell is just a wrapper. @msyyc Please correct me if I understand wronly. |
We already have the script test pipeline template in the |
287703f to
a29960c
Compare
a29960c to
aadc972
Compare
|
Thanks @raych1 for the guidance! I will add unit test in a separate PR, is there any existing documents on how to add a unit test? |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces automation tooling to update CHANGELOG.md files by comparing built SDK packages with their latest released versions from Maven Central. The changes include a new PowerShell script for changelog generation, integration with the SDK's swagger-to-sdk configuration, and clarifying comments in the Python automation code.
- Adds
Automation-Sdk-UpdateChangelog.ps1script that downloads the latest released JAR, compares it with the current build, and updates CHANGELOG.md - Integrates the script into
swagger_to_sdk_config.jsonfor use with AzureSdk.CLI tooling - Adds clarifying comments to Python automation files explaining version comparison logic
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| eng/swagger_to_sdk_config.json | Adds configuration for the updateChangelogContentScript pointing to the new PowerShell automation script |
| eng/scripts/Automation-Sdk-UpdateChangelog.ps1 | New script that automates CHANGELOG.md updates by comparing JARs from Maven Central with local builds |
| eng/automation/utils.py | Adds comment explaining the get_latest_release_version function's behavior |
| eng/automation/generate.py | Adds explanatory comments about version handling and changelog generation logic; updates function call with additional parameter |
@haolingdong-msft I haven't found any guidance on that. But it's pretty straight forward and you can check out the pester doc. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
weshaggard
left a comment
There was a problem hiding this comment.
Thanks for updating to using the common changelog code. I added a couple comments around potentially promoting some of the code to common so it can be shared and can use the same logic and regex's etc.
Fix Azure/azure-sdk-tools#12382
Description
As suggested by @weidongxu-microsoft, I'm referring to this code to write the script.
The logic could be different from the update change log logics in sdk automation, regarding to selecting which version to compare with.
This PR fetches the latest stable version to compare with, if not found, fetch the latest beta version. While sdk automation pipeline uses different version for different cases (I've also adviced @XiaofeiCao on the logics and add some comments into the current code to make it easier to understand, thanks @XiaofeiCao !):
We could use the current logic for simplicity for V1 and have furthur discussion to consolidate logics for both inner loop and pipeline.
Code Change
Test
integrate locally and can generate changelogs well:

All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines