Skip to content

inner loop, update-changelogcontent tool, add script to integrate#47079

Merged
haolingdong-msft merged 13 commits intomainfrom
update-changelog
Nov 19, 2025
Merged

inner loop, update-changelogcontent tool, add script to integrate#47079
haolingdong-msft merged 13 commits intomainfrom
update-changelog

Conversation

@haolingdong-msft
Copy link
Copy Markdown
Member

@haolingdong-msft haolingdong-msft commented Oct 23, 2025

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 !):

  • Breaking change detection: always comparing with latest stable version, which is useful in sdk validation pipeline.
  • Changelog generations: comparing with latest stable version if current release type is preview, otherwise, comparing with latest preview version.

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

  1. Automation-Sdk-UpdateChangelog.ps1
  2. eng/swagger_to_sdk_config.json to integrate with AzureSd.CLI

Test

integrate locally and can generate changelogs well:
image

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@haolingdong-msft haolingdong-msft changed the title add script on update changelog inner loop, update-changelogcontent tool, add script to integrate Nov 12, 2025
@weidongxu-microsoft
Copy link
Copy Markdown
Member

One question (may actually to EngSys), is about how best to unit test Powershell script.

Searched the net, but didn't find something apparent.

@haolingdong-msft
Copy link
Copy Markdown
Member Author

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.
Add @raych1 for suggestion and guidance, thanks!

@raych1
Copy link
Copy Markdown
Member

raych1 commented Nov 12, 2025

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. Add @raych1 for suggestion and guidance, thanks!

We already have the script test pipeline template in the eng/common folder. It uses the Pester test framework to test the powershell script. We can create test and pipeline for each language. This is an example test for .NET.

@haolingdong-msft
Copy link
Copy Markdown
Member Author

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?

Copy link
Copy Markdown
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 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.ps1 script that downloads the latest released JAR, compares it with the current build, and updates CHANGELOG.md
  • Integrates the script into swagger_to_sdk_config.json for 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

Copy link
Copy Markdown
Member

@weidongxu-microsoft weidongxu-microsoft left a comment

Choose a reason for hiding this comment

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

Overall LGTM

@raych1
Copy link
Copy Markdown
Member

raych1 commented Nov 13, 2025

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?

@haolingdong-msft I haven't found any guidance on that. But it's pretty straight forward and you can check out the pester doc.

haolingdong-msft and others added 5 commits November 14, 2025 08:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@weidongxu-microsoft weidongxu-microsoft left a comment

Choose a reason for hiding this comment

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

LGTM for internal test and basis for iteration and future improvement.

Please do have the consensus with Wes on the few comments.

Copy link
Copy Markdown
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

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

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.

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.

[Java] Support Changelog Update

6 participants