From c41ecca21c5b2667486e1e66941756ba91b2bcab Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:20:30 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 9294 (#31372) Co-authored-by: Scott Beddall --- eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 b/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 index 5129d757f99c..03fc6422e3aa 100644 --- a/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 +++ b/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 @@ -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 } } }