From 2f6ad22235edbe320717ed81ed7f1698c1994010 Mon Sep 17 00:00:00 2001 From: leex279 Date: Fri, 17 Oct 2025 23:18:25 +0200 Subject: [PATCH] fix: Remove template parameter from bug report URL to enable field pre-filling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub's issue creation URL does not support the 'template' parameter for pre-filling fields. When a template is specified, GitHub ignores other URL parameters like title and body, preventing user-submitted data from being pre-filled in the issue form. Changes: - Remove 'template=bug_report.yml' parameter (non-existent template) - Remove 'labels' parameter (not supported via URL) - Keep only 'title' and 'body' parameters for proper pre-filling - Add explanatory comment about GitHub's URL parameter limitations - Update tests to verify URL structure (no template parameter) Now when users click "Report Bug", the GitHub issue form will be properly pre-filled with their title and detailed bug report information. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- python/src/server/api_routes/bug_report_api.py | 13 ++++++------- .../tests/server/api_routes/test_bug_report_api.py | 4 ++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/python/src/server/api_routes/bug_report_api.py b/python/src/server/api_routes/bug_report_api.py index 139c48f1..2fd30610 100644 --- a/python/src/server/api_routes/bug_report_api.py +++ b/python/src/server/api_routes/bug_report_api.py @@ -246,14 +246,13 @@ def _create_manual_submission_response(bug_report: BugReportRequest) -> BugRepor import urllib.parse base_url = f"https://github.com/{github_service.repo}/issues/new" - params = { - "template": "bug_report.yml", - "title": bug_report.title, - "labels": f"bug,auto-report,severity:{bug_report.severity},component:{bug_report.component}", - } - # Add the formatted body as a parameter - params["body"] = issue_body + # GitHub only supports title and body parameters for pre-filling + # Labels cannot be set via URL (requires API or manual selection) + params = { + "title": bug_report.title, + "body": issue_body, + } # Build the URL query_string = urllib.parse.urlencode(params) diff --git a/python/tests/server/api_routes/test_bug_report_api.py b/python/tests/server/api_routes/test_bug_report_api.py index 73e021e2..16055313 100644 --- a/python/tests/server/api_routes/test_bug_report_api.py +++ b/python/tests/server/api_routes/test_bug_report_api.py @@ -119,6 +119,10 @@ def test_manual_submission_url_uses_correct_repo(client, mock_bug_report): # Ensure old repository is NOT in URL assert "dynamous-community" not in data["issue_url"] assert "Archon-V2-Alpha" not in data["issue_url"] + # Verify URL contains title and body parameters (not template) + assert "title=" in data["issue_url"] + assert "body=" in data["issue_url"] + assert "template=" not in data["issue_url"] def test_api_submission_with_token(client, mock_bug_report):