Skip to content

fix(resources): show derived pod readiness on the Phase row, not just Running#571

Merged
nadaverell merged 2 commits intomainfrom
feat/fix-pod-health-visual-hierarchy-phase-vs-ready
May 2, 2026
Merged

fix(resources): show derived pod readiness on the Phase row, not just Running#571
nadaverell merged 2 commits intomainfrom
feat/fix-pod-health-visual-hierarchy-phase-vs-ready

Conversation

@eliran-ops
Copy link
Copy Markdown
Contributor

@eliran-ops eliran-ops commented Apr 29, 2026

Summary

Fixes two reported pod-detail bugs on app.radarhq.io that share the same root cause: the pod side panel rendered pod.status.phase verbatim in the Phase property row, so a pod that the rest of the panel clearly flagged as broken still read as a healthy "Running" in the Phase row. Linear: SKY-819.

The bugs:

  1. Pod detail panel showed Phase: Running while the same panel header showed Running (0/1) with an "Issues Detected / Not Ready" alert.
  2. The resource side panel showed Phase: Running + green status icon alongside 6,301 restarts and Last exit: Completed 6m ago — visual hierarchy implied the pod was healthy when it was clearly cycling.

Fix

  • New helper getPodPhaseDisplay(pod) in resource-utils.ts. Pure, unit-tested. Derives a richer "Phase" from the raw phase plus ready-ratio, restart count, container-state reasons, and deletionTimestamp. Returns:
    • phase — the verbatim API field (kubectl correlation never lost)
    • text — phase + a derived qualifier:
      • Running — Not Ready (0/1)
      • Running — Restarting (6301 restarts)
      • Running — Not Ready (0/1), 6301 restarts
      • Running — CrashLoopBackOff / OOMKilled / ImagePullBackOff
      • Running — Terminating when deletionTimestamp is set
    • levelHealthLevel for tinting; mirrors the panel header so the row colour matches the badge / icon shown above
    • hint — optional one-liner surfaced via tooltip
  • PodRenderer now renders the Phase row using that display, tinted via healthColors[level], with the hint as a tooltip when present. The verbatim phase is always preserved in the helper output for debugging.

Test plan

  • cd packages/k8s-ui && npm test — 80 passed (13 new in get-pod-phase-display.test.ts, covering all SKY-819 fixture shapes plus the cycling-threshold boundary).
  • cd web && npm run tsc — clean.
  • cd web && npm run build — clean.
  • Manual smoke once deployed: open a pod with 0/1 ready → Phase row reads "Running — Not Ready (0/1)" in the degraded colour and matches the panel header.

Made with Cursor


Note

Low Risk
Low risk: UI-only change that derives and displays a richer pod phase string from existing pod status fields, backed by unit tests; no API/auth/data persistence changes.

Overview
Updates the pod details side panel so the Phase row no longer shows raw pod.status.phase only, but a derived, color-tinted status (with optional tooltip hint) that reflects readiness ratio, restart cycling, termination, and common container failure reasons.

Adds a new getPodPhaseDisplay() helper in resource-utils.ts plus a dedicated Vitest suite covering readiness/restart thresholds, multi-container pods, terminating pods, and failure states like CrashLoopBackOff, image pull errors, and OOMKilled (while preserving the raw phase field for correlation).

Reviewed by Cursor Bugbot for commit 000957b. Bugbot is set up for automated code reviews on this repo. Configure here.

… Running

The pod detail/side panel rendered `pod.status.phase` verbatim in the
"Phase" property row. On a Running-but-not-ready pod (e.g. 0/1
containers ready), or one that's clearly cycling (thousands of restarts,
last-exit Completed minutes ago), the row therefore read as a healthy
"Running" — directly contradicting the panel header ("Running (0/1)"),
the green/red status badge, and the Issues Detected banner above it.
SKY-819 captured two real reports of users reading the Phase row top-down
and concluding the pod was healthy when it wasn't.

This change adds `getPodPhaseDisplay(pod)` next to `getPodStatus` in
`resource-utils.ts`. It returns:
  - `phase`  — the verbatim API field, never lost (kubectl correlation)
  - `text`   — phase + a derived qualifier:
                 "Running — Not Ready (0/1)"
                 "Running — Restarting (6301 restarts)"
                 "Running — Not Ready (0/1), 6301 restarts" (both)
                 "Running — CrashLoopBackOff" / "OOMKilled" / etc.
                 "Running — Terminating" when deletionTimestamp set
  - `level`  — HealthLevel for tinting; mirrors the panel header so the
               row colour matches the badge / icon shown above.
  - `hint`   — optional one-liner surfaced via tooltip explaining why the
               state was downgraded.

PodRenderer now renders the Phase Property using that display, tinted
via `healthColors[level]`, with the hint as a tooltip when present.

Pure helper, full unit coverage in `get-pod-phase-display.test.ts`
(13 cases including the boundary at the cycling threshold and all the
fixture shapes from SKY-819).

Linear: SKY-819
Made-with: Cursor
… coverage

Container-state failure detection now skips when phase is Succeeded so a Job
pod whose sidecar was OOMKilled before the main container completed reads
"Completed" rather than "Succeeded — OOMKilled / unhealthy".

Adds test fixtures for ErrImagePull, CreateContainerConfigError, multi-container
partial readiness, restart sums across containers, and the Succeeded+sidecar
gate. Strips ticket/diff-history references from comments.
@nadaverell nadaverell merged commit d1e0ee6 into main May 2, 2026
8 checks passed
@nadaverell nadaverell deleted the feat/fix-pod-health-visual-hierarchy-phase-vs-ready branch May 2, 2026 15:59
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.

3 participants