fix(gitinfo): pick workflow-dispatch inputs and stop command-goroutine crashes#370
Merged
Conversation
…e crashes Prompt for each workflow_dispatch input in turn: choice and boolean inputs are picked from their valid values (preselected on the workflow default), and free-form inputs are pre-filled with the default and accept a custom value, instead of a single free-form key=value blob. A workflow with no inputs dispatches directly; unreadable inputs fall back to the free-form composer. Fix the residual dispatch crash: panics inside Bubble Tea command goroutines are uncaught by crashlog.GuardTUI (which only guards Init/Update/View) and become a fatal ErrProgramPanic. Add crashlog.CaptureCmdPanic (a quiet crash-report writer) and gitinfo.guardedGitHubCmd, wrapping every GitHub data loader and the dispatch closures so a panic becomes a crash report plus an error toast instead of killing the TUI; a recovered panic also clears stranded Loading state. Also guard seven GitHub command functions (cancel run, merge PR, comment, request reviewers, close/reopen issue, create PR, assign self) against a nil client, and serialise crashlog.Write with collision-free filenames so concurrent command panics no longer overwrite reports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b9a3d924-7b48-4000-9d4d-fb592f3485b6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b9a3d924-7b48-4000-9d4d-fb592f3485b6
The per-input dispatch flow replaced the pre-populated multi-line composer with per-input prompts, leaving ShowMultilineInputWithValue with no production caller, which failed CI's `mage deadcode` gate. Remove it and its constructor test; retain the multi-line edit/submit coverage by driving the modal via ShowModalMsg directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b9a3d924-7b48-4000-9d4d-fb592f3485b6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two changes to GitHub Actions workflow dispatch in the GitHub panel:
Parameter picker — dispatch now prompts for each declared
workflow_dispatchinput in turn, instead of one free-formkey=valueblob:choiceinputs → an action picker of the valid options, preselected on the workflow's defaultbooleaninputs → a true/false picker, preselected on the defaultstring/environment/unspecified) → a text field pre-filled with the default; accepts a custom valueCrash fix (root cause) — dispatching could still kill the whole TUI (
program experienced a panic, empty crashes dir), even after fix(tui): capture panics and harden GitHub workflow dispatch #362 addedcrashlog.GuardTUI.GuardTUIonly guards the model'sInit/Update/Viewon the main goroutine; a panic inside atea.Cmdgoroutine (run by Bubble Tea'sexecBatchMsg) becomes a fatalErrProgramPanicthat no report captures. Historicalbubbletea-panic-*.logstacks pinpointed nil-client derefs in the GitHub loaders running in those goroutines.crashlog.CaptureCmdPanic(a quiet crash-report writer — no stderr, since the TUI owns the terminal) +gitinfo.guardedGitHubCmd, wrapping every GitHub data loader and the dispatch closures so a panic becomes a crash report + error toast instead of a crash. A recovered panic also clears any strandedLoading…state.Also fixed (found along the way)
crashlog.Writeis now serialised (mutex) with collision-free filenames (atomic sequence); previously same-second reports could overwrite/corrupt each other onceCaptureCmdPanicmade writes concurrent and repeatable.Testing
go test ./...— pass (pre- and post-rebase)go vet ./...,golangci-lint ./...(0 issues),gofumpt -l .(clean),deadcode ./...(0 new),govulncheck ./...(no vulnerabilities)Design + test plan:
docs/specs/workflow-dispatch-param-picker/.Follow-up to #362.