Skip to content

Commit 4ea70a6

Browse files
authored
Merge branch 'main' into main
2 parents 569d56a + 4103e79 commit 4ea70a6

File tree

15 files changed

+210
-720
lines changed

15 files changed

+210
-720
lines changed

.github/workflows/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,82 @@ These workflows and actions are configured in the AWS CDK GitHub repository.
55
## Pull Request Triggered
66

77
### Auto Approve
8+
89
[auto-approve.yml](auto-approve.yml): Approves merging PRs with the
910
`auto-approve` label.
1011
Owner: Core CDK team
1112

1213
### PR Linter
14+
1315
[pr-linter.yml](pr-linter.yml): Runs `tools/@aws-cdk-prlint` on each PR to
1416
check for correctness.
1517
Owner: Core CDK team
1618

1719
### v2-main PR automation
20+
1821
[v2-pull-request.yml](v2-pull-request.yml): Runs `pkglint` on merge forward PRs
1922
and commits the results.
2023
Owner: Core CDK team
2124

2225
### Label Assigner
26+
2327
[issue-label-assign.yml](issue-label-assign.yml): Github action for automatically adding labels and/or setting assignees when an Issue or PR is opened or edited based on user-defined Area
2428
Owner: CDK support team
2529

2630
### PR Labeler
27-
[pr-labeler.yml](pr-labeler.yml): GitHub action for automatically porting triage labels from issues
31+
32+
[pr-labeler.yml](pr-labeler.yml): GitHub action for automatically porting triage labels from issues
2833
linked in the PR description to the PR.
2934
Owner: Core CDK team
3035

3136
### GitHub Merit Badger
37+
3238
[github-merit-badger.yml](github-merit-badger.yml): GitHub action that adds 'merit badges' to pull
3339
requests based on the users prior contributions to the CDK.
3440
Owner: Core CDK team
3541

42+
### Request CLI Integ Test
43+
44+
[request-cli-integ-test.yml](request-cli-integ-test.yml):
45+
Checks for relevant changes to the CLI code and requests a deployment to the `test-pipeline` environment.
46+
When approved this pushes the PR to the testing pipeline,
47+
thus starting the cli integ test build.
48+
Owner: Core CDK team
49+
3650
## Issue Triggered
3751

3852
### Closed Issue Message
53+
3954
[closed-issue-message.yml](closed-issue-message.yml): Adds a reminder message
4055
to issues that are closed.
4156
Owner: CDK support team
4257

4358
### Label Assigner
59+
4460
[issue-label-assign.yml](issue-label-assign.yml): Github action for automatically adding labels and/or setting assignees when an Issue or PR is opened or edited based on user-defined Area
4561
Owner: CDK support team
4662

4763
## Scheduled Actions
4864

4965
### Issue Lifecycle Handling
66+
5067
[close-stale-issues.yml](close-stale-issues.yml): Handles labeling issues and
5168
PRs with `closing-soon`, `response-requested`, etc.
5269
Owner: CDK support team
5370

5471
### Yarn Upgrader
72+
5573
[yarn-upgrade.yml](yarn-upgrade.yml): Upgrades yarn dependencies and creates a
5674
patch file for downloading.
5775
Owner: Core CDK team
5876

5977
### Issue Reprioritizer
78+
6079
[issue-reprioritization.yml](issue-reprioritization.yml): GitHub action that labels `p2`
6180
issues as `p1` if a certain level of community engagement is met.
62-
Owner: Core CDK team
81+
Owner: Core CDK team
82+
83+
### Issue Metrics
84+
85+
[repo-metrics.yml](repo-metrics.yml): GitHub action that runs monthly to report on metrics for issues and PRs created last month.
86+
Owner: Core CDK team

.github/workflows/repo-metrics.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Monthly repo metrics
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 2 1 * *'
6+
7+
permissions:
8+
issues: write
9+
pull-requests: read
10+
11+
jobs:
12+
build:
13+
name: metrics
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Get dates for last month
18+
shell: bash
19+
run: |
20+
# Calculate the first day of the previous month
21+
first_day=$(date -d "last month" +%Y-%m-01)
22+
23+
# Calculate the last day of the previous month
24+
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
25+
26+
# Set an environment variable with the date range
27+
echo "$first_day..$last_day"
28+
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
29+
30+
- name: Report on issues
31+
uses: github/issue-metrics@v2
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
SEARCH_QUERY: 'repo:aws/aws-cdk is:issue created:${{ env.last_month }} -reason:"not planned"'
35+
36+
- name: Create report for issues
37+
uses: peter-evans/create-issue-from-file@v4
38+
with:
39+
title: Monthly issue metrics report
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
content-filepath: ./issue_metrics.md
42+
assignees: evgenyka
43+
44+
- name: Report on PRs
45+
uses: github/issue-metrics@v2
46+
env:
47+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
SEARCH_QUERY: 'repo:aws/aws-cdk is:pr created:${{ env.last_month }} -is:draft'
49+
50+
- name: Create report for PRs
51+
uses: peter-evans/create-issue-from-file@v4
52+
with:
53+
title: Monthly issue metrics report
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
content-filepath: ./issue_metrics.md
56+
assignees: evgenyka
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Request a deployment to the test pipeline
2+
3+
name: request-cli-integ-test
4+
on:
5+
pull_request_target: {}
6+
7+
jobs:
8+
cli-changes:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
any-changed-files: ${{ steps.changed-cli-files.outputs.cli_any_changed }}
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
ref: ${{ github.event.pull_request.head.ref }}
17+
repository: ${{ github.event.pull_request.head.repo.full_name }}
18+
fetch-depth: 0
19+
persist-credentials: false
20+
- name: Find changed cli files
21+
id: changed-cli-files
22+
uses: tj-actions/changed-files@v37
23+
with:
24+
files_yaml: |
25+
cli:
26+
- packages/aws-cdk/bin/**
27+
- packages/aws-cdk/lib/**
28+
- packages/aws-cdk/test/**
29+
submit-to-test-pipeline:
30+
environment: test-pipeline
31+
needs: cli-changes
32+
if: needs.cli-changes.outputs.any-changed-files == 'true'
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
with:
38+
token: ${{ secrets.PROJEN_GITHUB_TOKEN }}
39+
ref: ${{ github.event.pull_request.head.ref }}
40+
repository: ${{ github.event.pull_request.head.repo.full_name }}
41+
- name: Submit to test-pipeline
42+
# Needs to run with PROJEN_GITHUB_TOKEN because we need permissions to force push the branch
43+
run: |
44+
git config --global user.name 'aws-cdk-automation'
45+
git config --global user.email '[email protected]'
46+
git push --force --atomic ${{ github.repositoryUrl }} FETCH_HEAD:test-main-pipeline
47+
- name: Explain next steps
48+
uses: thollander/actions-comment-pull-request@v2
49+
with:
50+
message: |
51+
:arrow_right: **PR build request submitted to `test-main-pipeline`** :arrow_left:
52+
53+
A maintainer must now manually check the pipeline and add the `pr-linter/cli-integ-tested` label once the pipeline succeeds.
54+
comment_tag: request-cli-integ-test
55+
mode: recreate
56+
# Post as our automation user
57+
GITHUB_TOKEN: ${{ secrets.PROJEN_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)