Skip to content

Conversation

@tadelesh
Copy link
Member

@tadelesh tadelesh commented Nov 27, 2025

  • The purpose of this PR is explained in this or a referenced issue.
  • The PR does not update generated files.
  • Tests are included and/or updated for code changes.
  • Updates to module CHANGELOG.md are included.
  • MIT license headers are included in each file.

Resolve: Azure/azure-sdk-tools#12375
Resolve: Azure/azure-sdk-tools#12385

Copilot AI review requested due to automatic review settings November 27, 2025 03:37
Copilot finished reviewing on behalf of tadelesh November 27, 2025 03:40
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 the generator tool by extracting version calculation and changelog generation logic into separate reusable packages, and adds new CLI commands (changelog and version) to support inner loop development workflows.

Key Changes

  • Introduced dedicated version and changelog packages with comprehensive functionality for version management and changelog generation
  • Added changelog command to generate and update changelog content based on code changes
  • Added version command to calculate and update version numbers across all version-related files
  • Refactored generation workflow to use status-based generator selection instead of tag-based detection
  • Moved shared constants and utilities from cmd/v2/common to a new utils package for better reusability
  • Removed template files for CHANGELOG.md and go.mod in favor of programmatic generation

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
eng/tools/generator/version/version_tool.go New package containing version calculation, file updates (autorest.md, version.go, go.mod, README.md, imports), and preview API version detection
eng/tools/generator/version/version_tool_test.go Comprehensive tests for version calculation logic and preview API version detection
eng/tools/generator/cmd/version/versionCmd.go New CLI command for updating package version files with optional version calculation
eng/tools/generator/cmd/version/versionCmd_test.go Tests for version command validation logic
eng/tools/generator/changelog/changelog_tool.go Enhanced changelog package with new functions for determining module status, generating changelogs, and creating/updating changelog files
eng/tools/generator/changelog/changelog_tool_test.go Updated tests to use renamed private functions and added test for getPreviousVersionTag
eng/tools/generator/changelog/changelog_filter_test.go Updated to use renamed private function getChangelog
eng/tools/generator/cmd/changelog/changelogCmd.go New CLI command for generating and updating changelog content
eng/tools/generator/cmd/changelog/changelogCmd_test.go Tests for changelog command validation logic
eng/tools/generator/utils/paths.go New utility functions for finding SDK root and calculating relative paths
eng/tools/generator/utils/constants.go Moved constants and types from cmd/v2/common for better reusability
eng/tools/generator/cmd/v2/common/generation.go Refactored to use new version/changelog packages, removed duplicate code, simplified generator selection using module status
eng/tools/generator/cmd/v2/common/fileProcessor.go Removed functions moved to version/changelog packages, added documentation comments
eng/tools/generator/cmd/v2/common/fileProcessor_test.go Removed duplicate test moved to version package
eng/tools/generator/cmd/v2/common/constants.go Deleted - constants moved to utils package
eng/tools/generator/cmd/v2/automation/automationCmd.go Updated to use utils package for constants
eng/tools/generator/main.go Added new changelog and version commands to CLI
eng/tools/generator/template/typespec/go.mod.tpl Deleted - now generated programmatically
eng/tools/generator/template/typespec/CHANGELOG.md.tpl Deleted - now generated programmatically
eng/tools/generator/template/rpName/packageName/go.mod.tpl Deleted - now generated programmatically
eng/tools/generator/template/rpName/packageName/CHANGELOG.md.tpl Deleted - now generated programmatically
eng/tools/generator/CHANGELOG.md Updated with new features and breaking changes for version 0.3.2
eng/swagger_to_sdk_config.json Added new updateChangelogContentScript and updateVersionScript configurations

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.

[Go] Support Changelog Update [Go] Support SDK Version Update

3 participants