Skip to content

Commit 414c89e

Browse files
committed
Add merge queue tracking workflow
This workflow emits CloudWatch metrics to track when branches are added or removed from the master branch merge queue.
1 parent 6451fbd commit 414c89e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow tracks when PRs are added ('enqueued') to the master branch merge queue, and when they are removed for
2+
# reasons other than 'MERGE', which means that it probably has to be enqueued again. The most common reason for this is
3+
# test failures when running the checks in the merge queue.
4+
name: Tracking Merge Queue
5+
on:
6+
pull_request:
7+
types: [ "enqueued", "dequeued" ]
8+
branches:
9+
- "master"
10+
11+
permissions:
12+
id-token: write
13+
14+
jobs:
15+
emit-enqueue:
16+
runs-on: ubuntu-latest
17+
if: ${{ github.repository == 'aws/aws-sdk-java-v2' && github.event.action == 'enqueued' }}
18+
19+
steps:
20+
- name: Configure AWS Credentials
21+
uses: aws-actions/configure-aws-credentials@v1
22+
with:
23+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
24+
aws-region: us-west-2
25+
role-duration-seconds: 120
26+
- name: Record merge queue add
27+
run: |
28+
aws --region us-west-2 cloudwatch put-metric-data --namespace AwsJavaSdkV2/GitHub --metric-name MergeQueue-Add --unit Count --value 1 --dimensions Branch=master
29+
30+
emit-dequeue:
31+
runs-on: ubuntu-latest
32+
if: ${{ github.repository == 'aws/aws-sdk-java-v2' && github.event.action == 'dequeued' && github.event.reason != 'MERGE'}}
33+
steps:
34+
- name: Configure AWS Credentials
35+
uses: aws-actions/configure-aws-credentials@v1
36+
with:
37+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
38+
aws-region: us-west-2
39+
role-duration-seconds: 120
40+
- name: Record merge queue removal
41+
run: |
42+
aws --region us-west-2 cloudwatch put-metric-data --namespace AwsJavaSdkV2/GitHub --metric-name MergeQueue-Remove --unit Count --value 1 --dimensions Branch=master

0 commit comments

Comments
 (0)