From 9acfd57acc78390d2ce03843c34cb34deba8296d Mon Sep 17 00:00:00 2001 From: Mihaela M Date: Fri, 26 Jun 2026 05:48:01 +0200 Subject: [PATCH] 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. --- .github/ISSUE_TEMPLATE/bug_report.yml | 11 ++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 11 ++++++ .github/workflows/labeler.yml | 39 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/labeler.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 63b602e..fa23842 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -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: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 1c95bfd..20872a8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -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 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..b6e2778 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,39 @@ +name: Issue labeler + +# Rule 1.6 backstop: issue-form dropdown selections produce body TEXT under +# `### ` 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 "### " 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