Skip to content

feat: Add alert history + ack to alert editor#2123

Merged
kodiakhq[bot] merged 2 commits intomainfrom
drew/alert-form-history
Apr 16, 2026
Merged

feat: Add alert history + ack to alert editor#2123
kodiakhq[bot] merged 2 commits intomainfrom
drew/alert-form-history

Conversation

@pulpdrew
Copy link
Copy Markdown
Contributor

Summary

This PR updates the alert editor forms with

  1. A history of alert states
  2. An option to Ack/Silence an alert that is firing

The components and much of the new GET /alert/:id endpoint are shared with the existing alert page functionality.

Screenshots or video

Screenshot 2026-04-15 at 10 26 23 AM Screenshot 2026-04-15 at 10 26 43 AM

How to test locally or on Vercel

This must be tested locally, since alerts are not supported in the preview environment.

References

  • Linear Issue: Closes HDX-3989
  • Related PRs:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: 4a5d172

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@hyperdx/common-utils Patch
@hyperdx/api Patch
@hyperdx/app Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the review/tier-3 Standard — full human review required label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Additional context: touches API routes or data models

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Files changed: 13
  • Lines changed: 921 (+ 87 in test files, excluded from tier calculation)
  • Branch: drew/alert-form-history
  • Author: pulpdrew

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Apr 16, 2026 1:52pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

PR Review

Clean refactoring with good test coverage. A few items worth noting:

  • ⚠️ History cards non-clickable in editor contextsAlertHistoryCardList is called without alertUrl in both DBSearchPageAlertModal and TileAlertEditor, so users see history state indicators but can't click through to the underlying data. On the Alerts page, cards are clickable links. If this is intentional for the editor, fine — but if click-through is desired, the alert's savedSearch or dashboard URL should be derived and passed.

  • ⚠️ console.error in production error handlers (DBSearchPageAlertModal.tsx:834, 842) — These were added alongside existing notifications.show() error handling. They'll appear in production browser consoles; remove or replace with a proper logger if this codebase has one.

  • ⚠️ formatAlertResponse defined in router, not controller — This non-trivial formatting logic (picking fields, transforming populated Mongoose docs) lives in routers/api/alerts.ts rather than controllers/alerts.ts. It's reused across two endpoints in the same file, so it works, but it's more testable and appropriately placed in the controller layer.

  • ✅ New GET /alerts/:id endpoint correctly scopes to team via { _id: alertId, team: teamId } — no authorization bypass risk.

  • enabled: alertId != null guard on useAlert prevents spurious fetches for new (unsaved) alerts.

  • ✅ Good integration test coverage for the new endpoint (404, empty history, and populated history cases).

@pulpdrew pulpdrew force-pushed the drew/alert-form-history branch from 11f8c38 to 940e93a Compare April 15, 2026 14:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

E2E Test Results

All tests passed • 131 passed • 3 skipped • 1094s

Status Count
✅ Passed 131
❌ Failed 0
⚠️ Flaky 5
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

@@ -0,0 +1,190 @@
import * as React from 'react';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just relocated from AlertsPage.tsx

@@ -0,0 +1,102 @@
import * as React from 'react';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just relocated from AlertsPage.tsx

@pulpdrew pulpdrew requested review from a team and karl-power and removed request for a team April 15, 2026 14:47
@kodiakhq kodiakhq bot merged commit 6ff1ba6 into main Apr 16, 2026
17 checks passed
@kodiakhq kodiakhq bot deleted the drew/alert-form-history branch April 16, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants