From 9d11880e21404d4b71257fb2edec8ba8e76312a9 Mon Sep 17 00:00:00 2001 From: Joey Vagedes Date: Fri, 13 Sep 2024 14:56:30 -0700 Subject: [PATCH] Steps/BuildPlatform: Add toggle for stuart_pr_eval (#368) Adds a True / False parameter to the BuildPlatform step to allow disabling PR evaluation, similar to that of Steps/PrGate.yml. Default value is True to match current behavior. --- Steps/BuildPlatform.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Steps/BuildPlatform.yml b/Steps/BuildPlatform.yml index 979c1e39..bc82041c 100644 --- a/Steps/BuildPlatform.yml +++ b/Steps/BuildPlatform.yml @@ -22,6 +22,10 @@ parameters: displayName: Build BaseTools type: boolean default: false +- name: do_pr_eval + displayName: Perform Stuart PR Evaluation + type: boolean + default: true - name: build_file displayName: Build File type: string @@ -88,16 +92,17 @@ steps: - bash: echo "##vso[task.setvariable variable=pkg_count]${{ 1 }}" # trim the package list if this is a PR -- powershell: - $TargetBranch = "$(System.PullRequest.targetBranch)".replace('refs/heads/', ''); - Write-Host "##vso[task.setvariable variable=pr_compare_branch]origin/$TargetBranch"; - displayName: Workaround for Branch Names - condition: eq(variables['Build.Reason'], 'PullRequest') -- task: CmdLine@2 - displayName: Check if ${{ parameters.build_pkg }} Needs Testing - inputs: - script: stuart_pr_eval -c ${{ parameters.build_file }} -t ${{ parameters.build_target}} --pr-target $(pr_compare_branch) --output-count-format-string "##vso[task.setvariable variable=pkg_count]{pkgcount}" - condition: eq(variables['Build.Reason'], 'PullRequest') +- ${{ if eq(parameters.do_pr_eval, true) }}: + - powershell: + $TargetBranch = "$(System.PullRequest.targetBranch)".replace('refs/heads/', ''); + Write-Host "##vso[task.setvariable variable=pr_compare_branch]origin/$TargetBranch"; + displayName: Workaround for Branch Names + condition: eq(variables['Build.Reason'], 'PullRequest') + - task: CmdLine@2 + displayName: Check if ${{ parameters.build_pkg }} Needs Testing + inputs: + script: stuart_pr_eval -c ${{ parameters.build_file }} -t ${{ parameters.build_target}} --pr-target $(pr_compare_branch) --output-count-format-string "##vso[task.setvariable variable=pkg_count]{pkgcount}" + condition: eq(variables['Build.Reason'], 'PullRequest') # Setup repo - task: CmdLine@2