Skip to content

Commit

Permalink
github: add specifier to issue github labels
Browse files Browse the repository at this point in the history
This change adds a specifier to github lables created with "new issue":

- for labels related to architecture specifier is "Arch: xxx"
- for labels related to issue type specifier is "Type: xxx"
- for labels related to host OS type specifier is "OS: xxx"
- for labels related to issue area type specifier is "Area: xxx"
  • Loading branch information
raiden00pl authored and xiaoxiang781216 committed Sep 20, 2024
1 parent d26357d commit ff24fc4
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 56 deletions.
90 changes: 45 additions & 45 deletions .github/ISSUE_TEMPLATE/001_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name: Bug report
description: Report a bug to improve NuttX stability
title: "[BUG] <title>"
labels: [👀 needs triage, bug]
labels: [👀 needs triage, "Type: bug"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -47,11 +47,11 @@ body:
label: On which OS does this issue occur?
multiple: true
options:
- "[BSD]"
- "[Linux]"
- "[Mac]"
- "[Windows]"
- "[Other]"
- "[OS: BSD]"
- "[OS: Linux]"
- "[OS: Mac]"
- "[OS: Windows]"
- "[OS: Other]"
validations:
required: true

Expand All @@ -78,25 +78,25 @@ body:
description: What architecture(s) are you seeing the problem on?
multiple: true
options:
- "[all]"
- "[arm]"
- "[arm64]"
- "[avr]"
- "[ceva]"
- "[hc]"
- "[mips]"
- "[misoc]"
- "[openrisc]"
- "[renesas]"
- "[risc-v]"
- "[simulator]"
- "[sparc]"
- "[tricore]"
- "[x86]"
- "[x86_64]"
- "[xtensa]"
- "[z16]"
- "[z80]"
- "[Arch: all]"
- "[Arch: arm]"
- "[Arch: arm64]"
- "[Arch: avr]"
- "[Arch: ceva]"
- "[Arch: hc]"
- "[Arch: mips]"
- "[Arch: misoc]"
- "[Arch: openrisc]"
- "[Arch: renesas]"
- "[Arch: risc-v]"
- "[Arch: simulator]"
- "[Arch: sparc]"
- "[Arch: tricore]"
- "[Arch: x86]"
- "[Arch: x86_64]"
- "[Arch: xtensa]"
- "[Arch: z16]"
- "[Arch: z80]"
validations:
required: true

Expand All @@ -107,25 +107,25 @@ body:
description: What area(s) are you seeing the problem on?
multiple: true
options:
- "[Other]"
- "[Applications]"
- "[Api]"
- "[Board support]"
- "[Build System]"
- "[Configuring]"
- "[Debugging]"
- "[Drivers]"
- "[File System]"
- "[Installing]"
- "[Kconfig]"
- "[Kernel]"
- "[Memory Management]"
- "[Native port]"
- "[Networking]"
- "[OS Components]"
- "[Posix]"
- "[Sensors]"
- "[Specific Peripheral]"
- "[Area: Other]"
- "[Area: Applications]"
- "[Area: Api]"
- "[Area: Board support]"
- "[Area: Build System]"
- "[Area: Configuring]"
- "[Area: Debugging]"
- "[Area: Drivers]"
- "[Area: File System]"
- "[Area: Installing]"
- "[Area: Kconfig]"
- "[Area: Kernel]"
- "[Area: Memory Management]"
- "[Area: Native port]"
- "[Area: Networking]"
- "[Area: OS Components]"
- "[Area: Posix]"
- "[Area: Sensors]"
- "[Area: Specific Peripheral]"
validations:
required: true

Expand All @@ -145,4 +145,4 @@ body:
label: "Verification"
options:
- label: "I have verified before submitting the report."
required: true
required: true
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/002_feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name: Feature request
description: Request an enhancement for NuttX
title: "[FEATURE] <title>"
labels: [enhancement]
labels: ["Type: enhancement"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -59,4 +59,4 @@ body:
label: "Verification"
options:
- label: "I have verified before submitting the report."
required: true
required: true
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/003_help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name: General Help
description: Get general support regarding NuttX
title: "[HELP] <title>"
labels: [question]
labels: ["Type: question"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -51,4 +51,4 @@ body:
label: "Verification"
options:
- label: "I have verified before submitting the report."
required: true
required: true
18 changes: 11 additions & 7 deletions .github/workflows/issue_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ jobs:
script: |
const body = context.payload.issue.body;
const bodySplit = body.split(/\[|\]/).map(e => e.toLowerCase());
const oskeywords = ['other', 'bsd', 'linux', 'mac', 'windows'];
const archkeywords1 = ['all', 'arm', 'arm64', 'avr', 'ceva', 'hc', 'mips', 'misoc', 'openrisc', 'renesas'];
const archkeywords2 = ['risc-v', 'simulator', 'sparc', 'tricore', 'x86', 'x86_64', 'xtensa', 'z16', 'z80', 'renesas'];
const areakeywords1 = ['applications', 'api', 'board support', 'build system', 'configuring', 'debugging', 'drivers', 'file system', 'installing', 'kconfig'];
const areakeywords2 = ['kernel', 'memory management', 'native port', 'networking', 'os components', 'posix', 'sensors', 'specific peripheral', 'openrisc', 'renesas'];
const keywords = [...oskeywords, ...archkeywords1, ...archkeywords2, ...areakeywords1, ...areakeywords2];
const oskeywords = ['os: other', 'os: bsd', 'os: Linux', 'os: mac', 'os: windows'];
const archkeywords1 = ['arch: all', 'arch: arm', 'arch: arm64', 'arch: avr', 'arch: ceva'];
const archkeywords2 = ['arch: hc', 'arch: mips', 'arch: misoc', 'arch: openrisc', 'arch:renesas'];
const archkeywords3 = ['arch: risc-v', 'arch: simulator', 'arch: sparc', 'arch: tricore'];
const archkeywords4 = ['arch: x86', 'arch: x86_64', 'arch: xtensa', 'arch: z16', 'arch: z80', 'arch:renesas'];
const areakeywords1 = ['area: applications', 'area: api', 'area: board support', 'area: build system'];
const areakeywords2 = ['area: configuring', 'area: debugging', 'area: drivers', 'area: file system', 'area: installing', 'area: kconfig'];
const areakeywords3 = ['area: kernel', 'area: memory management', 'area: native port', 'area: networking'];
const areakeywords4 = ['area: os components', 'area: posix', 'area: sensors', 'area: specific peripheral'];
const keywords = [...oskeywords, ...archkeywords1, ...archkeywords2, ...archkeywords3, ...archkeywords4, ...areakeywords1, ...areakeywords2, ...areakeywords3, ...areakeywords4];
var keywordsfound = new Set();
for (const keyword of keywords) {
if (bodySplit.includes(keyword)) {
Expand All @@ -47,4 +51,4 @@ jobs:
issue_number: context.issue.number,
labels: Array.from(keywordsfound)
})
}
}

0 comments on commit ff24fc4

Please sign in to comment.