Repository navigation
feat(alerts): acknowledge incidents from Slack/Discord cards and in PagerDuty - #2289
Conversation
…agerDuty Alert cards posted to a chat channel for an open incident now carry an Acknowledge button (Unacknowledge once acked, with "Acknowledged by <name>"). A click reaches the chat-bot relay as an alert_ack:/alert_unack: control that names only the incident (a UUID, strictly decoded); the org always comes from the workspace the click landed in. The relay runs AlertIncidentAckService for that org (linked Maple user where the connector has identity, else the platform display name), then redraws the clicked card from the delivery that posted it, so the chart, values and template stay. A resolved or unknown incident gets a short private note instead. Acknowledging also queues a PagerDuty acknowledge in the same transaction: a new "acknowledge" delivery event type, queued only to the enabled pagerduty destinations of the rule or that already paged the incident, and drained by the alerting dispatcher like any delivery. It acks the current tier's dedup key, and for a critical incident of a tiered rule the warning key too. The dispatcher skips an ack the incident no longer holds (resolved, or an escalation cleared it) and never restarts the reminder clock for one. Unacknowledge sends nothing: PagerDuty has no un-acknowledge.
# Conflicts: # packages/web-data/src/alerts/incident-timeline.test.ts
…hem after a page Review fixes for the PagerDuty acknowledge sync: - The public API keeps its four notification event types. `acknowledge` deliveries are left out of /v2/alerts/deliveries, since shipped clients decode the event type as a closed enum. - An acknowledgement goes only to PagerDuty destinations that already delivered this incident's page, so it never reaches a pager that was not notified or lands before the page itself. - Both dedup keys are acknowledged when the rule pages critical under its own key or the incident ever peaked at critical. - The dispatcher reads the ack right before sending, so an escalation that committed after the claim is not silenced.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…rt-ack-chat # Conflicts: # packages/backend/src/services/alerts/delivery/transports/pagerduty.ts
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Maple review🟢 Confidence 10/10 · safe to merge. Production hunks were read end to end and every ack path is org-scoped; a real Slack/Discord click and the test-file diffs are unverified by me. Adds an Acknowledge/Unacknowledge control to Slack and Discord alert cards with an in-place redraw, and syncs a Maple acknowledgement to the PagerDuty destinations that already paged. Every path is scoped to the org of the workspace the click arrived in; safe to merge.
|
Part 3 of 3 of acknowledging alert incidents: #2287 (core, API, MCP) → #2288 (UI) → this PR: Slack/Discord buttons and PagerDuty sync. It is based on #2288.
What
Acknowledge from Slack and Discord alert cards
alert_ack:<uuid>andalert_unack:<uuid>, decoded strictly. The org always comes from the workspace the click arrived from (Slackteam.id, Discordguild_id), and both the ack and the card lookup are scoped to that org. A forged control can only name an incident in the clicker's own org.AlertChatCardServicerebuilds it from the delivery row that posted it, with the chart, values and template intact. A resolved or unknown incident gets a private note, not an error in the channel.apps/chat-bot. The alerting Worker imports neither new service.Maple → PagerDuty acknowledge (one way)
event_action: "acknowledge"in the ack's transaction, and the alerting dispatcher sends it. Unacknowledge sends nothing, because PagerDuty has no un-acknowledge. PagerDuty → Maple is out of scope.:criticalkey when the rule pages critical under its own key or the incident ever peaked at critical.acknowledgeis an internal delivery type. The v2 API keeps its four public event types and leaves acknowledgement syncs out of/v2/alerts/deliveries, because shipped iOS builds decode the event type as a closed enum.Verification
services/alertsandservices/pushpass. New ones cover:acknowledgerow (alerts.http.test.ts, 21 pass).ios:openapi:checkis up to date.Not verified: a real Slack or Discord click, because no workspace is linked locally or on previews. The relay uses the same
transport.editpath as agent approvals. Slack's click payload givesuser.name, which may be the handle rather than the display name.Follow-ups:
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit