[SLO] Charts: derive window from type, no false-green on missing burn data, dataviz polish - #2832
[SLO] Charts: derive window from type, no false-green on missing burn data, dataviz polish#2832lezzago wants to merge 5 commits into
Conversation
PR Code Suggestions ✨Latest suggestions up to 99d87f0 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 652f47c
Suggestions up to commit c7decbe
Suggestions up to commit 7dbee1a
Suggestions up to commit 6957798
Suggestions up to commit 4314a73
|
PR Reviewer Guide 🔍(Review updated until commit 99d87f0)Here are some key observations to aid the review process:
|
…ata, chart polish
Audit fixes for SLO dataviz surfaces:
- M1: derive the budget chart's window from the SLO spec instead of
hardcoding '30d'; calendar-aligned SLOs are now described as calendar
(with an equivalent rolling range) rather than mislabeled as rolling 30d.
- M2: classifyTier now returns 'no_data' when either burn window is
null/undefined/non-finite, so absent data no longer coerces to 0 and
paints green 'healthy'; no_data renders subdued/grey.
- CLAR5: tier health labels are title case ('Firing'/'Healthy'/'No data')
and the invented 'warming' jargon is replaced with 'At risk'.
- CLAR6: the tier subtitle routes the raw severity enum through a label map.
- m1: the budget chart's 'exhausted' reference markLine is dashed, not solid.
- m2: breached series/bars carry a redundant non-color cue (dashed stroke +
marker on the budget line, diagonal hatch on the burn bar) for WCAG 1.4.1.
- m3: chart tooltips label the timezone (dateFormat:tz) and show the delta
versus the target/threshold where meaningful.
- m4: the services-home budget sparkline no longer smooths step data, so
short-lived burn spikes stay visible.
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
6957798 to
7dbee1a
Compare
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 7dbee1a. ⛔ Hard block: Issues at High severity or above will block this PR from merging.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 7dbee1a |
…dening) The Code-Diff-Analyzer flagged two medium findings: the burn-rate and budget-remaining chart tooltip formatters return raw HTML built by interpolating dynamic values (series/tier names, the ECharts series colour, the tz-formatted timestamp, and formatted percentages/deltas) without escaping. Series names and label values can originate from SLO/Prometheus data, so an angle-bracket or quote could break out of the markup — a stored-XSS vector in the tooltip render path. Adds a small escapeHtml() in each chart and wraps every dynamic value interpolated into the tooltip strings (color, seriesName, timestamp, formatMultiplier/formatPct outputs, delta line). euiThemeVars colours are build-time constants and left as-is. No behavioural change to the tooltip content; charts/tests unchanged (24 pass). Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
|
Persistent review updated to latest commit c7decbe |
…tency The over/under delta span was the one value in the burn-rate tooltip formatter still interpolated without escapeHtml, while color, series name, timestamp and multiplier all pass through it. Route the theme color and formatMultiplier output through escapeHtml too so the whole formatter upholds the same escaping invariant (defense-in-depth). Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
|
Persistent review updated to latest commit 652f47c |
…urfaces at SLO_PRECISION.budget The budget-remaining chart tooltip/axis/threshold label and the budget sparkline called formatPct() with no decimals (default 1), while the budget panel renders the same value at SLO_PRECISION.budget (2) — so 0.5 read '50.0%' in the chart but '50.00%' in the panel. Route all these budget-value formatPct calls through SLO_PRECISION.budget so every budget surface reads from the single precision policy. Tests updated for the 2-decimal output. Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
|
Cross-referencing @TackAdam's precision finding on #2836 (item 1): the budget-remaining chart tooltip/axis/threshold label and the budget sparkline live in this PR's files, so the fix landed here in |
|
Persistent review updated to latest commit 99d87f0 |
What & why
Derives the window from
window.type(kills a hard-coded '30d'), renders a null/empty window asno_datainstead of false-green, dashes the reference line, adds non-hue status encoding, UTC + delta-vs-target tooltips, andsmooth:falseover step data.Findings: M1, M2, CLAR5, CLAR6, m1, m2, m3, m4.
Before / after
Before / after
Testing
chart/panel tests (
classifyTiernull-window, etc.). Centrally green. Note: the local stack has no burn data, so these data-dependent deltas are near-identical on screen — correctness is covered by jest and flagged for managed-env re-verify.Review
Independent review agent: PASS — verified all eight fixes; refuted two out-of-scope observations.
Regression check
The before/after above is a full-viewport capture, so adjacent components on the same surface are visible and unchanged — the diff is scoped to what's called out. Cross-component safety is also verified centrally: this change is file-disjoint from the other in-flight audit fixes (no file overlap, so it merges cleanly with them), and the affected plugin test suites pass with 0 new type errors vs
main. Aside from the merge-order note below, it can be reviewed, merged, and reverted independently.Dependency
None.