Sync eng/common directory with azure-sdk-tools for PR 9294 (#23683)

Co-authored-by: Scott Beddall <scbedd@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-10-31 16:19:48 -07:00 коммит произвёл GitHub
Родитель 12965bcb1b
Коммит b3920164ce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -93,6 +93,7 @@ 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:
@ -100,7 +101,7 @@ foreach ($matrixBatchKey in $matrixBatchesByConfig.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
@ -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
}
}
}