MCPcopy Create free account
hub / github.com/github/gh-aw / outputHealthTable

Function outputHealthTable

pkg/cli/health_command.go:321–338  ·  view source on GitHub ↗

outputHealthTable outputs health summary as a formatted table

(summary HealthSummary, threshold float64)

Source from the content-addressed store, hash-verified

319
320// outputHealthTable outputs health summary as a formatted table
321func outputHealthTable(summary HealthSummary, threshold float64) error {
322 fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Workflow Health Summary (%s)", summary.Period)))
323 fmt.Fprintln(os.Stderr, "")
324
325 // Render table
326 fmt.Fprint(os.Stderr, console.RenderStruct(summary.Workflows))
327 fmt.Fprintln(os.Stderr, "")
328
329 // Display summary message
330 if summary.BelowThreshold > 0 {
331 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("%d workflow(s) below %.0f%% success threshold", summary.BelowThreshold, threshold)))
332 fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Run '%s health <workflow-name>' for details", string(constants.CLIExtensionPrefix))))
333 } else {
334 fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("All workflows above %.0f%% success threshold", threshold)))
335 }
336
337 return nil
338}

Callers 1

displayHealthSummaryFunction · 0.85

Calls 4

FormatInfoMessageFunction · 0.92
RenderStructFunction · 0.92
FormatWarningMessageFunction · 0.92
FormatSuccessMessageFunction · 0.92

Tested by

no test coverage detected