From 98f2d0ff59d276e843f2898ea53bcdcf1a44c5ce Mon Sep 17 00:00:00 2001 From: xLagerFeuer <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 26 Nov 2026 11:08:20 +0000 Subject: [PATCH] fix(roadmap): recognize native Idea feature request forms --- CHANGELOG.md | 2 ++ scripts/preflight_publication_destination.py | 5 ++++ tests/test_publication_destination.py | 29 ++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba3c124..23f56b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ## Unreleased +- **Native Idea feature-request form (PATCH, 2026-11-26):** Recognize a first-party YAML feature_request/feature-request form explicitly named Idea (Filament); retain declared-name checks, required fields, ambiguous-channel and exact consent gates. A filename alone or an unrelated Idea form does not establish a feature route. + - **Verified template-free native Issue route (PATCH, 2026-11-26):** Recognize a blank Issue only after pinned local/inherited configuration and legacy template checks plus GitHub GraphQL confirmation of an empty effective template list, enabled Issues and matching default HEAD. Preserve unknown/forbidden channel, original payload, history, PAUSE and exact consent gates. - **Inherited native Issue forms (PATCH, 2026-11-26):** Resolve public owner/.github default templates only when no local directory/config exists, pin the effective source and identify Feature Request forms by declared name (including feature.yml). Preserve local precedence, unknown-channel, native-field, original-head and consent gates. diff --git a/scripts/preflight_publication_destination.py b/scripts/preflight_publication_destination.py index cffe58c..61de795 100644 --- a/scripts/preflight_publication_destination.py +++ b/scripts/preflight_publication_destination.py @@ -257,6 +257,11 @@ def classify_issue_templates(templates, source, ref): else: header = template feature = bool(re.search(r"(?mi)^name:[ \t]*[\"']?feature[ \t]+request[\"']?[ \t]*$", header)) + # Some maintainers call the canonical feature-request form "Idea". + # Require both the verified native form name and conventional filename; + # an arbitrary Idea form or a misleading filename alone is insufficient. + if not feature and re.fullmatch(r"feature[_-]request\.ya?ml", name, re.I): + feature = bool(re.search(r"(?mi)^name:[ \t]*[\"']?idea[\"']?[ \t]*$", header)) classified.append({**entry, "feature_request": feature}) contents[name] = template return classified, contents diff --git a/tests/test_publication_destination.py b/tests/test_publication_destination.py index 4d56000..c27ce11 100644 --- a/tests/test_publication_destination.py +++ b/tests/test_publication_destination.py @@ -82,6 +82,35 @@ def test_declared_name_not_filename_and_ambiguous_forms(self): self.assertEqual([e["name"] for e in classified if destination.is_feature_template(e)], ["01-feature.yml","02-feature.yml"]) + def test_filament_native_idea_form_and_required_fields(self): + target = "invertibleMatrix/filament" + entries = [{"name": "feature_request.yml", "type": "file"}, + {"name": "bug_report.yml", "type": "file"}, + {"name": "other.yml", "type": "file"}] + form = ("name: Idea\n" + "description: Something Filament could do, or do better.\n" + 'labels: ["idea"]\n' + "body:\n - type: textarea\n id: need\n" + " attributes:\n label: What you need\n" + " validations:\n required: true\n" + " - type: textarea\n id: how\n" + " attributes:\n label: How it could work\n") + with patch.object(destination, "get_optional_file", + side_effect=[form, "name: Bug Report", form]): + templates, contents = destination.classify_issue_templates(entries, target, "a"*40) + self.assertEqual([x["name"] for x in templates if destination.is_feature_template(x)], + ["feature_request.yml"]) + self.assertEqual(route_errors(target, target, "original_issue", "feature_request", + repo(target), templates, "blank_issues_enabled: false"), []) + spec = feature_form_requirements(contents["feature_request.yml"]) + self.assertEqual(spec["required_fields"], ["What you need"]) + self.assertEqual(feature_form_payload_errors(spec, "Proposal", "### What you need\nA bounded improvement"), []) + self.assertIn("NATIVE_FEATURE_REQUIRED_FIELD_MISSING: What you need", + feature_form_payload_errors(spec, "Proposal", "### How it could work\nAn approach")) + self.assertIn("FEATURE_REQUEST_CHANNEL_AMBIGUOUS", + route_errors(target, target, "original_issue", "feature_request", repo(target), + templates, "url: https://github.com/invertibleMatrix/filament/discussions/categories/feature-requests")) + def test_template_fetch_error_not_treated_as_absence(self): with patch.object(destination,"get_optional_templates",side_effect=RuntimeError("403 Forbidden")), \ patch.object(destination,"gh_api") as api: