ci: add typespec-go SDK regeneration ADO pipeline#27137
Open
tadelesh wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions-based automation to regenerate TypeSpec-Go–generated ARM Resource Manager SDKs and open a draft PR with the results, migrating this capability from the former Azure DevOps pipeline in Azure/autorest.go.
Changes:
- Introduces
eng/scripts/sdk_regenerate.pyto updateeng/emitter-package.json/lock and runtsp-client updateacrosssdk/resourcemanager/**. - Adds
.github/workflows/sdk-regenerate.ymlto run regeneration on-demand or on a weekly schedule and create/update a draft PR viagh.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| eng/scripts/sdk_regenerate.py | New regeneration script: updates emitter package versions/lock and runs tsp-client update across RM modules. |
| .github/workflows/sdk-regenerate.yml | New scheduled/dispatch workflow to run regeneration and open/update a draft PR with the results. |
Migrated from the Azure DevOps sdk-regenerate.yml pipeline in Azure/autorest.go and relocated here, next to the SDK it regenerates. Regenerates the resource manager SDKs from the @azure-tools/typespec-go emitter and opens a draft PR via the repo's native create-pull-request template. Supports both emitter modes from the original pipeline: - released (default): pin eng/emitter-package.json to the latest published @azure-tools/typespec-go from npm. - dev: build the emitter from an Azure/typespec-azure branch, pnpm pack it, and point eng/emitter-package.json at the tarball. Dependency versions are read from the packed tarball (where pnpm rewrites workspace: specifiers to concrete published ranges) rather than the source package.json. Compile-time path variables select the correct source layout for released (self only) vs dev (self + typespec-azure) runs. Branch/commit/push/PR are handled by the create-pull-request template; sdk_regenerate.py only updates the emitter package and regenerates the SDKs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c58cab1 to
90b754a
Compare
Write regenerate-sdk-result.json to a --result-file path outside the SDK working tree (the pipeline points it at ArtifactStagingDirectory and publishes it as a build artifact) so the create-pull-request template's git add -A no longer sweeps it into the regeneration PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the typespec-go SDK regeneration pipeline from the Azure DevOps
sdk-regenerate.ymlin Azure/autorest.go, relocated here next to the SDK it regenerates.What it does
Regenerates the resource manager SDKs produced by the
@azure-tools/typespec-goemitter and opens a draft PR against Azure/azure-sdk-for-go using this repo's nativecreate-pull-requestADO template. This replaces the real ARM service specs that were removed from typespec-go's local test set when the emitter moved into Azure/typespec-azure.Files
eng/pipelines/sdk-regenerate.yml— Azure DevOps pipeline (trigger: none, weekly schedule,workflow-style parameters).eng/scripts/sdk_regenerate.py— updateseng/emitter-package.jsonand regenerates SDKs. Branch/commit/push/PR are handled by thecreate-pull-requesttemplate.Emitter modes (both preserved from the original)
eng/emitter-package.jsonto the latest published@azure-tools/typespec-gofrom npm.Azure/typespec-azurebranch (UseDevPackage=true,TypeSpecAzureRef),pnpm packit, and pointeng/emitter-package.jsonat the tarball. Dependency versions are read from the packed tarball (where pnpm rewritesworkspace:specifiers to concrete published ranges) instead of the sourcepackage.json.Compile-time path variables select the correct source layout for released (self only) vs dev (self + typespec-azure) runs.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com
Waiting for Azure/typespec-azure#4628 merge first.