Skip to content

Commit

Permalink
chore: issue template context for issue check and package (#7190)
Browse files Browse the repository at this point in the history
**Related Issue:** n/a

## Summary
Adds the following to the a11y, bug, and enhancement templates:

1. Adds a required checkbox verifying the submitter has checked for
existing issues

![image](https://github.com/Esri/calcite-components/assets/5023024/0d0bdf20-8288-415a-9aa4-f0af4d08baad)


2. Adds checkbox options to specify the package of the request

![image](https://github.com/Esri/calcite-components/assets/5023024/ea508aaa-0db7-4fb2-b4f8-7cc0cd1a1416)
 

cc @benelan for the ci/action on the checkbox options to add the
`framework-react` label to the CCR checkbox when checked.

---------

Co-authored-by: Ben Elan <no-reply@benelan.dev>
Co-authored-by: JC Franco <jfranco@esri.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Jun 28, 2023
1 parent be87dc5 commit e65e3c8
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 12 deletions.
22 changes: 18 additions & 4 deletions .github/ISSUE_TEMPLATE/accessibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: Accessibility
description: Report an accessibility issue in a component
labels: ["a11y", "bug", "0 - new", "p - high", "needs triage"]
body:
- type: markdown
- type: checkboxes
id: existing-issues
attributes:
value: |
- Please [check for existing issues](https://github.com/Esri/calcite-components/issues) to avoid duplicates. If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one.
- For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/)
label: Check existing issues
description: If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one. For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/).
options:
- label: I have [checked for existing issues](https://github.com/Esri/calcite-components/issues) to avoid duplicates
validations:
required: true
- type: textarea
id: summary
attributes:
Expand Down Expand Up @@ -92,6 +96,16 @@ body:
- p2 - want for current milestone
- p1 - need for current milestone
- p0 - emergency
- type: checkboxes
id: packages
attributes:
label: Calcite package
description: Select the relevant [package(s)](https://github.com/Esri/calcite-components/tree/master/packages) related to the request.
options:
- label: "@esri/calcite-components"
- label: "@esri/calcite-components-react"
validations:
required: false
- type: dropdown
id: esri-team
validations:
Expand Down
22 changes: 18 additions & 4 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: Bug
description: Report a bug in a component
labels: ["bug", "0 - new", "needs triage"]
body:
- type: markdown
- type: checkboxes
id: existing-issues
attributes:
value: |
- Please [check for existing issues](https://github.com/Esri/calcite-components/issues) to avoid duplicates. If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one.
- For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/).
label: Check existing issues
description: If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one. For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/).
options:
- label: I have [checked for existing issues](https://github.com/Esri/calcite-components/issues) to avoid duplicates
validations:
required: true
- type: textarea
id: actual
attributes:
Expand Down Expand Up @@ -86,6 +90,16 @@ body:
description: How does the issue effect your team, or your work? Can range from minor to blocking or prohibiting workflows. Helps Calcite Design System team members with prioritization.
validations:
required: false
- type: checkboxes
id: packages
attributes:
label: Calcite package
description: Select the relevant [package(s)](https://github.com/Esri/calcite-components/tree/master/packages) related to the request.
options:
- label: "@esri/calcite-components"
- label: "@esri/calcite-components-react"
validations:
required: false
- type: dropdown
id: esri-team
validations:
Expand Down
22 changes: 18 additions & 4 deletions .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ name: Enhancement
description: Request for a feature to be added to an existing component
labels: ["enhancement", "0 - new", "needs triage"]
body:
- type: markdown
- type: checkboxes
id: existing-issues
attributes:
value: |
- Please [check for existing issues](https://github.com/Esri/calcite-components/issues) to avoid duplicates. If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one.
- For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/).
label: Check existing issues
description: If someone has already opened an issue for what you are experiencing, please add a 👍 reaction to the existing issue instead of creating a new one. For support, please check the [community forum](https://developers.arcgis.com/calcite-design-system/community/).
options:
- label: I have [checked for existing issues](https://github.com/Esri/calcite-components/issues) to avoid duplicates
validations:
required: true
- type: textarea
id: description
attributes:
Expand Down Expand Up @@ -54,6 +58,16 @@ body:
- p3 - want for upcoming milestone
- p2 - want for current milestone
- p1 - need for current milestone
- type: checkboxes
id: packages
attributes:
label: Calcite package
description: Select the relevant [package(s)](https://github.com/Esri/calcite-components/tree/master/packages) related to the request.
options:
- label: "@esri/calcite-components"
- label: "@esri/calcite-components-react"
validations:
required: false
- type: dropdown
id: esri-team
validations:
Expand Down
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/refactor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ body:
description: Dependencies, blockers, helpful details, etc.
validations:
required: false
- type: checkboxes
id: packages
attributes:
label: Calcite package
description: Select the relevant [package(s)](https://github.com/Esri/calcite-components/tree/master/packages) related to the request.
options:
- label: "@esri/calcite-components"
- label: "@esri/calcite-components-react"
validations:
required: false
54 changes: 54 additions & 0 deletions .github/workflows/add-package-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Add Package Label
on:
issues:
types: [opened, edited]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
const {
repo: { owner, repo },
payload: {
action,
issue: { body, labels: currentLabels, number: issue_number },
},
} = context;
if (!body) {
console.log("could not determine the issue body");
return;
}
// NOTE: assumes all packages will be in the @esri NPM scope
const packageRegex = /(?<=\[X\]\s@esri\/)[\w-]*$/gm;
const packages = body.match(packageRegex) || [];
for (const package of packages) {
/** Creates a label if it does not exist */
try {
await github.rest.issues.getLabel({
owner,
repo,
name: package,
});
} catch (e) {
await github.rest.issues.createLabel({
owner,
repo,
name: package,
color: "BFBEAF",
description: `Issues specific to the @esri/${package} package.`,
});
}
/** add new package label */
await github.rest.issues.addLabels({
issue_number,
owner,
repo,
labels: [package],
});
}

0 comments on commit e65e3c8

Please sign in to comment.