Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into implement-mgmt-resource
Browse files Browse the repository at this point in the history
  • Loading branch information
live1206 committed Feb 18, 2025
2 parents bb92673 + b2be5b4 commit af9bd9c
Show file tree
Hide file tree
Showing 510 changed files with 44,468 additions and 2,673 deletions.
10 changes: 8 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,12 @@
# ServiceLabel: %Large Instance %Mgmt
# ServiceOwners: @8Gitbrix

# PRLabel: %Monitor
/sdk/monitor/Azure.ResourceManager.Monitor/ @thomasp98296

# ServiceLabel: %Monitor
# ServiceOwners: @thomasp98296

# PRLabel: %Neon Postgres
/sdk/neonpostgres/Azure.ResourceManager.*/ @archerzz @ArcturusZhang @ArthurMa1978

Expand All @@ -1046,10 +1052,10 @@
# ServiceOwners: @vipray-ms

# PRLabel: %Nginx
/sdk/nginx/Azure.ResourceManager.*/ @jamesfan1 @bangbingsyb @spencerofwiti
/sdk/nginx/Azure.ResourceManager.*/ @jamesfan1 @bangbingsyb @spencerofwiti @amwaleh @briantkim93

# ServiceLabel: %Nginx %Mgmt
# ServiceOwners: @jamesfan1 @bangbingsyb @spencerofwiti
# ServiceOwners: @jamesfan1 @bangbingsyb @spencerofwiti @amwaleh @briantkim93

# PRLabel: %Operator Nexus - Network Cloud
/sdk/networkcloud/Azure.ResourceManager.*/ @Azure/azure-sdk-write-networkcloud
Expand Down
8 changes: 4 additions & 4 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<PackageReference Update="Azure.Core.Expressions.DataFactory" Version="1.0.0" />
<PackageReference Update="Azure.Data.SchemaRegistry" Version="1.2.0" />
<PackageReference Update="Azure.Data.Tables" Version="12.8.0" />
<PackageReference Update="Azure.Messaging.EventHubs" Version="5.11.5" />
<PackageReference Update="Azure.Messaging.EventHubs" Version="5.11.6" />
<PackageReference Update="Azure.Messaging.EventGrid" Version="4.21.0" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.18.2" />
<PackageReference Update="Azure.Messaging.WebPubSub" Version="1.4.0" />
Expand All @@ -141,7 +141,7 @@
<PackageReference Update="Azure.ResourceManager.Batch" Version="1.4.0" />
<PackageReference Update="Azure.ResourceManager.CognitiveServices" Version="1.3.3" />
<PackageReference Update="Azure.ResourceManager.CosmosDB" Version="1.4.0-beta.9" />
<PackageReference Update="Azure.ResourceManager.EventHubs" Version="1.1.0-beta.8" />
<PackageReference Update="Azure.ResourceManager.EventHubs" Version="1.2.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.KeyVault" Version="1.2.3" />
<PackageReference Update="Azure.ResourceManager.ManagedServiceIdentities" Version="1.2.3" />
<PackageReference Update="Azure.ResourceManager.OperationalInsights" Version="1.2.2" />
Expand Down Expand Up @@ -247,7 +247,7 @@
All should have PrivateAssets="All" set so they don't become package dependencies
-->
<ItemGroup>
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20250206.1" PrivateAssets="All" />
<PackageReference Update="Microsoft.Azure.AutoRest.CSharp" Version="3.0.0-beta.20250216.1" PrivateAssets="All" />
<PackageReference Update="Azure.ClientSdk.Analyzers" Version="0.1.1-dev.20240813.2" PrivateAssets="All" />
<PackageReference Update="coverlet.collector" Version="3.2.0" PrivateAssets="All" />
<PackageReference Update="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" PrivateAssets="All" />
Expand Down Expand Up @@ -275,7 +275,7 @@
<PackageReference Update="Azure.ResourceManager" Version="1.13.0" />
<PackageReference Update="Azure.Identity" Version="1.13.1" />
<PackageReference Update="Azure.Messaging.EventGrid" Version="4.17.0" />
<PackageReference Update="Azure.Messaging.EventHubs.Processor" Version="5.11.3" />
<PackageReference Update="Azure.Messaging.EventHubs.Processor" Version="5.11.6" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.18.2" />
<PackageReference Update="Azure.ResourceManager.Compute" Version="1.7.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.CognitiveServices" Version="1.3.0" />
Expand Down
Empty file modified eng/common/TestResources/New-TestResources.ps1
100644 → 100755
Empty file.
Empty file modified eng/common/TestResources/Remove-TestResources.ps1
100644 → 100755
Empty file.
Empty file modified eng/common/TestResources/Update-TestResources.ps1
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ steps:
arguments: >
-ServiceDirectory '${{parameters.ServiceDirectory}}'
-OutDirectory '${{ parameters.PackageInfoDirectory }}'
-AddDevVersion:($env:SetDevVersion -eq 'true')
-AddDevVersion:($env:SETDEVVERSION -eq 'true')
pwsh: true
10 changes: 10 additions & 0 deletions eng/common/scripts/Generate-PR-Diff.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,23 @@ $deletedFiles = Get-ChangedFiles -DiffPath $TargetPath -DiffFilterType "D"
if ($changedFiles) {
$changedServices = Get-ChangedServices -ChangedFiles $changedFiles
}
else {
# ensure we default this to an empty array if not set
$changedFiles = @()
}

# ExcludePaths is an object array with the default of [] which evaluates to null.
# If the value is null, set it to empty list to ensure that the empty list is
# stored in the json
if (-not $ExcludePaths) {
$ExcludePaths = @()
}
if (-not $deletedFiles) {
$deletedFiles = @()
}
if (-not $changedServices) {
$changedServices = @()
}
$result = [PSCustomObject]@{
"ChangedFiles" = $changedFiles
"ChangedServices" = $changedServices
Expand Down
168 changes: 87 additions & 81 deletions eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -94,110 +94,116 @@ function GeneratePRMatrixForBatch {
$matrixBatchesByConfig = Group-ByObjectKey $Packages "CIMatrixConfigs"

foreach ($matrixBatchKey in $matrixBatchesByConfig.Keys) {
# recall that while we have grouped the package info by the matrix config object, each package still has knowledge about
# every other matrix that it belongs to.
# so we actually need to get a valid matrix config object from the first package in the batch, but we need to be certain
# that the matrix config object we get is the SAME ONE that we are iterating through
$matrixBatch = $matrixBatchesByConfig[$matrixBatchKey]
$matrixConfigs = $matrixBatch | Select-Object -First 1 -ExpandProperty CIMatrixConfigs

$allPossibleMatrixConfigsForFirstPackage = $matrixBatch | Select-Object -First 1 -ExpandProperty CIMatrixConfigs
$matrixConfig = $allPossibleMatrixConfigsForFirstPackage | Where-Object { (Get-ObjectKey $_) -eq $matrixBatchKey }
$matrixResults = @()
foreach ($matrixConfig in $matrixConfigs) {
Write-Host "Generating config for $($matrixConfig.Path)"
$nonSparse = $matrixConfig.PSObject.Properties['NonSparseParameters'] ? $matrixConfig.NonSparseParameters : @()

$matrixResults = @()
if ($directBatch) {
$matrixResults = GenerateMatrixForConfig `
-ConfigPath $matrixConfig.Path `
-Selection $matrixConfig.Selection `
-DisplayNameFilter $DisplayNameFilter `
-Filters $Filters `
-Replace $Replace `
-NonSparseParameters $nonSparse

if ($matrixResults) {
Write-Host "We have the following direct matrix results: "
Write-Host ($matrixResults | Out-String)
}

if (!$matrixConfig) {
Write-Error "Unable to find matrix config for $matrixBatchKey. Check the package properties for the package $($matrixBatch[0].ArtifactName)."
exit 1
}

Write-Host "Generating config for $($matrixConfig.Path)"
$nonSparse = $matrixConfig.PSObject.Properties['NonSparseParameters'] ? $matrixConfig.NonSparseParameters : @()

if ($directBatch) {
$matrixResults = GenerateMatrixForConfig `
-ConfigPath $matrixConfig.Path `
-Selection $matrixConfig.Selection `
-DisplayNameFilter $DisplayNameFilter `
-Filters $Filters `
-Replace $Replace `
-NonSparseParameters $nonSparse

if ($matrixResults) {
Write-Host "We have the following direct matrix results: "
Write-Host ($matrixResults | Out-String)
}
}
else {
$matrixResults = GenerateMatrixForConfig `
-ConfigPath $matrixConfig.Path `
-Selection $matrixConfig.Selection `
-DisplayNameFilter $DisplayNameFilter `
-Filters ($Filters + $IndirectFilters) `
-Replace $Replace `
-NonSparseParameters $nonSparse

if ($matrixResults) {
Write-Host "We have the following indirect matrix results: "
Write-Host ($matrixResults | Out-String)
}
else {
$matrixResults = GenerateMatrixForConfig `
-ConfigPath $matrixConfig.Path `
-Selection $matrixConfig.Selection `
-DisplayNameFilter $DisplayNameFilter `
-Filters ($Filters + $IndirectFilters) `
-Replace $Replace `
-NonSparseParameters $nonSparse

if ($matrixResults) {
Write-Host "We have the following indirect matrix results: "
Write-Host ($matrixResults | Out-String)
}
else {
Write-Host "No indirect matrix results found for $($matrixConfig.Path)"
continue
}
Write-Host "No indirect matrix results found for $($matrixConfig.Path)"
continue
}
}

$packageBatches = Split-ArrayIntoBatches -InputArray $matrixBatch -BatchSize $BATCHSIZE

# we only need to modify the generated job name if there is more than one matrix config + batch
$matrixSuffixNecessary = $matrixBatchesByConfig.Keys.Count -gt 1

# if we are doing direct packages (or a full indirect matrix), we need to walk the batches and duplicate the matrix config for each batch, fully assigning
# the each batch's packages to the matrix config. This will generate a _non-sparse_ matrix for the incoming packages
if ($directBatch -or $FullSparseMatrix) {
$batchSuffixNecessary = $packageBatches.Length -gt $($directBatch ? 1 : 0)
$batchCounter = 1

foreach ($batch in $packageBatches) {
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join ","

foreach ($matrixOutputItem in $matrixResults) {
# we need to clone this, as each item is an object with possible children
$outputItem = $matrixOutputItem | ConvertTo-Json -Depth 100 | ConvertFrom-Json -AsHashtable
# we just need to iterate across them, grab the parameters hashtable, and add the new key
# if there is more than one batch, we will need to add a suffix including the batch name to the job name
$outputItem["parameters"]["$PRMatrixSetting"] = $namesForBatch
$packageBatches = Split-ArrayIntoBatches -InputArray $matrixBatch -BatchSize $BATCHSIZE

if ($matrixSuffixNecessary) {
$outputItem["name"] = $outputItem["name"] + "_" + $matrixConfig.Name
}
# we only need to modify the generated job name if there is more than one matrix config + batch
$matrixSuffixNecessary = $matrixBatchesByConfig.Keys.Count -gt 1

if ($batchSuffixNecessary) {
$outputItem["name"] = $outputItem["name"] + "$batchNamePrefix$batchCounter"
}
# if we are doing direct packages (or a full indirect matrix), we need to walk the batches and duplicate the matrix config for each batch, fully assigning
# the each batch's packages to the matrix config. This will generate a _non-sparse_ matrix for the incoming packages
if ($directBatch -or $FullSparseMatrix) {
$batchSuffixNecessary = $packageBatches.Length -gt $($directBatch ? 1 : 0)
$batchCounter = 1

$OverallResult += $outputItem
}
$batchCounter += 1
}
}
# in the case of indirect packages, instead of walking the batches and duplicating their matrix config entirely,
# we instead will walk each each matrix, create a parameter named for the PRMatrixSetting, and add the targeted packages
# as an array. This will generate a _sparse_ matrix for for whatever the incoming packages are
else {
$batchSuffixNecessary = $packageBatches.Length -gt 0
$batchCounter = 1
foreach ($batch in $packageBatches) {
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join ","
$outputItem = QueuePop -queue ([ref]$matrixResults)
foreach ($batch in $packageBatches) {
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join ","

foreach ($matrixOutputItem in $matrixResults) {
# we need to clone this, as each item is an object with possible children
$outputItem = $matrixOutputItem | ConvertTo-Json -Depth 100 | ConvertFrom-Json -AsHashtable
# we just need to iterate across them, grab the parameters hashtable, and add the new key
# if there is more than one batch, we will need to add a suffix including the batch name to the job name
$outputItem["parameters"]["$PRMatrixSetting"] = $namesForBatch

if ($matrixSuffixNecessary) {
$outputItem["name"] = $outputItem["name"] + "_" + $matrixConfig.Name
}

if ($batchSuffixNecessary) {
$outputItem["name"] = $outputItem["name"] + "_$batchNamePrefix$batchCounter"
$outputItem["name"] = $outputItem["name"] + "$batchNamePrefix$batchCounter"
}
# now we need to take an item from the front of the matrix results, clone it, and add it to the back of the matrix results
# we will add the cloned version to OverallResult

$OverallResult += $outputItem
$batchCounter += 1
}
$batchCounter += 1
}
}
}
# in the case of indirect packages, instead of walking the batches and duplicating their matrix config entirely,
# we instead will walk each each matrix, create a parameter named for the PRMatrixSetting, and add the targeted packages
# as an array. This will generate a _sparse_ matrix for for whatever the incoming packages are
else {
$batchSuffixNecessary = $packageBatches.Length -gt 0
$batchCounter = 1
foreach ($batch in $packageBatches) {
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join ","
$outputItem = QueuePop -queue ([ref]$matrixResults)

$outputItem["parameters"]["$PRMatrixSetting"] = $namesForBatch

if ($matrixSuffixNecessary) {
$outputItem["name"] = $outputItem["name"] + "_" + $matrixConfig.Name
}

if ($batchSuffixNecessary) {
$outputItem["name"] = $outputItem["name"] + "_$batchNamePrefix$batchCounter"
}
# now we need to take an item from the front of the matrix results, clone it, and add it to the back of the matrix results
# we will add the cloned version to OverallResult
$OverallResult += $outputItem
$batchCounter += 1
}
}
}

return ,$OverallResult
}
Expand Down
Loading

0 comments on commit af9bd9c

Please sign in to comment.