Skip to content

feat: import alerts api - #1849

Open
pratik50 wants to merge 2 commits into
parseablehq:mainfrom
pratik50:feat/import-alerts-by-target-title
Open

pratik50 wants to merge 2 commits into
parseablehq:mainfrom
pratik50:feat/import-alerts-by-target-title

Conversation

@pratik50

@pratik50 pratik50 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Add POST /api/v1/alerts/import with target titles in targets.
  • Resolve titles within the tenant, then use the normal alert creation flow.
  • Reject missing or ambiguous target titles.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the remaining test coverage gap is non-blocking.

Findings

  1. P2 Import checks lack tests ▶

Summary

Adds POST /api/v1/alerts/import to create alerts using target titles.

  • Alert imports can use target titles and create alerts through the usual flow.

Reviews (2) · Last reviewed commit: "test: cover alert import api" · Reviewed by Greptile

Comment on lines +279 to +284
let mut ids_by_title = HashMap::new();
for target in TARGETS.list(&tenant_id).await? {
ids_by_title
.entry(target.name)
.or_insert_with(Vec::new)
.push(target.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Import checks lack tests

import_alert adds title matching, ambiguity checks, and tenant-specific lookup without tests for these behaviors. Add handler tests for a successful import, missing and duplicate titles, malformed targets, and a title that exists only in another tenant. These would catch changes that reject valid imports or attach the wrong target.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant