refactor(ic-dashboard): remove legacy metric fetches - #208
Conversation
📝 WalkthroughWalkthroughThe dashboard now uses metric-collection data exclusively for KPI tiles, attention items, metric groups, and drilldowns. Legacy KPI and attention builders are removed, and new tests cover metric-driven rendering, loading/error states, omitted groups, retries, and drilldown behavior. ChangesMetric dashboard migration
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
With every metric family on the unified /v1/metric-results path, the /metrics/queries and /catalog/get_metrics fetches were dead over-fetch. Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
9e0ada9 to
5c3cee3
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/screens/ic-dashboard/engineering-dashboard-v2.test.tsx (1)
42-47: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winAssert the lazy drilldown query contract.
These tests only verify the sheet’s
openflag. CaptureuseMetricCollectioncalls and assert that closed sheets use the disabled target, opening selects the clicked group’s full collection, and changing people disables that query again.Also applies to: 193-220
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/screens/ic-dashboard/engineering-dashboard-v2.test.tsx` around lines 42 - 47, Extend the tests around the mocked useMetricCollection and sheet interactions to capture each query call and assert the lazy drilldown contract: closed sheets pass the disabled target, opening a sheet queries the clicked group’s full collection, and changing people disables the query again. Update the related cases around the sheet assertions while preserving the existing open-flag checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/screens/ic-dashboard/engineering-dashboard-v2.test.tsx`:
- Around line 42-47: Extend the tests around the mocked useMetricCollection and
sheet interactions to capture each query call and assert the lazy drilldown
contract: closed sheets pass the disabled target, opening a sheet queries the
clicked group’s full collection, and changing people disables the query again.
Update the related cases around the sheet assertions while preserving the
existing open-flag checks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2d7b4a50-9d8b-45e2-9d02-ded61655ba7b
📒 Files selected for processing (6)
src/lib/insight/attention.test.tssrc/lib/insight/attention.tssrc/lib/insight/kpi-row.test.tssrc/lib/insight/kpi-row.tssrc/screens/ic-dashboard/engineering-dashboard-v2.test.tsxsrc/screens/ic-dashboard/engineering-dashboard-v2.tsx
What
EngineeringDashboardV2no longer issues the legacy/metrics/queriesor/catalog/get_metricsrequests. Every metric family is now served by the unified/v1/metric-resultspath, so the legacy batch and catalog results were fetched and immediately discarded — dead over-fetch on the IC dashboard load.Changes
useIcDashboardData/useCatalogfrom the v2 dashboard and the scaffolding they fed (LEGACY_GROUP_FEEDS,legacyRowsByGroup,legacyKpiTiles,legacyKpiLabels,legacyAttentionItems).metricGroups(); the KPI row and the attention surface are unified-only.legacyKpiTiles,kpiRowTiles,legacyAttentionItemsand their tests.Shared
LegacyGroup/KpiTileSourcetypes and theuseIcDashboardData/useCataloghooks are kept — the v1 dashboard and the team view still consume them.Summary by CodeRabbit