From 25a82a0c214558a289857ee7ebd45e61cf6b24b7 Mon Sep 17 00:00:00 2001 From: Jin Xiao Date: Mon, 5 Oct 2026 07:31:48 +0800 Subject: [PATCH] fix(github): default issue forms to category labels --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.yml | 1 + docs/CONTRIBUTING.md | 5 +++++ tools/test_contribution_workflow.py | 3 ++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 30633e8..1651a69 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,7 @@ name: Bug report description: Report a reproducible problem in a utility or supported workflow. title: "[Bug]: " +labels: [bug] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index edabe19..835f79d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,6 +1,7 @@ name: Feature proposal description: Agree on a new capability or a behavior change before implementation. title: "[Feature]: " +labels: [enhancement] body: - type: markdown attributes: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 036263a..ddb475a 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -18,6 +18,11 @@ and the [roadmap](ROADMAP.md) first, then choose a form in - **Documentation, maintenance, or question:** the affected page/tool, requested change or question, and what would resolve it +The Bug report form assigns the existing red `bug` label; Feature proposal +assigns `enhancement`. When creating an issue with `gh issue create`, pass +`--label bug` or `--label enhancement` explicitly: CLI/API creation with a body +does not apply the web form defaults. + Track one independently verifiable outcome per issue, not one issue per commit. The owner can self-triage and assign their own work. Several commits or partial PRs may share a tracking issue; questions and ideas do not have to become diff --git a/tools/test_contribution_workflow.py b/tools/test_contribution_workflow.py index 5983242..4f36c09 100644 --- a/tools/test_contribution_workflow.py +++ b/tools/test_contribution_workflow.py @@ -145,7 +145,8 @@ def test_forms_have_unique_fields_and_required_inputs(self): self.assertIs(form["blank_issues_enabled"], False) continue self.assertTrue(form["name"] and form["description"]) - self.assertNotIn("labels", form) + expected_labels = {"bug_report.yml": ["bug"], "feature_request.yml": ["enhancement"]} + self.assertEqual(form.get("labels", []), expected_labels.get(path.name, [])) self.assertNotIn("assignees", form) fields = [field for field in form["body"] if field["type"] != "markdown"] ids = [field["id"] for field in fields]