[HDX-4997] Add alert detail page with evaluation history - #2798
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Greptile SummaryThe PR adds a dedicated alert-detail route for inspecting alert state, source data, evaluation history, and persisted evaluation errors.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/app/src/AlertDetailPage.tsx | Adds the alert-detail page shell, source actions, time-range state, chart, history strip, and paginated evaluation table. |
| packages/app/src/components/alerts/AlertDetailChart.tsx | Builds source-specific chart configurations for saved-search and dashboard-tile alerts, with graceful fallbacks for unsupported sources. |
| packages/app/src/api.ts | Adds single-alert retrieval and cursor-based infinite querying for evaluation history. |
| packages/app/src/components/alerts/AlertEvaluationsTable.tsx | Adds the evaluation event-stream table with state badges, values, breach counts, pagination, and expandable errors. |
| packages/app/src/AlertsPage.tsx | Adds detail-page navigation while preserving links to each alert's underlying saved search or dashboard tile. |
| packages/app/tests/e2e/features/alerts.spec.ts | Extends full-stack coverage for errored history segments and alert-detail navigation. |
Sequence Diagram
sequenceDiagram
participant User
participant Alerts as Alerts Page
participant Detail as Alert Detail Page
participant API as Alert API
participant Chart as Chart Query
User->>Alerts: Click Details
Alerts->>Detail: Navigate to /alerts/:id
Detail->>API: Fetch alert
Detail->>API: Fetch paginated evaluations
Detail->>API: Fetch alert-history annotations
Detail->>Chart: Query source over selected range
API-->>Detail: Alert and evaluation history
Chart-->>Detail: Time-series data
Detail-->>User: Chart, history strip, and event stream
Reviews (7): Last reviewed commit: "style(app): suppress new unsafe-type-ass..." | Re-trigger Greptile
|
<!-- deep-review --> Deep Review✅ No critical issues found. Note: 🟡 P2 -- recommended
🔵 P3 nitpicks (11)
Reviewers (8): correctness, testing, maintainability, project-standards, adversarial, kieran-typescript, performance, agent-native. Testing gaps:
Two reviewers disagreed on whether TanStack Query v5 replays stale infinite-query cursors on refetch; v5 recomputes page params from freshly fetched pages, so the proposed dropped-window scenario was dropped rather than reported. |
745f5dc to
4b3ec7b
Compare
E2E Test Results✅ All tests passed • 272 passed • 1 skipped • 1033s
Tests ran across 4 shards in parallel. |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
|
<!-- deep-review --> Deep Review
✅ No critical issues found. 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (1 of 12 returned): security. Dispatched but not returned before reporting: correctness, testing, maintainability, project-standards, kieran-typescript, adversarial, julik-frontend-races, performance, reliability, agent-native, learnings-researcher. Testing gaps:
|
4f44adf to
6a913c7
Compare
4fac62f to
6542632
Compare
6a913c7 to
3a29e53
Compare
|
<!-- deep-review --> Deep ReviewNote: 🔴 P0/P1 -- must fix
🟡 P2 -- recommended
🔵 P3 nitpicks (12)
Reviewers (10): correctness, adversarial, testing, maintainability, project-standards, kieran-typescript, api-contract, reliability, performance, agent-native. Testing gaps:
|
Datadog-style alert status page at /alerts/:id, reachable via a new Details link on each alerts-page row (the alert name keeps linking to its saved search / dashboard tile): - Header with state badge, silence/ack, source link, and a time picker. - The alert's underlying query charted over the selected range with threshold reference lines and firing/recovery annotations — via AlertPreviewChart for saved-search alerts and the tile's chart config for dashboard-tile alerts. - A widened evaluation-history strip (60 windows) reusing the alerts page segments, including errored evaluations. - An evaluation event stream: one row per window with state, latest value, breach count, and expandable error details, paginated via the new /alerts/:id/evaluations endpoint. Includes e2e coverage for errored history segments and the detail page, seeded through the fullstack global setup.
…DX-4997) ALERT_ERROR_TYPE_LABELS and AlertErrorsContent gain their first external consumer (AlertEvaluationsTable) in this layer — re-add the export that the base layer dropped to keep knip clean.
…nt budget main's automatic lint-fix pass (#2819) tightened the app --max-warnings budget to exactly the current count (663), so any new warning fails the merge-tree lint. Disable the rule for the two new grandfathered-pattern instances (partial test fixture, parseTimeQuery default-range idiom).
6542632 to
066e7c2
Compare
3a29e53 to
c4cc636
Compare
🔴 P0/P1 — must fix
🟡 P2 — recommended
🔵 P3 nitpicks (11)
Reviewers (11): correctness, adversarial, testing, maintainability, project-standards, api-contract, performance, security, reliability, agent-native, learnings-researcher. The TypeScript and frontend-races personas did not return before synthesis; their highest-value items (the avoidable Verified clean — no findings: Team scoping on both new endpoints is enforced in the Mongo filter itself ( Testing gaps:
|
Summary
Datadog-style alert status page at
/alerts/:id, reachable via a new Details link on each alerts-page row (the alert name keeps linking to its saved search / dashboard tile). Gives the error history persisted in #2797 a home where users can actually investigate an alert:AlertPreviewChartfor saved-search alerts and the tile's chart config for dashboard-tile alerts./alerts/:id/evaluationsendpoint from [HDX-4997] Persist alert evaluation errors and analytics in AlertHistory #2797.Refinements to the event stream (time-range-driven pagination, per-group breakdown, analytics columns) land in #2786 on top of this.
Screenshots or video
Each alert now has a Details page with the query chart, history strip, and the full evaluation event stream.
How to test on Vercel preview
N/A — needs the alerting job + seeded alert data. Covered by full-stack Playwright tests instead.
How this was tested
tsc --noEmit(app) andAlertEvaluationsTableunit tests green at this commitmake dev-e2e FILE=alerts)References