diff --git a/eng/common/pipelines/templates/jobs/generate-job-matrix.yml b/eng/common/pipelines/templates/jobs/generate-job-matrix.yml index d1db47b30b22..7cb3a785cea5 100644 --- a/eng/common/pipelines/templates/jobs/generate-job-matrix.yml +++ b/eng/common/pipelines/templates/jobs/generate-job-matrix.yml @@ -54,6 +54,9 @@ parameters: - name: PRMatrixIndirectFilters type: object default: [] +- name: PRMatrixSparseIndirect + type: boolean + default: true # Mappings to OS name required at template compile time by 1es pipeline templates - name: Pools type: object @@ -142,7 +145,8 @@ jobs: -Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}' ` -IndirectFilters '${{ join(''',''', parameters.PRMatrixIndirectFilters) }}' ` -Replace '${{ join(''',''', parameters.MatrixReplace) }}' ` - -PackagesPerPRJob ${{ parameters.PRJobBatchSize }} + -PackagesPerPRJob ${{ parameters.PRJobBatchSize }} ` + -SparseIndirect $${{ parameters.PRMatrixSparseIndirect }} displayName: Create ${{ pool.name }} PR Matrix name: vm_job_matrix_pr_${{ pool.name }} diff --git a/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 b/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 index a30ba45b8250..23bb513daf1e 100644 --- a/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 +++ b/eng/common/scripts/job-matrix/Create-PrJobMatrix.ps1 @@ -74,7 +74,7 @@ function QueuePop([ref]$queue) { function GeneratePRMatrixForBatch { param ( [Parameter(Mandatory = $true)][array] $Packages, - [Parameter(Mandatory = $true)][bool] $FullSparseMatrix + [Parameter(Mandatory = $false)][bool] $FullSparseMatrix = $false ) $OverallResult = @() @@ -159,7 +159,7 @@ function GeneratePRMatrixForBatch { } if ($batchSuffixNecessary) { - $outputItem["name"] = $outputItem["name"] + "$batchPrefix$batchCounter" + $outputItem["name"] = $outputItem["name"] + "$batchNamePrefix$batchCounter" } $OverallResult += $outputItem @@ -184,7 +184,7 @@ function GeneratePRMatrixForBatch { } if ($batchSuffixNecessary) { - $outputItem["name"] = $outputItem["name"] + "_ib$batchCounter" + $outputItem["name"] = $outputItem["name"] + "_$batchNamePrefix$batchCounter" } # now we need to take an item from the front of the matrix results, clone it, and add it to the back of the matrix results # we will add the cloned version to OverallResult