From b8e2777c4e9cc889335a0025c7e6424a4265dfe5 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 13:46:59 +0000 Subject: [PATCH] Attempt to trigger Azure pipelines on merge queue events (#9809) (#9810) * Attempt to trigger Azure pipelines on merge queue events This commit attempts to add a trigger condition to our azure pipelines job to trigger on commits to the gh merge queue branch. * Only trigger PR CI in queue, not push CI --------- Co-authored-by: Jake Lishman (cherry picked from commit b047a7cdcb50e9fcce0815a125ea4e245a88a7f0) Co-authored-by: Matthew Treinish Co-authored-by: Jake Lishman --- azure-pipelines.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2c353922927..335414b80c3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,6 +8,7 @@ trigger: include: - 'main' - 'stable/*' + - 'gh-readonly-queue/*' tags: include: - '*' @@ -130,8 +131,10 @@ stages: id: 7864 comment: Nightly test job failed at commit $(Build.SourceVersion). View the logs at $(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId). - # Full PR suite. - - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + # Full PR suite. This also needs to apply to the merge queue, which appears + # as a push event. The queue won't get cron triggered because the schedule + # trigger doesn't have it as a target. + - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranch'], 'gh-readonly-queue')) }}: # The preliminary stage should be small in both total runtime (including # provisioning) and resources required. About half of PR commits result in # a CI failure, and over 90% of these are in linting, documention or a test @@ -191,9 +194,9 @@ stages: parameters: pythonVersion: ${{ parameters.maximumPythonVersion }} - # Push to main or the stable branches. The triggering branches are set in the - # triggers at the top of this file. - - ${{ if and(eq(variables['Build.Reason'], 'IndividualCI'), startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}: + # Push to main or the stable branches. The triggering branches also need to + # be in the triggers at the top of this file. + - ${{ if and(eq(variables['Build.Reason'], 'IndividualCI'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/stable/'))) }}: - stage: "Push" jobs: - template: ".azure/test-linux.yml"