feat: add automatic bug reporting flow (closes #334)#345
feat: add automatic bug reporting flow (closes #334)#345SuperCoolPencil merged 5 commits intoSurgeDM:mainfrom
Conversation
Binary Size Analysis
|
|
Hi @smazmi I would like to know more about the UX for reporting a bug. I wanted it to be something like:
3a. If Core:
3b. If Extension:
|
|
Also I feel like since this is opening something new, if triggered via CLI we need to have a confirmation modal asking:
|
Thanks, this makes a lot of sense and I agree with the UX direction. |
|
Amazing. Thanks :) |
738c00c to
dcf56db
Compare
|
Hey @SuperCoolPencil! Sorry for the delay, been a bit tied up with college. I've updated the PR with the interactive flow you described. Here's how it works now: CLI (
TUI ( One thing I wanted to ask — for the CLI flow, I kept it fully interactive for now, but I was also thinking it might be useful to support non-interactive usage via flags (something like Let me know what you think! |
|
Hey @smazmi Honestly I like the current approach but I was just wondering is there no way to attach directly? What do you feel about just including the whole log file in a codeblock? I'm not sure about this too. Just wanna hear your thoughts |
|
As for the TUI, how about we just put everything into the users clipboard? I feel like that would be much more convient! |
|
@SuperCoolPencil On the clipboard idea for TUI - honestly I was thinking the exact same thing, especially for the fallback case. I initially looked into Also I wanted to circle back on the CLI flags - just wanna know what your thoughts are on adding non-interactive flag support ( |
|
We already use Let me know if you need any help |
|
I think command line flags are not a priority for now... |
- add `surge bug-report` CLI command with interactive Core/Extension flow - add `internal/bugreport` package with CoreBugReportURL, ExtensionBugReportURL, and LatestDebugLogPath helpers - add TUI `?` keybinding with modal flow (target → system details → log path) - wire commit hash via ldflags and debug.ReadBuildInfo fallback - extend confirmation_modal.go with reusable Yep/Nope button rendering - add yesNoDecision handler to centralize yes/no key logic in update_modals.go - update docs/USAGE.md with surge bug-report command entry - add tests for URL generation, log discovery, CLI prompts, and TUI modal flow Signed-off-by: Sadique Azmi <sadiquemobaraka5@gmail.com>
dcf56db to
9a62bc2
Compare
Signed-off-by: Sadique Azmi <sadiquemobaraka5@gmail.com>
Thanks for the pointer. Wired it up using |
Signed-off-by: Sadique Azmi <sadiquemobaraka5@gmail.com>
…o verify key coverage
…nded template fields
|
Thank you so much for contributing! 🚀 |


Summary
Adds a bug-report flow in both CLI and TUI that opens a pre-filled GitHub issue with environment details, reducing manual bug-report setup and improving report completeness.
What Changed
surge bug-report.internal/bugreportfor:Why
Issue #334 asks for automatic bug report preparation so users do not need to manually collect version/build/system details.
Implementation Notes
net/urlandurl.Values.How To Test
go test ./...go build ./...surge bug-reportPATH='' ./surge bug-reportsurge?on dashboard.Checklist
Greptile Summary
Adds a
surge bug-reportCLI command and a TUI?keybinding that walk the user through building a pre-filled GitHub issue URL with optional OS details, version/commit, and latest debug log path. The implementation is well-structured, tested, and cleanly separated betweeninternal/bugreport(URL building) andinternal/utils(browser launch).TestCommit_DefaultValuechecksCommit == \"\"but the default sentinel is\"unknown\", so the assertion can never fail and gives no real coverage.Confidence Score: 5/5
Safe to merge; all remaining findings are P2 style/quality suggestions with no blocking defects.
The feature is well-implemented with solid test coverage across CLI and TUI paths. The two flagged items — a misleading test assertion and a privacy wording gap — are non-blocking and don't affect runtime correctness. Prior P1 concerns have been resolved in this revision.
internal/bugreport/bugreport.go (log path privacy wording), cmd/cmd_test.go (weak test assertion)
Security Review
internal/bugreport/bugreport.go): WhenIncludeLatestLogPathis true, the full absolute log path (e.g./home/alice/.local/state/surge/logs/\u2026) is embedded in the issue body without warning the user that their OS username will be publicly visible.Important Files Changed
Prompt To Fix All With AI
Reviews (7): Last reviewed commit: "feat: improve bug reporting workflow wit..." | Re-trigger Greptile