Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 9294 #2960

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,15 @@ foreach ($matrixBatchKey in $matrixBatchesByConfig.Keys) {
# we only need to modify the generated job name if there is more than one matrix config or batch in the matrix
$matrixSuffixNecessary = $matrixConfigs.Count -gt 1
$batchSuffixNecessary = $packageBatches.Length -gt 1
$batchCounter = 1

foreach ($batch in $packageBatches) {
# to understand this iteration, one must understand that the matrix is a list of hashtables, each with a couple keys:
# [
# { "name": "jobname", "parameters": { matrixSetting1: matrixValue1, ...} },
# ]
foreach ($matrixOutputItem in $matrixResults) {
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join "-"
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join ","
# 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
$matrixOutputItem["parameters"]["$PRMatrixSetting"] = $namesForBatch
Expand All @@ -110,11 +111,12 @@ foreach ($matrixBatchKey in $matrixBatchesByConfig.Keys) {
}

if ($batchSuffixNecessary) {
$matrixOutputItem["name"] = $matrixOutputItem["name"] + $namesForBatch
$matrixOutputItem["name"] = $matrixOutputItem["name"] + "b$batchCounter"
}

$OverallResult += $matrixOutputItem
}
$batchCounter += 1
}
}
}
Expand Down
Loading