Skip to content

ci: add typespec-go SDK regeneration ADO pipeline#27137

Open
tadelesh wants to merge 2 commits into
Azure:mainfrom
tadelesh:typespec-go-regenerate-workflow
Open

ci: add typespec-go SDK regeneration ADO pipeline#27137
tadelesh wants to merge 2 commits into
Azure:mainfrom
tadelesh:typespec-go-regenerate-workflow

Conversation

@tadelesh

@tadelesh tadelesh commented Jul 7, 2026

Copy link
Copy Markdown
Member

Migrates the typespec-go SDK regeneration pipeline from the Azure DevOps sdk-regenerate.yml in 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-go emitter and opens a draft PR against Azure/azure-sdk-for-go using this repo's native create-pull-request ADO 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 — updates eng/emitter-package.json and regenerates SDKs. Branch/commit/push/PR are handled by the create-pull-request template.

Emitter modes (both preserved from the original)

  • 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 (UseDevPackage=true, TypeSpecAzureRef), 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) instead of the source package.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.

Copilot AI review requested due to automatic review settings July 7, 2026 05:48
@tadelesh tadelesh requested review from a team, benbp and mikeharder as code owners July 7, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.py to update eng/emitter-package.json/lock and run tsp-client update across sdk/resourcemanager/**.
  • Adds .github/workflows/sdk-regenerate.yml to run regeneration on-demand or on a weekly schedule and create/update a draft PR via gh.

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.

Comment thread eng/scripts/sdk_regenerate.py
Comment thread eng/scripts/sdk_regenerate.py
Comment thread eng/scripts/sdk_regenerate.py
Comment thread eng/scripts/sdk_regenerate.py
Comment thread eng/scripts/sdk_regenerate.py
Comment thread eng/scripts/sdk_regenerate.py Outdated
Comment thread .github/workflows/sdk-regenerate.yml Outdated
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>
@tadelesh tadelesh force-pushed the typespec-go-regenerate-workflow branch from c58cab1 to 90b754a Compare July 7, 2026 06:02
@tadelesh tadelesh changed the title ci: add typespec-go SDK regeneration GitHub Action ci: add typespec-go SDK regeneration ADO pipeline Jul 7, 2026
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>
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.

2 participants