Repository navigation
refactor(machine): extract diagnostics daemon render steps - #1582
Conversation
Split renderDiagnosticsText into renderDaemonDiagnostics, renderLastDaemonError, and renderShutdownCandidate, removing the nestif nolint. Centralize local time formatting in formatLocalTime/optionalLocalTime. Add table-driven tests covering the render output.
✅ Deploy Preview for images-devsy-sh canceled.
|
✅ Deploy Preview for devsydev canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Summary
renderDiagnosticsTextincmd/machine/diagnostics.gointorenderDaemonDiagnostics,renderLastDaemonError, andrenderShutdownCandidate; removes the//nolint:nestifblock.formatLocalTime/optionalLocalTimewith alocalTimeLayoutconst; replaces 5 inline format sites.renderDiagnosticsText(TestRenderDiagnosticsTextWithoutDaemon,TestRenderDiagnosticsTextWithDaemon,TestRenderDiagnosticsTextFullReport) written against the unmodified code first.Verification
go vetclean;gofmtclean.go test ./cmd/machine/ ./pkg/machinediagnostics/ -count=1passes;TestRenderDiagnosticsText*also pass underTZ=America/New_YorkandTZ=Asia/Kolkata.golangci-lint run ./cmd/machine/... ./pkg/machinediagnostics/...: 3 findings, all pre-existing in untouched code (status.goforbidigo,ssh.gofunlen,ssh.gomodernize). No new findings.mise run cli:lintreports 275 pre-existing issues on the base branch, unrelated to this change.WebSocket closedin--agent, plain, and--dirmodes, althoughcoderabbit doctorpasses. No CLI findings were obtained.Notes
e85ba7401is signed.cmd/machine/diagnostics.go~100 changed lines; the rest is test code.Summary by CodeRabbit