diff --git a/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 b/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 index 27dde5430ec..d93872328dd 100644 --- a/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 +++ b/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 @@ -144,6 +144,16 @@ function GeneratePRMatrixForBatch { } } + if ($matrixConfig.PSObject.Properties['PRBatching']) { + # if we are doing a PR Batch, we need to just add the matrix items directly to the OverallResult + # as the users have explicitly disabled PR batching for this matrix. + if (!$matrixConfig.PRBatching) { + Write-Host "The matrix config $($matrixConfig.Path) with name $($matrixConfig.Name) has PRBatch set to false, the matrix members will be directly added without batching by $PRMatrixSetting." + $OverallResult += $matrixResults + 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