Hive
fix(server, noora): apply runner metrics step-hover via Noora’s chart instance
GitHub issue · Closed
What
Fixes the runner-job step-hover correlation — hovering a CI step on the Overview is supposed to shade that step’s time window across the CPU/Memory/Network charts, but the band never appeared in production.
Why it was broken
The RunnerMetricsHighlight hook resolved each chart’s ECharts instance with echarts.getInstanceByDom, imported from the server’s ECharts. But the charts are created by Noora’s own ECharts copy, which is inlined into noora.js (a ~1.4 MB prebuilt bundle the server aliases). getInstanceByDom only resolves instances registered in the calling module’s ECharts registry, so a lookup from a different copy returns nothing — the markArea band was never applied.
It appeared to work in some local builds only because the bundle there happened to share a single ECharts; the production asset pipeline does not.
How
- Noora (
Chart.js): expose the live instance on the chart element as__nooraChart(set inrender, cleared indestroyed). - Server (
RunnerMetricsHighlight.js): read that object directly and callsetOptionon it, and drop the server-sideechartsimport entirely. The hover/epoch-parsing logic is unchanged — only the instance resolution.
This makes the correlation independent of how many ECharts copies a consumer bundles, and removes a redundant ECharts dependency from the app bundle.
Validation
- Rebuilt
noora.js(__nooraChartpresent) and confirmed the server app bundle (priv/static/app/assets/bundle.js, rebuilt by the esbuild watcher) now reads__nooraChartand no longer callsgetInstanceByDomfrom the hook. - A full live repro on the runner Overview was blocked locally by a disk-full dev environment (the Elixir compile/migrate/seed couldn’t complete), so the build-level verification above stands in for the runtime check. The change is JS-only and directly addresses the confirmed two-ECharts-copies root cause; it’s straightforward to confirm on staging/prod once deployed (hover a step → the band shades the matching window).
🤖 Generated with Claude Code
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.