diff --git a/eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml b/eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml index 4a6ab48ca..7d38fa8d1 100644 --- a/eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml +++ b/eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml @@ -36,6 +36,9 @@ parameters: - name: GenerateJobName type: string default: 'generate_job_matrix' +- name: PreGenerationSteps + type: stepList + default: [] jobs: - job: ${{ parameters.GenerateJobName }} @@ -58,6 +61,8 @@ jobs: Paths: - "sdk/${{ parameters.AdditionalParameters.ServiceDirectory }}" + - ${{ parameters.PreGenerationSteps }} + - ${{ each config in parameters.MatrixConfigs }}: - ${{ if eq(config.GenerateVMJobs, 'true') }}: - task: Powershell@2 diff --git a/eng/common/scripts/job-matrix/README.md b/eng/common/scripts/job-matrix/README.md index f3f54b6f4..d46efdd42 100644 --- a/eng/common/scripts/job-matrix/README.md +++ b/eng/common/scripts/job-matrix/README.md @@ -56,8 +56,13 @@ jobs: Cloud: Public MatrixFilters: [] MatrixReplace: [] + PreGenerationSteps: [] ``` +### A note regarding PreGenerationSteps + +The generation template laid out above runs as its own job. A limitation of this method is that it disallows any runtime matrix customization due to the fact that an individual job clones the targeted build SHA. The stepList `PreGenerationSteps` allows users to update matrix json however they like prior to actually invoking the matrix generation. Injected steps are run after the repository checkout, but before any matrix generation is invoked. + ## Matrix config file syntax Matrix parameters can either be a list of strings, or a set of grouped strings (represented as a hash). The latter parameter