Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
85bf1b4
Add post-publish-sdk pipeline to regenerate TypeSpec SDKs
XiaofeiCao Jul 8, 2026
dd2e7c0
Simplify TypeSpecJavaPRId parameter displayName
XiaofeiCao Jul 8, 2026
813a81f
Update TypeSpecJavaPRId parameter displayName
XiaofeiCao Jul 8, 2026
90259c8
Use DevPackage boolean toggle with sentinel PRId default
XiaofeiCao Jul 8, 2026
08711ba
Build emitter from main when DevPackage=true and no PRId given
XiaofeiCao Jul 8, 2026
9438cc5
Shorten parameter displayNames
XiaofeiCao Jul 8, 2026
7896b12
Init typespec-azure submodules for dev build
XiaofeiCao Jul 8, 2026
ad234fb
Resolve catalog:/workspace: deps for dev emitter package
XiaofeiCao Jul 9, 2026
e10c21e
Make version-pinned regen the default route (post-publish)
XiaofeiCao Jul 9, 2026
377b2d8
Drop DevPackage; infer route from TypeSpecJavaVersion
XiaofeiCao Jul 9, 2026
7ea6d69
Default TypeSpecJavaVersion to 'none' sentinel
XiaofeiCao Jul 9, 2026
fc918d8
Refine parameter displayNames (Emitter Version)
XiaofeiCao Jul 9, 2026
2247118
Rename to post-publish-emitter.yaml and sync_emitter.py
XiaofeiCao Jul 9, 2026
fc517a5
Rename pipeline parameter TypeSpecJavaVersion to EmitterVersion
XiaofeiCao Jul 9, 2026
5de30fc
Use tsp-client generate-config-files for the published route
XiaofeiCao Jul 9, 2026
fc1b881
Pin dev-route emitter deps to exact versions
XiaofeiCao Jul 9, 2026
e0e3229
Revert "Pin dev-route emitter deps to exact versions"
XiaofeiCao Jul 9, 2026
d844208
Only update emitter version in emitter-package.json, not peer deps
XiaofeiCao Jul 10, 2026
b00ccb6
Seed emitter-package.json from emitter and inject designated libs
XiaofeiCao Jul 16, 2026
a1ee9ab
Sync emitter deps via npm view + specs repo for designated libs
XiaofeiCao Jul 16, 2026
d3bf672
Unify both routes on tsp-client generate-config-files
XiaofeiCao Jul 16, 2026
d0fb3bd
Split designated libs: openapi3 from specs, portal-core from npm latest
XiaofeiCao Jul 16, 2026
8b94c6f
Version openapi3 from npm latest instead of specs repo
XiaofeiCao Jul 16, 2026
5af665d
Document why portal-core and openapi3 are versioned from npm latest
XiaofeiCao Jul 16, 2026
1d161ef
Temporarily skip openai-typespec and typespec-liftr-base as designate…
XiaofeiCao Jul 16, 2026
820e19b
Remove stale designated libs before seeding to avoid merge ERESOLVE
XiaofeiCao Jul 16, 2026
92f8124
Update tsp-location commit to latest azure-rest-api-specs main for fa…
XiaofeiCao Jul 17, 2026
c50fd95
Stop skipping openai-typespec and typespec-liftr-base as designated libs
XiaofeiCao Jul 17, 2026
e523163
Fix quota tsp-location directory after unified-folder migration
XiaofeiCao Jul 17, 2026
a3a45a1
Skip azure-ai-vision-face in sync_emitter (subclient codegen inconsis…
XiaofeiCao Jul 17, 2026
bf7455e
Move azure-ai-vision-face under 'expect failure on below'
XiaofeiCao Jul 17, 2026
e5c83ce
Support building emitter from a typespec-azure branch in sync pipeline
XiaofeiCao Jul 17, 2026
1c1ece5
Simplify Emitter Version parameter displayName
XiaofeiCao Jul 17, 2026
503453b
[Automation] Generate SDK based on TypeSpec 0.45.6 DEV (typespec-azur…
azure-sdk Jul 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
474 changes: 235 additions & 239 deletions eng/emitter-package-lock.json

Large diffs are not rendered by default.

34 changes: 19 additions & 15 deletions eng/emitter-package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
{
"main": "dist/src/index.js",
"dependencies": {
"@azure-tools/typespec-java": "0.45.5"
"@azure-tools/typespec-java": "/mnt/vss/_work/1/typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.6.tgz"
},
"devDependencies": {
"@azure-tools/openai-typespec": "1.20.0",
"@azure-tools/typespec-autorest": "0.69.1",
"@azure-tools/typespec-azure-core": "0.69.0",
"@azure-tools/typespec-azure-resource-manager": "0.69.2",
"@azure-tools/typespec-azure-rulesets": "0.69.2",
"@azure-tools/typespec-client-generator-core": "0.69.2",
"@azure-tools/typespec-liftr-base": "0.14.0",
"@typespec/compiler": "1.13.0",
"@typespec/http": "1.13.0",
"@typespec/openapi": "1.13.0",
"@typespec/rest": "0.83.0",
"@typespec/versioning": "0.83.0",
"@typespec/xml": "0.83.0",
"@typespec/openapi3": "1.13.0"
"@azure-tools/typespec-autorest": "0.70.0",
"@azure-tools/typespec-azure-core": "0.70.0",
"@azure-tools/typespec-azure-resource-manager": "0.70.0",
"@azure-tools/typespec-azure-rulesets": "0.70.0",
"@azure-tools/typespec-client-generator-core": "0.70.0",
"@typespec/compiler": "1.14.0",
"@typespec/http": "1.14.0",
"@typespec/openapi": "1.14.0",
"@typespec/rest": "0.84.0",
"@typespec/versioning": "0.84.0",
"@typespec/xml": "0.84.0",
"@typespec/events": "0.84.0",
"@typespec/sse": "0.84.0",
"@typespec/streams": "0.84.0",
"@azure-tools/openai-typespec": "1.21.1",
"@azure-tools/typespec-liftr-base": "0.13.0",
"@azure-tools/typespec-azure-portal-core": "0.70.0",
"@typespec/openapi3": "1.14.0"
}
}
161 changes: 161 additions & 0 deletions eng/pipelines/post-publish-emitter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Regenerates all TypeSpec-based SDKs in azure-sdk-for-java using the typespec-java emitter,
# then opens an automated draft PR with the results.
#
# The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java).
# Published route (EmitterVersion set): pins eng/emitter-package.json to that published
# @azure-tools/typespec-java version, then regenerates. This is the post-publish path and does
# not touch typespec-azure sources.
# Dev route (EmitterVersion is 'none'): builds the emitter dev package from source instead
# - from the typespec-azure PR or branch given by PRIdOrBranch, or from the default branch (main)
# when PRIdOrBranch is 'none'.
trigger: none
pr: none

parameters:
# Set EmitterVersion for the default (post-publish) route. Leave it as 'none' to build the
# emitter from source, in which case PRIdOrBranch selects the typespec-azure PR / branch (or main).
- name: EmitterVersion
displayName: 'Emitter Version (e.g. 0.45.4; none = build from source)'
type: string
default: 'none'
- name: PRIdOrBranch
displayName: 'typespec-azure PR ID or branch — used only when Emitter Version is none (e.g. 43321 or my-branch; none = main)'
type: string
default: 'none'

jobs:
- job: Generate_SDK

timeoutInMinutes: 120

variables:
- template: /eng/pipelines/templates/variables/globals.yml
- template: /eng/pipelines/templates/variables/image.yml
- name: NodeVersion
value: '24.x'
# Local clone target for the (public) Azure/typespec-azure emitter repo (dev route only).
- name: TypeSpecAzureDirectory
value: $(Agent.BuildDirectory)/typespec-azure
# For the published route this is the given version. For the dev route it is overwritten at
# runtime from the built emitter's package.json (see 'Get Package Version').
- name: PackageVersion
${{ if ne(parameters.EmitterVersion, 'none') }}:
value: ${{ parameters.EmitterVersion }}
${{ else }}:
value: ''
- name: PullRequestTitleSuffix
${{ if eq(parameters.EmitterVersion, 'none') }}:
${{ if ne(parameters.PRIdOrBranch, 'none') }}:
value: " DEV (typespec-azure ${{ parameters.PRIdOrBranch }})"
${{ else }}:
value: " DEV (typespec-azure main)"
${{ else }}:
value: ""

pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
os: linux

steps:
# azure-sdk-for-java (self) is the only repo resource, so it is checked out to
# $(Build.SourcesDirectory). Azure/typespec-azure is public, so it is cloned directly
# (below) instead of via a repository resource + GitHub service connection.
- checkout: self

- task: NodeTool@0
displayName: 'Install Node.js $(NodeVersion)'
inputs:
versionSpec: '$(NodeVersion)'

- template: /eng/pipelines/templates/steps/maven-authenticate.yml
parameters:
SourceDirectory: $(Build.SourcesDirectory)

- template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml
parameters:
registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/

# Clone the public Azure/typespec-azure repo (dev route only; no service connection required).
# PRIdOrBranch selects what to build the emitter from: a bare PR number is expanded to
# refs/pull/<id>/merge; any other non-'none' value is treated as a branch name (or full ref) and
# fetched as-is. When PRIdOrBranch is 'none', the emitter is built from the default branch (main).
# Submodules are then initialized because typespec-azure vendors the TypeSpec compiler and the
# http-client-java generator via the 'core' submodule, which build:generator (Build-Generator.ps1)
# and tspd both require.
- task: PowerShell@2
displayName: 'Clone typespec-azure'
condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none'))
inputs:
pwsh: true
targetType: 'inline'
script: |
git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)"
$prIdOrBranch = '${{ parameters.PRIdOrBranch }}'
if ($prIdOrBranch -and $prIdOrBranch -ne 'none') {
if ($prIdOrBranch -match '^\d+$') {
# bare number -> PR merge ref
$ref = "refs/pull/$prIdOrBranch/merge"
} else {
# branch name (or full ref)
$ref = $prIdOrBranch
}
Write-Host "Fetching typespec-azure ref $ref"
git -C "$(TypeSpecAzureDirectory)" fetch origin $ref
git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD
}
git -C "$(TypeSpecAzureDirectory)" submodule update --init --recursive

# Build the emitter dev package (.tgz) from the typespec-azure PR.
# typespec-java depends on other workspace packages (workspace:^). First build only those
# upstream dependencies with turbo (the `^...` filter selects dependencies but excludes
# typespec-java itself). Then Build-TypeSpec.ps1 builds and packs typespec-java (its
# build:generator step runs Build-Generator.ps1, which needs JDK 11+ and Maven), producing
# the .tgz next to the package.json for sync_emitter.py to pick up.
- task: PowerShell@2
retryCountOnTaskFailure: 1
condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none'))
displayName: 'Build typespec-java dev package'
inputs:
pwsh: true
targetType: 'inline'
script: |
corepack enable
pnpm install
pnpm turbo run build --filter "@azure-tools/typespec-java^..."
./packages/typespec-java/Build-TypeSpec.ps1
workingDirectory: $(TypeSpecAzureDirectory)

- script: |
npm install -g @azure-tools/typespec-client-generator-cli
displayName: 'Install tsp-client'

# Dev route only: the built emitter's version drives the PR title. For the published route
# PackageVersion is already the given EmitterVersion.
- task: PowerShell@2
displayName: 'Get Package Version'
condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none'))
inputs:
pwsh: true
targetType: 'inline'
script: |
$PACKAGE_VERSION = node -p -e "require('./packages/typespec-java/package.json').version"
Write-Host("##vso[task.setvariable variable=PackageVersion]$PACKAGE_VERSION")
workingDirectory: $(TypeSpecAzureDirectory)

- script: |
python3 ./eng/pipelines/scripts/sync_emitter.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.EmitterVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json
displayName: 'Generate SDK'
workingDirectory: $(Build.SourcesDirectory)

- template: /eng/common/pipelines/templates/steps/create-pull-request.yml
parameters:
WorkingDirectory: $(Build.SourcesDirectory)
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
RepoName: azure-sdk-for-java
BaseBranchName: 'refs/heads/main'
PRBranchName: typespec-java-generation-$(Build.BuildId)
CommitMsg: '[Automation] Generate SDK based on TypeSpec $(PackageVersion)$(PullRequestTitleSuffix)'
PRTitle: '[Automation] Generate SDK based on TypeSpec $(PackageVersion)$(PullRequestTitleSuffix)'
PRLabels: 'DPG'
OpenAsDraft: 'true'
Loading