Repository navigation
feat(alerts): acknowledge incidents from Slack/Discord cards and in PagerDuty - #2289
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 6, 2026 in 4m 17s
Confidence 10/10 · No issues found
🟢 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.
no findings · tests covered · risk high · 4/4 new units observable
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.
- Alert cards carry
alert_ack/alert_unackcontrols and are redrawn in place after a click AlertIncidentAckServicequeuesacknowledgerows only for PagerDuty destinations that already paged- The PagerDuty acknowledge covers the base key and
:criticalwhen the rule tiers or the incident peaked - v2 deliveries and
last_delivered_event_typehide the internalacknowledgetype
Production impact
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
packages/backend/src/services/alerts/delivery/transports/linear.ts |
26 | test 26/day, 18.9% err |
packages/backend/src/services/push/MobilePushService.ts |
26 | test 26/day, 18.9% err |
packages/domain/src/http/alerts.ts |
26 | test 26/day, 18.9% err |
Telemetry this change adds and removes (6)
- ➕ span name
ChatBotRelay.settleAlertAck·apps/chat-bot/src/relay/turn.ts:612 - ➕ attribute
maple.chat.alert_ack.action·apps/chat-bot/src/relay/turn.ts:619 - ➕ attribute
maple.chat.alert_ack·apps/chat-bot/src/relay/turn.ts:628 - ➕ span name
AlertChatCardService.cardForMessage·packages/backend/src/services/alerts/AlertChatCardService.ts:52 - ➕ attribute
maple.alert.card_found·packages/backend/src/services/alerts/AlertChatCardService.ts:89 - ➕ attribute
maple.alert.pagerduty_acks_queued·packages/backend/src/services/alerts/AlertIncidentAckService.ts:254
What was checked
- Slack and Discord interaction parsing passes any button
valuethrough, soalert_ack:<uuid>reaches the relay (slack/events.ts,discord/events.ts) - The redraw finds the card by
providerReference= posted message id, andlinkUrl/chatUrlare already stored in chat payloads (AlertDestinationDelivery.ts:185) dispatchTierFieldsfalls back to the stored rule's tiers, socriticalHasOwnKeyis correct for an ack payload carrying noseverities(AlertsService.ts:298)
Observability coverage: 4 of 4 changes observable
| Change | Kind | Observable | Evidence |
|---|---|---|---|
| Slack/Discord alert-card acknowledge click (relay settle) | inbound click branch | yes | Effect.fn("ChatBotRelay.settleAlertAck") span with maple.chat.alert_ack.* attributes (apps/chat-bot/src/relay/turn.ts, run.ts) |
Card redraw from the delivery row (AlertChatCardService.cardForMessage) |
DB read + chat edit | yes | maple.alert.incident_id, maple.alert.card_found on the named span; edit goes through the connector's edit request |
| PagerDuty acknowledge request | outbound HTTP | yes | transport declares peerService: "pagerduty"; dispatcher records deliveryAttemptDurationMs, deliveriesSucceededTotal and the deliveryKey success log |
| Ack → PagerDuty queueing and stale-ack skip | background delivery work | yes | maple.alert.pagerduty_acks_queued/maple.alert.ack_changed on the ack span; skip recorded as Skipped: the incident is no longer acknowledged |
8487a74 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading