Skip to content

fix(gitinfo): pick workflow-dispatch inputs and stop command-goroutine crashes#370

Merged
jongio merged 3 commits into
mainfrom
go/workflow-dispatch-param-picker
Jul 25, 2026
Merged

fix(gitinfo): pick workflow-dispatch inputs and stop command-goroutine crashes#370
jongio merged 3 commits into
mainfrom
go/workflow-dispatch-param-picker

Conversation

@jongio

@jongio jongio commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

Two changes to GitHub Actions workflow dispatch in the GitHub panel:

  1. Parameter picker — dispatch now prompts for each declared workflow_dispatch input in turn, instead of one free-form key=value blob:

    • choice inputs → an action picker of the valid options, preselected on the workflow's default
    • boolean inputs → a true/false picker, preselected on the default
    • free-form inputs (string/environment/unspecified) → a text field pre-filled with the default; accepts a custom value
    • a workflow with no inputs dispatches immediately; if the workflow YAML can't be read, the free-form composer is offered as a fallback
  2. Crash 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 added crashlog.GuardTUI. GuardTUI only guards the model's Init/Update/View on the main goroutine; a panic inside a tea.Cmd goroutine (run by Bubble Tea's execBatchMsg) becomes a fatal ErrProgramPanic that no report captures. Historical bubbletea-panic-*.log stacks pinpointed nil-client derefs in the GitHub loaders running in those goroutines.

    • New 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 stranded Loading… state.

Also fixed (found along the way)

  • Seven GitHub command functions (cancel run, merge PR, comment, request reviewers, close/reopen issue, create PR, assign self) still dereferenced a nil client in their goroutine — now guarded with a clear error toast.
  • crashlog.Write is now serialised (mutex) with collision-free filenames (atomic sequence); previously same-second reports could overwrite/corrupt each other once CaptureCmdPanic made writes concurrent and repeatable.

Testing

  • Full go test ./... — pass (pre- and post-rebase)
  • go vet ./..., golangci-lint ./... (0 issues), gofumpt -l . (clean), deadcode ./... (0 new), govulncheck ./... (no vulnerabilities)
  • New tests cover the choice/boolean/text/no-input/fallback paths, empty-value-keeps-default, the panic safety net + stranded-loading recovery, concurrent crash-report distinctness, and the nil-client guards. Coverage: gitinfo 81.6%, notify 89.4%, crashlog 87.5%.

Design + test plan: docs/specs/workflow-dispatch-param-picker/.

Follow-up to #362.

jongio and others added 3 commits July 24, 2026 17:39
…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
@jongio
jongio merged commit 8c3dc6f into main Jul 25, 2026
4 checks passed
@jongio
jongio deleted the go/workflow-dispatch-param-picker branch July 25, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant