Skip to content

feat(alerts): acknowledge incidents from Slack/Discord cards and in PagerDuty - #2289

Merged
Makisuo merged 18 commits into
feat/alert-ack-uifrom
feat/alert-ack-chat
Nov 6, 2026
Merged

Makisuo merged 18 commits into
feat/alert-ack-uifrom
feat/alert-ack-chat

Merge remote-tracking branch 'origin/feat/alert-ack-ui' into feat/ale…

8487a74
Select commit
Loading
Failed to load commit list.
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_unack controls and are redrawn in place after a click
  • AlertIncidentAckService queues acknowledge rows only for PagerDuty destinations that already paged
  • The PagerDuty acknowledge covers the base key and :critical when the rule tiers or the incident peaked
  • v2 deliveries and last_delivered_event_type hide the internal acknowledge type

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 value through, so alert_ack:<uuid> reaches the relay (slack/events.ts, discord/events.ts)
  • The redraw finds the card by providerReference = posted message id, and linkUrl/chatUrl are already stored in chat payloads (AlertDestinationDelivery.ts:185)
  • dispatchTierFields falls back to the stored rule's tiers, so criticalHasOwnKey is correct for an ack payload carrying no severities (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.