From c930b561003ba042b58c8249685fcbb1844020b5 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 15 Mar 2022 13:21:23 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 2913 (#3433) * archetype-sdk-tests-generate.yml now provides an opportunity for additional steps after the target has been cloned but before matrix generation is invoked Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> --- .../templates/jobs/archetype-sdk-tests-generate.yml | 5 +++++ eng/common/scripts/job-matrix/README.md | 5 +++++ 2 files changed, 10 insertions(+) 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