From bd5a462a1ef3358a6fb108742972e334c3b564d4 Mon Sep 17 00:00:00 2001 From: Torsten Ueberschar Date: Sun, 19 Apr 2026 14:25:38 +0200 Subject: [PATCH] =?UTF-8?q?v2.0.15=20=E2=80=94=20oumta-dashboard:=20dot=20?= =?UTF-8?q?color=20follows=20cluster=20outcome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The per-cluster dot now reflects how the workload ended up after the cluster's events, not the worst thing that happened inside it: if the most recent state transition in the cluster was "-> healthy", the dot turns green even when the cluster contains earlier degraded/warning events. Falls back to the existing dominantSev logic for clusters without any state transition (e.g. rollout-only clusters). Matches the reality that a rollout which briefly degrades and then recovers is a normal, healthy outcome — not a "warning" forever. Co-Authored-By: Claude Opus 4.7 (1M context) --- config.php | 2 +- .../oumta-dashboard/oumta-dashboard.js | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/config.php b/config.php index d51e600..4c5c3bc 100644 --- a/config.php +++ b/config.php @@ -1,7 +1,7 @@ healthy" shows a + * green dot even if it contains degraded/warning events along the way. + * Returns null when no state-change event is present; callers fall + * back to dominantSev in that case (e.g. rollout-only clusters). */ +function clusterOutcomeSev(events) { + for (const e of events) { + const m = /->\s*(\w+)\s*$/.exec(e.message || ''); + if (!m) continue; + switch (m[1]) { + case 'healthy': return 'recovered'; + case 'degraded': return 'warning'; + case 'unavailable': return 'error'; + } + } + return null; +} + function sameDay(a, b) { const da = new Date(a), db = new Date(b); return da.getFullYear() === db.getFullYear() @@ -336,7 +356,7 @@ function renderTimeline() { let lastDate = null; body.innerHTML = clusters.map(cluster => { - const sev = dominantSev(cluster.events); + const sev = clusterOutcomeSev(cluster.events) || dominantSev(cluster.events); const showDate = !lastDate || !sameDay(lastDate, cluster.ts); lastDate = cluster.ts; const d = new Date(cluster.ts);