chore(issues): add required complexity field and a form labeler
Add the Complexity dropdown that Rule 1.6 requires on both issue forms (status date, priority, complexity), alongside the existing per-kind fields. Add a labeler workflow that maps the Priority dropdown to the priority: high label on issue open and edit, closing the Rule 1.6 gotcha where form dropdowns produce body text but never apply a label. Complexity stays a body field only, never a label, per Rule 2.1.
This commit is contained in:
parent
5f3892f2c1
commit
9acfd57acc
11
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
11
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -52,6 +52,17 @@ body:
|
||||
- High
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: complexity
|
||||
attributes:
|
||||
label: Complexity
|
||||
description: A rough effort estimate. Small is a focused fix; Large spans many files or needs design.
|
||||
options:
|
||||
- Small
|
||||
- Medium
|
||||
- Large
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
|
||||
11
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
11
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -41,3 +41,14 @@ body:
|
||||
- High
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: complexity
|
||||
attributes:
|
||||
label: Complexity
|
||||
description: A rough effort estimate. Small is a focused change; Large spans many files or needs design.
|
||||
options:
|
||||
- Small
|
||||
- Medium
|
||||
- Large
|
||||
validations:
|
||||
required: true
|
||||
|
||||
39
.github/workflows/labeler.yml
vendored
Normal file
39
.github/workflows/labeler.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Issue labeler
|
||||
|
||||
# Rule 1.6 backstop: issue-form dropdown selections produce body TEXT under
|
||||
# `### <field>` headings, not labels. This translates the Priority dropdown into
|
||||
# the `priority: high` label. Complexity is intentionally a body field only, not
|
||||
# a label (Rule 2.1), so it is not mapped here.
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, edited]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
label:
|
||||
name: Apply form labels
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Apply priority label from the issue form
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
REPO: ${{ github.repository }}
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
BODY: ${{ github.event.issue.body }}
|
||||
run: |
|
||||
# Print the first non-empty line after a "### <heading>" line.
|
||||
value_under() {
|
||||
printf '%s\n' "$BODY" | awk -v h="### $1" '
|
||||
$0 == h { found = 1; next }
|
||||
found && NF { print; exit }
|
||||
'
|
||||
}
|
||||
priority=$(value_under "Priority")
|
||||
if [ "$priority" = "High" ]; then
|
||||
gh issue edit "$NUMBER" --repo "$REPO" --add-label "priority: high"
|
||||
else
|
||||
gh issue edit "$NUMBER" --repo "$REPO" --remove-label "priority: high" || true
|
||||
fi
|
||||
Loading…
Reference in New Issue
Block a user