Skip to content

Commit a4e3144

Browse files
authored
Merge branch 'Azure:main' into oteleventgrid
2 parents d317202 + 9f587cb commit a4e3144

File tree

662 files changed

+38098
-5389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

662 files changed

+38098
-5389
lines changed

.github/CODEOWNERS

+5-1
Original file line numberDiff line numberDiff line change
@@ -1114,10 +1114,14 @@
11141114
# Add owners for package dependency changes
11151115
/eng/Packages.Data.props @JoshLove-msft @christothes @annelo-msft @KrzysztofCwalina @tg-msft @jsquire @m-nash @ArthurMa1978
11161116

1117+
# Add owners for emitter version changes
1118+
/eng/http-client-csharp-emitter-package.json @JoshLove-msft @m-nash @jorgerangel-msft @live1206 @ArcturusZhang @nisha-bhatia
1119+
/eng/http-client-csharp-emitter-package-lock.json @JoshLove-msft @m-nash @jorgerangel-msft @live1206 @ArcturusZhang @nisha-bhatia
1120+
11171121
# ######## Code Generation ########
11181122

11191123
#PRLabel: %CodeGen %Client
1120-
/eng/packages/http-client-csharp/ @JoshLove-msft @m-nash @jorgerangel-msft @live1206 @ArcturusZhang @jsquire
1124+
/eng/packages/http-client-csharp/ @JoshLove-msft @m-nash @jorgerangel-msft @live1206 @ArcturusZhang @jsquire @nisha-bhatia
11211125

11221126
#PRLabel: %CodeGen %Mgmt
11231127
/eng/packages/http-client-csharp-mgmt/ @JoshLove-msft @m-nash @jorgerangel-msft @live1206 @ArcturusZhang

.vscode/cspell.json

+6
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@
425425
"proto"
426426
]
427427
},
428+
{
429+
"filename": "**/sdk/containerregistry/**/*",
430+
"words": [
431+
"Abac"
432+
]
433+
},
428434
{
429435
"filename": "**/sdk/containerservice/**/*",
430436
"words": [

eng/Packages.Data.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
All should have PrivateAssets="All" set so they don't become package dependencies
276276
-->
277277
<ItemGroup>
278-
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20250410.1" PrivateAssets="All" />
278+
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20250416.1" PrivateAssets="All" />
279279
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20250310.1" PrivateAssets="All" />
280280
<PackageReference Update="coverlet.collector" Version="3.2.0" PrivateAssets="All" />
281281
<!-- Note: Upgrading the .NET SDK version needs to be synchronized with the autorest.csharp repository -->

eng/common/pipelines/templates/archetype-typespec-emitter.yml

+62-47
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,14 @@ parameters:
6767
type: object
6868
default: []
6969

70-
- name: EmitterPackageJsonPath
70+
# The path to the emitter package json file.
71+
- name: EmitterPackageJsonOutputPath
72+
type: string
73+
default: "eng/emitter-package.json"
74+
75+
# The relative path to the emitter package.
76+
- name: EmitterPackagePath
7177
type: string
72-
default: ""
7378

7479
extends:
7580
template: /eng/pipelines/templates/stages/1es-redirect.yml
@@ -93,24 +98,34 @@ extends:
9398

9499
- ${{ parameters.InitializationSteps }}
95100

101+
# Initialize-WorkingDirectory.ps1 is responsible for setting the emitterVersion output variable.
96102
- task: PowerShell@2
97103
displayName: 'Run initialize script'
104+
name: initialize
98105
inputs:
99106
pwsh: true
100107
filePath: $(Build.SourcesDirectory)/eng/scripts/typespec/Initialize-WorkingDirectory.ps1
101-
arguments: -UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
108+
${{ if parameters.BuildPrereleaseVersion }}:
109+
arguments: >
110+
-PrereleaseSuffix "-alpha.$(Build.BuildNumber)"
111+
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
112+
-UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
113+
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
114+
${{ else }}:
115+
arguments: >
116+
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
117+
-UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
118+
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
102119
103120
- task: PowerShell@2
104121
displayName: 'Run build script'
105-
name: ci_build
106122
inputs:
107123
pwsh: true
108124
filePath: $(Build.SourcesDirectory)/eng/scripts/typespec/Build-Emitter.ps1
109125
arguments: >
110-
-BuildNumber "$(Build.BuildNumber)"
111-
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
126+
-OutputDirectory "$(Build.ArtifactStagingDirectory)/packages"
112127
-TargetNpmJsFeed:$${{ parameters.PublishPublic }}
113-
-Prerelease:$${{ parameters.BuildPrereleaseVersion }}
128+
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
114129
115130
- pwsh: |
116131
$sourceBranch = '$(Build.SourceBranch)'
@@ -136,10 +151,7 @@ extends:
136151
artifactPath: $(Build.ArtifactStagingDirectory)
137152

138153
# Publish stage
139-
# Responsible for publishing the packages in `build_artifacts/packages` and producing `emitter-package-lock.json`
140-
# Produces the artifact `publish_artifacts` which contains the following:
141-
# emitter-package.json: Created using the package json from the build step.
142-
# emitter-package-lock.json: Created by calling `npm install` using `emitter-package.json`
154+
# Responsible for publishing the packages in `build_artifacts/packages`
143155
- ${{ if parameters.ShouldPublish }}:
144156
- stage: Publish
145157
dependsOn:
@@ -193,31 +205,6 @@ extends:
193205
ServiceEndpointUrl: https://api.esrp.microsoft.com
194206
MainPublisher: ESRPRELPACMANTEST
195207

196-
- pwsh: |
197-
npm install -g @azure-tools/typespec-client-generator-cli@latest
198-
displayName: Install tsp-client
199-
200-
- pwsh: |
201-
if (Test-Path -Path '$(buildArtifactsPath)/overrides.json') {
202-
Write-Host "Using overrides.json to generate emitter-package.json"
203-
tsp-client generate-config-files `
204-
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
205-
--output-dir '$(Build.ArtifactStagingDirectory)' `
206-
--emitter-package-json-path '${{ parameters.EmitterPackageJsonPath }}' `
207-
--overrides '$(buildArtifactsPath)/overrides.json'
208-
} else {
209-
tsp-client generate-config-files `
210-
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
211-
--output-dir '$(Build.ArtifactStagingDirectory)' `
212-
--emitter-package-json-path '${{ parameters.EmitterPackageJsonPath }}'
213-
}
214-
displayName: Generate emitter-package.json and emitter-package-lock files
215-
216-
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
217-
parameters:
218-
artifactName: publish_artifacts
219-
artifactPath: $(Build.ArtifactStagingDirectory)
220-
221208
# Regenerate stage
222209
# Responsible for regenerating the SDK code using the emitter package and the generation matrix.
223210
- ${{ if and(parameters.ShouldPublish, parameters.ShouldRegenerate) }}:
@@ -227,7 +214,7 @@ extends:
227214
- Publish
228215
variables:
229216
pullRequestTargetBranch: 'main'
230-
publishArtifactsPath: $(Pipeline.Workspace)/publish_artifacts
217+
buildArtifactsPath: $(Pipeline.Workspace)/build_artifacts
231218
branchName: $[stageDependencies.Build.Build.outputs['set_branch_name.branchName']]
232219
pool: ${{ parameters.Pool }}
233220
jobs:
@@ -243,12 +230,27 @@ extends:
243230
displayName: Download pipeline artifacts
244231

245232
- pwsh: |
246-
Write-Host "Copying emitter-package.json to $(Build.SourcesDirectory)/eng"
247-
Copy-Item $(publishArtifactsPath)/emitter-package.json $(Build.SourcesDirectory)/eng/ -Force
233+
npm install -g @azure-tools/typespec-client-generator-cli@latest
234+
displayName: Install tsp-client
248235
249-
Write-Host "Copying emitter-package-lock.json to $(Build.SourcesDirectory)/eng"
250-
Copy-Item $(publishArtifactsPath)/emitter-package-lock.json $(Build.SourcesDirectory)/eng/ -Force
251-
displayName: Copy emitter-package json files
236+
- pwsh: |
237+
Write-Host "Overrides location: $(buildArtifactsPath)/packages/overrides.json"
238+
239+
if (Test-Path -Path '$(buildArtifactsPath)/packages/overrides.json') {
240+
Write-Host "Using overrides.json to generate emitter-package.json"
241+
tsp-client generate-config-files `
242+
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
243+
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}' `
244+
--overrides '$(buildArtifactsPath)/packages/overrides.json'
245+
} else {
246+
Write-Host "No overrides.json found. Running tsp-client without overrides."
247+
248+
tsp-client generate-config-files `
249+
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
250+
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}'
251+
}
252+
displayName: Generate emitter-package.json and emitter-package-lock files
253+
workingDirectory: $(Build.SourcesDirectory)
252254
253255
- ${{ parameters.InitializationSteps }}
254256

@@ -294,7 +296,7 @@ extends:
294296
Paths:
295297
- "/*"
296298
- "!SessionRecords"
297-
299+
298300
- download: current
299301
displayName: Download pipeline artifacts
300302

@@ -325,7 +327,7 @@ extends:
325327
- Generate
326328
variables:
327329
generateJobResult: $[dependencies.Generate.result]
328-
emitterVersion: $[stageDependencies.Build.Build.outputs['ci_build.emitterVersion']]
330+
emitterVersion: $[stageDependencies.Build.Build.outputs['initialize.emitterVersion']]
329331
steps:
330332
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
331333

@@ -385,6 +387,16 @@ extends:
385387
} else {
386388
Write-Error "Build.Repository.Name not in the expected {Owner}/{Name} format"
387389
}
390+
391+
$openAsDraft = -not ($reason -eq 'IndividualCI' -and $sourceBranch -eq 'refs/heads/main')
392+
Write-Host "Setting OpenAsDraftBool = $openAsDraft"
393+
Write-Host "##vso[task.setvariable variable=OpenAsDraft]$openAsDraft"
394+
if ($openAsDraft) {
395+
Write-Host "##vso[task.setvariable variable=PRLabels]Do Not Merge"
396+
} else {
397+
Write-Host "##vso[task.setvariable variable=PRLabels]"
398+
}
399+
388400
displayName: Get PR title and body
389401
390402
- task: PowerShell@2
@@ -401,8 +413,8 @@ extends:
401413
-AuthToken '$(azuresdk-github-pat)'
402414
-PRTitle '$(PullRequestTitle)'
403415
-PRBody '$(PullRequestBody)'
404-
-OpenAsDraft $true
405-
-PRLabels 'Do Not Merge'
416+
-OpenAsDraft $$(OpenAsDraft)
417+
-PRLabels '$(PRLabels)'
406418
workingDirectory: $(Build.SourcesDirectory)
407419

408420
# Test stage
@@ -435,7 +447,9 @@ extends:
435447
inputs:
436448
pwsh: true
437449
filePath: $(Build.SourcesDirectory)/eng/scripts/typespec/Initialize-WorkingDirectory.ps1
438-
arguments: -BuildArtifactsPath '$(buildArtifactsPath)'
450+
arguments: >
451+
-BuildArtifactsPath '$(buildArtifactsPath)/lock-files'
452+
-EmitterPackagePath: ${{ parameters.EmitterPackagePath }}
439453
440454
- task: PowerShell@2
441455
displayName: 'Run test script'
@@ -445,6 +459,7 @@ extends:
445459
arguments: >
446460
$(TestArguments)
447461
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
462+
-EmitterPackagePath: ${{ parameters.EmitterPackagePath }}
448463
449464
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
450465
parameters:

eng/common/pipelines/templates/jobs/prepare-pipelines.yml

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ jobs:
110110
$generateUnifiedWeekly = 'true'
111111
}
112112
"net" {
113+
$generatePublicCIPipeline = 'false'
113114
$internalVariableGroups = '$(AzureSDK_Nuget_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)'
114115
$testVariableGroups = '$(Secrets_for_Resource_Provisioner)'
115116
$internalServiceConnections += ' "Azure SDK Symbols Publishing" Nuget.org'

eng/emitter-package-lock.json

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/emitter-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-tools/typespec-csharp": "0.2.0-beta.20250410.1"
4+
"@azure-tools/typespec-csharp": "0.2.0-beta.20250416.1"
55
},
66
"devDependencies": {
77
"@azure-tools/typespec-autorest": "0.54.0",

0 commit comments

Comments
 (0)