Skip to content

feat: summarize health checks and add verbose output - #445

Draft
federicobozzini wants to merge 2 commits into
mainfrom
health-reshaping
Draft

feat: summarize health checks and add verbose output#445
federicobozzini wants to merge 2 commits into
mainfrom
health-reshaping

Conversation

@federicobozzini

@federicobozzini federicobozzini commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Changes

  • topo health only shows errors and warnings
  • a successful summary is shown when topo health doesn't report any issue
  • a verbose flag is introduced to report the result of all checks

Screenshot

$ topo health  --target pi5-rod
┌─ Host ────────────────────────────────────────────────
 ✓ All checks passed

┌─ Target: ssh://pi5-rod ───────────────────────────────
 ✓ All checks passed
 i Processing Domain Driver (remoteproc) (no remoteproc devices found)

Checklist

  • 🤖 This change is covered by tests as required.
  • 🤹 All required manual testing has been performed.
  • 📖 All documentation updates are complete.

@federicobozzini
federicobozzini requested a review from a team as a code owner September 7, 2026 09:39
@federicobozzini
federicobozzini marked this pull request as draft September 7, 2026 09:45
@federicobozzini
federicobozzini force-pushed the health-reshaping branch 2 times, most recently from 8357d9d to 4c85465 Compare September 7, 2026 09:46
})

t.Run("it renders an info icon for info checks", func(t *testing.T) {
t.Run("it renders remoteproc info without suppressing the success summary", func(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test now conflates two things: info icon and suppression of the success message. We should probably have a test evaluating all icons.

Comment thread internal/output/views/health_test.go Outdated
func TestHealthReport(t *testing.T) {
t.Run("PlainFormat", func(t *testing.T) {
t.Run("it renders the healthy host dependencies", func(t *testing.T) {
t.Run("it renders a generic result for healthy host and target sections", func(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's "a generic result"? It's not obvious to me what this is actually testing now.

We should make three cases obvious:

  1. renders summaries if all checks pass in verbose=true mode
  2. renders details of failing checks details in verbose=false mode
  3. renders "all good" summary and no details in verbose=false mode

Comment thread internal/output/views/health.go Outdated
Host health.HostReport `json:"host"`
Target *health.TargetReport `json:"target,omitempty"`
TargetHint string `json:"-"`
Verbose bool `json:"-"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't feel like Verbose belongs here. These are contents of a health report, verbose adds "how to print it", which doesn't belong here.

Comment thread internal/output/views/health.go Outdated
Comment on lines 20 to 34
type healthCheckSection struct {
ShowPassedSummary bool
Checks []health.HealthCheck
}

type healthTargetSection struct {
Destination string
Section healthCheckSection
}

type plainHealthReport struct {
Host healthCheckSection
Target *healthTargetSection
TargetHint string
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need all these new types? What purpose do they serve? I find it a bit confusing. It could be the naming (what is plain?) or the purpose (why new types if all we do is display "All good" if all checks pass).

Signed-off-by: Federico Bozzini <federico.bozzini@arm.com>
Signed-off-by: Federico Bozzini <federico.bozzini@arm.com>
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.

2 participants