Skip to content

Commit

Permalink
Attempt to trigger Azure pipelines on merge queue events (#9809) (#9810)
Browse files Browse the repository at this point in the history
* 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 <jake.lishman@ibm.com>
(cherry picked from commit b047a7c)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
  • Loading branch information
3 people committed Mar 17, 2023
1 parent 9c1e92c commit b8e2777
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ trigger:
include:
- 'main'
- 'stable/*'
- 'gh-readonly-queue/*'
tags:
include:
- '*'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit b8e2777

Please sign in to comment.