Skip to content

Commit a5474cf

Browse files
azure-sdkscbedd
andauthored
Sync eng/common directory with azure-sdk-tools for PR 9294 (#38251)
Co-authored-by: Scott Beddall <[email protected]>
1 parent 60e5527 commit a5474cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,15 @@ foreach ($matrixBatchKey in $matrixBatchesByConfig.Keys) {
9393
# we only need to modify the generated job name if there is more than one matrix config or batch in the matrix
9494
$matrixSuffixNecessary = $matrixConfigs.Count -gt 1
9595
$batchSuffixNecessary = $packageBatches.Length -gt 1
96+
$batchCounter = 1
9697

9798
foreach ($batch in $packageBatches) {
9899
# to understand this iteration, one must understand that the matrix is a list of hashtables, each with a couple keys:
99100
# [
100101
# { "name": "jobname", "parameters": { matrixSetting1: matrixValue1, ...} },
101102
# ]
102103
foreach ($matrixOutputItem in $matrixResults) {
103-
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join "-"
104+
$namesForBatch = ($batch | ForEach-Object { $_.ArtifactName }) -join ","
104105
# we just need to iterate across them, grab the parameters hashtable, and add the new key
105106
# if there is more than one batch, we will need to add a suffix including the batch name to the job name
106107
$matrixOutputItem["parameters"]["$PRMatrixSetting"] = $namesForBatch
@@ -110,11 +111,12 @@ foreach ($matrixBatchKey in $matrixBatchesByConfig.Keys) {
110111
}
111112

112113
if ($batchSuffixNecessary) {
113-
$matrixOutputItem["name"] = $matrixOutputItem["name"] + $namesForBatch
114+
$matrixOutputItem["name"] = $matrixOutputItem["name"] + "b$batchCounter"
114115
}
115116

116117
$OverallResult += $matrixOutputItem
117118
}
119+
$batchCounter += 1
118120
}
119121
}
120122
}

0 commit comments

Comments
 (0)