Skip to content

Commit 1f0ba96

Browse files
authored
chore(template): adding regression info in the bug template (#31057)
### Issue # (if applicable) Closes . ### Reason for this change Update bug template for users to inform about the code changes that resulted in breaking changes. ### Description of changes - Adding checkbox to indicate whether this bug is a regression - Add option of an input for adding last known CDK version - Add GH workflow to run when an issue is opened or edit, workflow will add label `potential-regression` on the basis whether checkbox is selected in [issue template or not.](https://github.com/shikha372/aws-cdk/blob/regression_template/.github/ISSUE_TEMPLATE/bug-report.yml) ### Description of how you validated changes Validated template [here](https://github.com/shikha372/aws-cdk/blob/regression_template/.github/ISSUE_TEMPLATE/bug-report.yml) Label : potential-regression (will be created after approval) Label will removed if this option is unchecked and added if this option is checked. Verified with sample issue in personal repo [here](https://github.com/shikha372/aws-cdk/actions/runs/10326894628), can be tested on sample [github issue ](shikha372#2 in personal repo. Result will be seen in [github actions](https://github.com/shikha372/aws-cdk/actions). Sample issue: shikha372#2 Sample run: https://github.com/shikha372/aws-cdk/actions/runs/10326894628/job/28591182838 ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent cf0a91b commit 1f0ba96

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug-report.yml

+15
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ body:
2020
description: What is the problem? A clear and concise description of the bug.
2121
validations:
2222
required: true
23+
- type: checkboxes
24+
id: regression
25+
attributes:
26+
label: Regression Issue
27+
description: What is a regression? If it worked in a previous version but doesn’t in the latest version, it’s considered a regression. In this case, please provide specific version number in the report.
28+
options:
29+
- label: Select this option if this issue appears to be a regression.
30+
required: false
31+
- type: input
32+
id: working-version
33+
attributes:
34+
label: Last Known Working CDK Version
35+
description: Specify the last known CDK version where this code was functioning as expected (if applicable).
36+
validations:
37+
required: false
2338
- type: textarea
2439
id: expected
2540
attributes:

Diff for: .github/workflows/issue-regression-labeler.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Apply potential regression label on issues
2+
name: issue-regression-label
3+
on:
4+
issues:
5+
types: [opened, edited]
6+
jobs:
7+
add-regression-label:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
issues: write
11+
steps:
12+
- name: Fetch template body
13+
id: check_regression
14+
uses: actions/github-script@v7
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
TEMPLATE_BODY: ${{ github.event.issue.body }}
18+
with:
19+
script: |
20+
const regressionPattern = /\[x\] Select this option if this issue appears to be a regression\./i;
21+
const template = `${process.env.TEMPLATE_BODY}`
22+
const match = regressionPattern.test(template);
23+
core.setOutput('is_regression', match);
24+
- name: Manage regression label
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
if [ "${{ steps.check_regression.outputs.is_regression }}" == "true" ]; then
29+
gh issue edit ${{ github.event.issue.number }} --add-label "potential-regression" -R ${{ github.repository }}
30+
else
31+
gh issue edit ${{ github.event.issue.number }} --remove-label "potential-regression" -R ${{ github.repository }}
32+
fi

0 commit comments

Comments
 (0)