Skip to content

Commit 19bf7a1

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/azure-ai-projects-1dp
2 parents 41cb1e0 + ce204aa commit 19bf7a1

File tree

1,168 files changed

+31595
-240013
lines changed

Some content is hidden

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

1,168 files changed

+31595
-240013
lines changed

Diff for: .github/CODEOWNERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299

300300
# ServiceLabel: %Maps
301301
# PRLabel: %Maps
302-
/sdk/maps/ @dubiety
302+
/sdk/maps/ @dubiety @andykao1213
303303

304304
# ServiceLabel: %Mixed Reality
305305
# PRLabel: %Mixed Reality
@@ -318,7 +318,7 @@
318318

319319
# ServiceLabel: %Purview
320320
# PRLabel: %Purview
321-
/sdk/purview/ @saxenarahulMs
321+
/sdk/purview/ @saxenarahulMs @adyabansal-ms
322322

323323
# ServiceLabel: %Recovery Services
324324
# ServiceOwners: @Daya-Patil @Sharmistha-Rai

Diff for: eng/apiview_reqs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ tomli==2.2.1
1414
tomlkit==0.13.2
1515
typing_extensions==4.12.2
1616
wrapt==1.17.2
17-
apiview-stub-generator==0.3.17
17+
apiview-stub-generator==0.3.18

Diff for: eng/common/TestResources/New-TestResources.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ $serialized
657657
'`@ | ConvertFrom-Json -AsHashtable
658658
# Set global variables that aren't always passed as parameters
659659
`$ResourceGroupName = `$parameters.ResourceGroupName
660+
`$AdditionalParameters = `$parameters.AdditionalParameters
660661
`$DeploymentOutputs = `$parameters.DeploymentOutputs
661662
$postDeploymentScript `@parameters
662663
"@

Diff for: eng/common/pipelines/templates/archetype-typespec-emitter.yml

+53-31
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ parameters:
6767
type: object
6868
default: []
6969

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
77+
type: string
78+
7079
extends:
7180
template: /eng/pipelines/templates/stages/1es-redirect.yml
7281
parameters:
@@ -94,7 +103,17 @@ extends:
94103
inputs:
95104
pwsh: true
96105
filePath: $(Build.SourcesDirectory)/eng/scripts/typespec/Initialize-WorkingDirectory.ps1
97-
arguments: -UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
106+
${{ if parameters.BuildPrereleaseVersion }}:
107+
arguments: >
108+
-PrereleaseSuffix "-alpha.$(Build.BuildNumber)"
109+
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
110+
-UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
111+
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
112+
${{ else }}:
113+
arguments: >
114+
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
115+
-UseTypeSpecNext:$${{ parameters.UseTypeSpecNext }}
116+
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
98117
99118
- task: PowerShell@2
100119
displayName: 'Run build script'
@@ -103,10 +122,9 @@ extends:
103122
pwsh: true
104123
filePath: $(Build.SourcesDirectory)/eng/scripts/typespec/Build-Emitter.ps1
105124
arguments: >
106-
-BuildNumber "$(Build.BuildNumber)"
107-
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
125+
-OutputDirectory "$(Build.ArtifactStagingDirectory)/packages"
108126
-TargetNpmJsFeed:$${{ parameters.PublishPublic }}
109-
-Prerelease:$${{ parameters.BuildPrereleaseVersion }}
127+
-EmitterPackagePath:${{ parameters.EmitterPackagePath }}
110128
111129
- pwsh: |
112130
$sourceBranch = '$(Build.SourceBranch)'
@@ -134,7 +152,7 @@ extends:
134152
# Publish stage
135153
# Responsible for publishing the packages in `build_artifacts/packages` and producing `emitter-package-lock.json`
136154
# Produces the artifact `publish_artifacts` which contains the following:
137-
# emitter-package.json: Created using the package json from the build step.
155+
# emitter-package.json: Created using the package json from the build step.
138156
# emitter-package-lock.json: Created by calling `npm install` using `emitter-package.json`
139157
- ${{ if parameters.ShouldPublish }}:
140158
- stage: Publish
@@ -189,26 +207,30 @@ extends:
189207
ServiceEndpointUrl: https://api.esrp.microsoft.com
190208
MainPublisher: ESRPRELPACMANTEST
191209

192-
- task: PowerShell@2
193-
displayName: Create emitter-package.json
194-
inputs:
195-
pwsh: true
196-
filePath: ./eng/common/scripts/typespec/New-EmitterPackageJson.ps1
197-
arguments: >
198-
-PackageJsonPath '$(buildArtifactsPath)/lock-files/package.json'
199-
-OverridesPath '$(buildArtifactsPath)/overrides.json'
200-
-OutputDirectory '$(Build.ArtifactStagingDirectory)'
201-
workingDirectory: $(Build.SourcesDirectory)
210+
- pwsh: |
211+
npm install -g @azure-tools/typespec-client-generator-cli@latest
212+
displayName: Install tsp-client
202213
203-
- task: PowerShell@2
204-
displayName: Create emitter-package-lock.json
205-
inputs:
206-
pwsh: true
207-
filePath: ./eng/common/scripts/typespec/New-EmitterPackageLock.ps1
208-
arguments: >
209-
-EmitterPackageJsonPath '$(Build.ArtifactStagingDirectory)/emitter-package.json'
210-
-OutputDirectory '$(Build.ArtifactStagingDirectory)'
211-
workingDirectory: $(Build.SourcesDirectory)
214+
- pwsh: |
215+
Write-Host "Overrides location: $(buildArtifactsPath)/packages/overrides.json"
216+
217+
if (Test-Path -Path '$(buildArtifactsPath)/packages/overrides.json') {
218+
Write-Host "Using overrides.json to generate emitter-package.json"
219+
tsp-client generate-config-files `
220+
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
221+
--output-dir '$(Build.SourcesDirectory)' `
222+
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}' `
223+
--overrides '$(buildArtifactsPath)/packages/overrides.json'
224+
} else {
225+
Write-Host "No overrides.json found. Running tsp-client without overrides."
226+
227+
tsp-client generate-config-files `
228+
--package-json '$(buildArtifactsPath)/lock-files/package.json' `
229+
--output-dir '$(Build.SourcesDirectory)' `
230+
--emitter-package-json-path '${{ parameters.EmitterPackageJsonOutputPath }}'
231+
}
232+
displayName: Generate emitter-package.json and emitter-package-lock files
233+
workingDirectory: $(Build.SourcesDirectory)
212234
213235
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
214236
parameters:
@@ -240,11 +262,8 @@ extends:
240262
displayName: Download pipeline artifacts
241263

242264
- pwsh: |
243-
Write-Host "Copying emitter-package.json to $(Build.SourcesDirectory)/eng"
244-
Copy-Item $(publishArtifactsPath)/emitter-package.json $(Build.SourcesDirectory)/eng/ -Force
245-
246-
Write-Host "Copying emitter-package-lock.json to $(Build.SourcesDirectory)/eng"
247-
Copy-Item $(publishArtifactsPath)/emitter-package-lock.json $(Build.SourcesDirectory)/eng/ -Force
265+
Write-Host "Copying *emitter-package*.json to $(Build.SourcesDirectory)/eng"
266+
Copy-Item $(publishArtifactsPath)/*emitter-package*.json $(Build.SourcesDirectory)/eng/ -Force
248267
displayName: Copy emitter-package json files
249268
250269
- ${{ parameters.InitializationSteps }}
@@ -291,7 +310,7 @@ extends:
291310
Paths:
292311
- "/*"
293312
- "!SessionRecords"
294-
313+
295314
- download: current
296315
displayName: Download pipeline artifacts
297316

@@ -432,7 +451,9 @@ extends:
432451
inputs:
433452
pwsh: true
434453
filePath: $(Build.SourcesDirectory)/eng/scripts/typespec/Initialize-WorkingDirectory.ps1
435-
arguments: -BuildArtifactsPath '$(buildArtifactsPath)'
454+
arguments: >
455+
-BuildArtifactsPath '$(buildArtifactsPath)/lock-files'
456+
-EmitterPackagePath: ${{ parameters.EmitterPackagePath }}
436457
437458
- task: PowerShell@2
438459
displayName: 'Run test script'
@@ -442,6 +463,7 @@ extends:
442463
arguments: >
443464
$(TestArguments)
444465
-OutputDirectory "$(Build.ArtifactStagingDirectory)"
466+
-EmitterPackagePath: ${{ parameters.EmitterPackagePath }}
445467
446468
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
447469
parameters:

Diff for: eng/common/scripts/Helpers/ApiView-Helpers.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,15 @@ function Set-ApiViewCommentForPR {
180180
$commentText += "APIView identified API level changes in this PR and created the following API reviews"
181181
$commentText += ""
182182

183+
$responseContent = $response.Content | ConvertFrom-Json
183184
if ($RepoName.StartsWith(("azure-sdk-for-"))) {
184-
$response | ForEach-Object {
185+
$responseContent | ForEach-Object {
185186
$commentText += "[$($_.packageName)]($($_.url))"
186187
}
187188
} else {
188189
$commentText += "| Language | API Review for Package |"
189190
$commentText += "|----------|---------|"
190-
$response | ForEach-Object {
191+
$responseContent | ForEach-Object {
191192
$commentText += "| $($_.language) | [$($_.packageName)]($($_.url)) |"
192193
}
193194
}

Diff for: eng/common/scripts/Package-Properties.ps1

+20-3
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,28 @@ class PackageProps {
115115
return $null
116116
}
117117

118-
[PSCustomObject]GetCIYmlForArtifact() {
118+
[System.IO.FileInfo[]]ResolveCIFolderPath() {
119119
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot ".." ".." "..")
120-
121120
$ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "sdk" $this.ServiceDirectory)
122-
$ciFiles = @(Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File)
121+
$ciFiles = @()
122+
123+
# if this path exists, then we should look in it for the ci.yml files and return nothing if nothing is found
124+
if (Test-Path $ciFolderPath){
125+
$ciFiles = @(Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File)
126+
}
127+
# if not, we should at least try to resolve the eng/ folder to fall back and see if that's where the path exists
128+
else {
129+
$ciFolderPath = Join-Path -Path $RepoRoot -ChildPath (Join-Path "eng" $this.ServiceDirectory)
130+
if (Test-Path $ciFolderPath) {
131+
$ciFiles = @(Get-ChildItem -Path $ciFolderPath -Filter "ci*.yml" -File)
132+
}
133+
}
134+
135+
return $ciFiles
136+
}
137+
138+
[PSCustomObject]GetCIYmlForArtifact() {
139+
$ciFiles = @($this.ResolveCIFolderPath())
123140
$ciArtifactResult = $null
124141
$soleCIYml = ($ciFiles.Count -eq 1)
125142

Diff for: eng/common/scripts/job-matrix/Create-JobMatrix.ps1

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ param (
1515
[Parameter(Mandatory=$False)][array] $Filters,
1616
[Parameter(Mandatory=$False)][array] $Replace,
1717
[Parameter(Mandatory=$False)][array] $NonSparseParameters,
18+
# Use for local generation/debugging when env: values are set in a matrix
19+
[Parameter(Mandatory=$False)][switch] $SkipEnvironmentVariables,
1820
[Parameter()][switch] $CI = ($null -ne $env:SYSTEM_TEAMPROJECTID)
1921
)
2022

@@ -34,7 +36,8 @@ $Filters = $Filters | Where-Object { $_ }
3436
-displayNameFilter $DisplayNameFilter `
3537
-filters $Filters `
3638
-replace $Replace `
37-
-nonSparseParameters $NonSparseParameters
39+
-nonSparseParameters $NonSparseParameters `
40+
-skipEnvironmentVariables:$SkipEnvironmentVariables
3841

3942
$serialized = SerializePipelineMatrix $matrix
4043

Diff for: eng/common/scripts/job-matrix/job-matrix-functions.ps1

+22-22
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ function GenerateMatrix(
101101
) {
102102
$result = ProcessImport $config.matrixParameters $selectFromMatrixType $nonSparseParameters $config.displayNamesLookup
103103

104-
$matrixParameters = $result.Matrix
105-
$importedMatrix = $result.ImportedMatrix
104+
$matrixParameters = $result.Matrix
105+
$importedMatrix = $result.ImportedMatrix
106106
$combinedDisplayNameLookup = $result.DisplayNamesLookup
107107

108108
if ($selectFromMatrixType -eq "sparse") {
@@ -148,7 +148,7 @@ function ProcessNonSparseParameters(
148148
$nonSparse = [MatrixParameter[]]@()
149149

150150
foreach ($param in $parameters) {
151-
if ($null -eq $param){
151+
if ($null -eq $param) {
152152
continue
153153
}
154154
if ($param.Name -in $nonSparseParameters) {
@@ -430,9 +430,9 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
430430
}
431431
if ((!$matrix -and !$importPath) -or !$importPath) {
432432
return [PSCustomObject]@{
433-
Matrix = $matrix
434-
ImportedMatrix = @()
435-
DisplayNamesLookup = $displayNamesLookup
433+
Matrix = $matrix
434+
ImportedMatrix = @()
435+
DisplayNamesLookup = $displayNamesLookup
436436
}
437437
}
438438

@@ -456,9 +456,9 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
456456
}
457457

458458
return [PSCustomObject]@{
459-
Matrix = $matrix ?? @()
460-
ImportedMatrix = $importedMatrix
461-
DisplayNamesLookup = $combinedDisplayNameLookup
459+
Matrix = $matrix ?? @()
460+
ImportedMatrix = $importedMatrix
461+
DisplayNamesLookup = $combinedDisplayNameLookup
462462
}
463463
}
464464

@@ -643,7 +643,7 @@ function InitializeMatrix {
643643
function GetMatrixDimensions([MatrixParameter[]]$parameters) {
644644
$dimensions = @()
645645
foreach ($param in $parameters) {
646-
if ($null -eq $param){
646+
if ($null -eq $param) {
647647
continue
648648
}
649649
$dimensions += $param.Length()
@@ -760,12 +760,12 @@ function Get4dMatrixIndex([int]$index, [Array]$dimensions) {
760760

761761
function GenerateMatrixForConfig {
762762
param (
763-
[Parameter(Mandatory = $true)][string] $ConfigPath,
764-
[Parameter(Mandatory = $true)][string] $Selection,
765-
[Parameter(Mandatory = $false)][string] $DisplayNameFilter,
766-
[Parameter(Mandatory = $false)][array] $Filters,
767-
[Parameter(Mandatory = $false)][array] $Replace,
768-
[Parameter(Mandatory = $false)][Array] $NonSparseParameters = @()
763+
[Parameter(Mandatory = $true)][string] $ConfigPath,
764+
[Parameter(Mandatory = $true)][string] $Selection,
765+
[Parameter(Mandatory = $false)][string] $DisplayNameFilter,
766+
[Parameter(Mandatory = $false)][array] $Filters,
767+
[Parameter(Mandatory = $false)][array] $Replace,
768+
[Parameter(Mandatory = $false)][Array] $NonSparseParameters = @()
769769
)
770770
$matrixFile = Join-Path $PSScriptRoot ".." ".." ".." ".." $ConfigPath
771771

@@ -776,12 +776,12 @@ function GenerateMatrixForConfig {
776776
$Filters = $Filters | Where-Object { $_ }
777777

778778
[array]$matrix = GenerateMatrix `
779-
-config $config `
780-
-selectFromMatrixType $Selection `
781-
-displayNameFilter $DisplayNameFilter `
782-
-filters $Filters `
783-
-replace $Replace `
784-
-nonSparseParameters $NonSparseParameters
779+
-config $config `
780+
-selectFromMatrixType $Selection `
781+
-displayNameFilter $DisplayNameFilter `
782+
-filters $Filters `
783+
-replace $Replace `
784+
-nonSparseParameters $NonSparseParameters
785785

786786
return , $matrix
787787
}

Diff for: eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1

+9-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ function Login([string]$subscription, [string]$tenant, [string]$clusterGroup, [s
4848
Write-Host "Logging in to subscription, cluster and container registry"
4949
az account show -s "$subscription" *> $null
5050
if ($LASTEXITCODE) {
51-
RunOrExitOnFailure az login --allow-no-subscriptions --tenant $tenant
51+
Run az login --allow-no-subscriptions --tenant $tenant
52+
if ($LASTEXITCODE) {
53+
throw "You do not have access to the TME subscription. Follow these steps to join the group: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/206/Subscription-and-Tenant-Usage?anchor=azure-sdk-test-resources-tme"
54+
}
55+
}
56+
57+
$subscriptions = (Run az account list -o json) | ConvertFrom-Json
58+
if ($subscriptions.Length -eq 0) {
59+
throw "You do not have access to the TME subscription. Follow these steps to join the group: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/206/Subscription-and-Tenant-Usage?anchor=azure-sdk-test-resources-tme"
5260
}
5361

5462
# Discover cluster name, only one cluster per group is expected

0 commit comments

Comments
 (0)