MCPcopy Index your code
hub / github.com/coder/coder / summarizeBundle

Function summarizeBundle

cli/support.go:391–422  ·  view source on GitHub ↗

summarizeBundle makes a best-effort attempt to write a short summary of the support bundle to the user's terminal.

(inv *serpent.Invocation, bun *support.Bundle)

Source from the content-addressed store, hash-verified

389// summarizeBundle makes a best-effort attempt to write a short summary
390// of the support bundle to the user's terminal.
391func summarizeBundle(inv *serpent.Invocation, bun *support.Bundle) {
392 if bun == nil {
393 cliui.Error(inv.Stdout, "No support bundle generated!")
394 return
395 }
396
397 var docsURL string
398 if bun.Deployment.Config != nil {
399 docsURL = bun.Deployment.Config.Values.DocsURL.String()
400 } else {
401 cliui.Warn(inv.Stdout, "No deployment configuration available. This may require the Owner role.")
402 }
403
404 if bun.Deployment.HealthReport != nil {
405 deployHealthSummary := bun.Deployment.HealthReport.Summarize(docsURL)
406 if len(deployHealthSummary) > 0 {
407 cliui.Warn(inv.Stdout, "Deployment health issues detected:", deployHealthSummary...)
408 }
409 } else {
410 cliui.Warn(inv.Stdout, "No deployment health report available.")
411 }
412
413 if bun.Network.Netcheck == nil {
414 cliui.Error(inv.Stdout, "No network troubleshooting information available!")
415 return
416 }
417
418 clientNetcheckSummary := bun.Network.Netcheck.Summarize("Client netcheck:", docsURL)
419 if len(clientNetcheckSummary) > 0 {
420 cliui.Warn(inv.Stdout, "Networking issues detected:", clientNetcheckSummary...)
421 }
422}
423
424func findAgent(agentName string, haystack []codersdk.WorkspaceResource) (*codersdk.WorkspaceAgent, bool) {
425 for _, res := range haystack {

Callers 1

supportBundleMethod · 0.85

Calls 4

ErrorFunction · 0.92
WarnFunction · 0.92
StringMethod · 0.45
SummarizeMethod · 0.45

Tested by

no test coverage detected