-
Notifications
You must be signed in to change notification settings - Fork 948
Refactor generator tool and add inner loop cmd support #25680
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?
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 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
versionandchangelogpackages with comprehensive functionality for version management and changelog generation - Added
changelogcommand to generate and update changelog content based on code changes - Added
versioncommand 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/commonto a newutilspackage 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 |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Resolve: Azure/azure-sdk-tools#12375
Resolve: Azure/azure-sdk-tools#12385