feat(notify): name regions and link the console in alerts; consent to subscribe
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m8s
ci / test (pull_request) Successful in 13m45s
ci / build (pull_request) Successful in 19m0s
ci / image (pull_request) Successful in 6m5s

Alert mails and chat messages named regions by id. They now show the
region's name and mails link the monitor in the console.

Visitors of a status page accept the platform's terms and the page's
privacy policy, where set, before they can subscribe to it; the status
page server and the API both check it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-26 20:16:28 +01:00
1 parent cca4e80e54
commit 2d4bd10c9b
16 files changed
+660 -479

No files matched your search

+6 -1
View File
@@ -578,7 +578,10 @@ const notificationDetails = `-- name: NotificationDetails :many
SELECT n.id, n.org_id, n.event, n.attempts,
c.type AS channel_type, c.config AS channel_config, c.id AS channel_id,
i.id AS incident_id, i.started_at, i.resolved_at, i.cause,
m.id AS monitor_id, m.name AS monitor_name, m.target AS monitor_target, m.type AS monitor_type
m.id AS monitor_id, m.name AS monitor_name, m.target AS monitor_target, m.type AS monitor_type,
-- The names of the regions the cause names by id.
coalesce((SELECT jsonb_object_agg(r.id::text, r.name) FROM regions r
WHERE jsonb_typeof(i.cause) = 'object' AND i.cause ? r.id::text), '{}')::jsonb AS region_names
FROM notifications n
JOIN notification_channels c ON c.id = n.channel_id
JOIN incidents i ON i.id = n.incident_id
@@ -602,6 +605,7 @@ type NotificationDetailsRow struct {
MonitorName string
MonitorTarget string
MonitorType string
RegionNames []byte
}
// System scope.
@@ -630,6 +634,7 @@ func (q *Queries) NotificationDetails(ctx context.Context, ids []uuid.UUID) ([]N
&i.MonitorName,
&i.MonitorTarget,
&i.MonitorType,
&i.RegionNames,
); err != nil {
return nil, err
}
+4 -1
View File
@@ -47,7 +47,10 @@ RETURNING id;
SELECT n.id, n.org_id, n.event, n.attempts,
c.type AS channel_type, c.config AS channel_config, c.id AS channel_id,
i.id AS incident_id, i.started_at, i.resolved_at, i.cause,
m.id AS monitor_id, m.name AS monitor_name, m.target AS monitor_target, m.type AS monitor_type
m.id AS monitor_id, m.name AS monitor_name, m.target AS monitor_target, m.type AS monitor_type,
-- The names of the regions the cause names by id.
coalesce((SELECT jsonb_object_agg(r.id::text, r.name) FROM regions r
WHERE jsonb_typeof(i.cause) = 'object' AND i.cause ? r.id::text), '{}')::jsonb AS region_names
FROM notifications n
JOIN notification_channels c ON c.id = n.channel_id
JOIN incidents i ON i.id = n.incident_id