Ruben Fiszel
717e38a0c6
feat: let a workspace fall back to the instance critical alert channels ( #10292 )
...
* feat(alerts): let a workspace fall back to the instance critical alert channels
A workspace with no error handler had no way to surface failed jobs, and the
instance critical alert channels a superadmin already configured (Slack, Teams,
email) were unreachable from a workspace: the workspace Slack error handler
posts with the workspace's own bot token, not the instance one.
Adds an opt-in workspace setting that reports failed jobs to those channels
when, and only when, no workspace error handler is configured. The report is
send-only: it skips the `alerts` table so workspace job failures never flood the
instance-wide feed superadmins triage.
Rejected on cloud (the channels belong to the instance operator, who is not the
tenant) and on fork workspaces (throwaway copies of a parent's runnables).
Settable from workspace settings and from the new-workspace screen.
The opt-in and the existing `mute_critical_alerts` flag are folded into the
query already behind WORKSPACE_ERROR_HANDLER_CACHE, so a failed job costs no
extra round trip, and workspaces with neither a handler nor the opt-in return
before the per-runnable mute lookup.
* chore(sqlx): add offline query cache entries for the new settings queries
* refactor(alerts): make instance alerts a destination tab and address review
Instance alerts are a fifth error-handler destination rather than a separate
toggle: the backend already treats them as mutually exclusive with a handler
script, so one "where do failures go?" control matches the semantics and drops
the inert-while-a-handler-is-set state. The tab is offered on the workspace
error handler only, not on schedules or triggers.
Review fixes:
- the fork boundary is enforced at dispatch (join on parent_workspace_id), so a
workspace attached as a fork/dev after opting in stops reporting; attaching
also clears the stored flag, and the settings page never selects a tab it does
not render, which would have submitted a value the API rejects on a fork
- mute_critical_alerts no longer gates this path: it is the UI-feed mute, and
this path writes no feed entry
- cancellations are not reported: they are a human action, and this destination
has no per-workspace mute of its own
- per-workspace throttle with a rollup count, so a flapping runnable cannot turn
into unbounded Slack/SMTP traffic on channels shared by the whole instance
- log the dispatch, audit the flag, name the columns in the rename INSERT, drop
the generated migration placeholders
* chore(alerts): state the fork/cloud invariant on canUseInstanceAlerts
* chore(sqlx): cache the attach_dev_workspace settings update
2026-07-24 09:58:27 +02:00
..
2026-07-22 13:03:37 +02:00
2026-07-23 18:31:40 +02:00
2026-04-27 12:56:28 +00:00
2026-03-05 18:11:40 +01:00
2026-07-16 11:17:20 +02:00
2026-07-21 15:10:29 +00:00
2026-07-23 23:03:25 +02:00
2026-05-20 12:57:29 +00:00
2026-04-13 17:10:37 +00:00
2026-06-11 07:49:02 +00:00
2026-07-23 23:21:24 +02:00
2026-07-24 00:20:38 +02:00
2026-07-21 15:10:29 +00:00
2026-07-02 23:30:28 +02:00
2026-07-21 15:10:29 +00:00
2026-07-11 23:46:34 +02:00
2026-01-08 06:29:49 +00:00
2026-07-17 00:15:34 +02:00
2026-07-07 14:27:00 +02:00
2026-07-21 07:34:44 +02:00
2025-10-22 15:56:36 +00:00
2026-04-29 15:53:34 +00:00
2026-05-22 14:27:49 +00:00
2026-07-22 13:03:37 +02:00
2026-07-23 18:31:40 +02:00
2026-05-04 15:01:06 +00:00
2026-07-15 17:55:21 +02:00
2026-04-03 17:39:32 +00:00
2026-04-21 21:07:48 +00:00
2026-06-18 18:09:02 +02:00
2026-06-15 10:23:16 +02:00
2026-07-21 15:10:29 +00:00
2026-05-28 14:48:54 +00:00
2026-07-23 12:55:59 +02:00
2026-07-17 15:13:36 +02:00
2026-07-24 00:20:38 +02:00
2026-03-05 18:11:40 +01:00
2026-06-07 07:55:12 +00:00
2026-05-25 15:25:11 +00:00
2026-07-23 13:47:28 +02:00
2026-07-22 11:49:08 +02:00
2026-04-03 17:39:32 +00:00
2026-03-05 18:11:40 +01:00
2026-07-07 14:27:00 +02:00
2026-07-24 09:58:27 +02:00
2026-05-25 16:18:38 +00:00
2026-02-03 17:20:35 +00:00
2026-07-04 17:16:07 +02:00
2026-07-04 17:16:07 +02:00
2026-07-04 17:16:07 +02:00
2026-07-23 00:09:24 +02:00
2026-03-24 19:18:36 +00:00
2026-07-23 00:09:24 +02:00
2026-03-05 18:11:40 +01:00
2025-12-08 16:42:35 +00:00
2026-06-17 17:22:42 +00:00
2025-10-30 06:47:26 +00:00
2026-03-31 15:13:23 +00:00
2026-07-09 01:53:43 +02:00
2025-12-23 15:26:23 +00:00
2025-10-28 17:52:04 +00:00
2026-07-17 18:18:54 +02:00
2026-05-11 22:30:15 +00:00
2026-05-11 22:30:15 +00:00
2026-05-11 22:30:15 +00:00
2026-06-17 16:32:01 +00:00
2026-07-11 16:00:53 +02:00
2026-05-17 14:41:10 +00:00
2025-12-04 22:09:25 +00:00
2025-10-22 15:56:36 +00:00
2026-03-07 19:51:38 +01:00
2026-03-05 18:11:40 +01:00
2026-02-05 13:48:32 +00:00
2026-07-07 14:27:00 +02:00
2026-02-12 09:50:01 +00:00
2026-02-02 10:09:40 +00:00
2026-03-05 18:11:40 +01:00
2026-07-17 19:48:08 +02:00
2026-04-09 17:21:36 +00:00
2025-10-22 15:56:36 +00:00
2025-12-19 20:33:03 +00:00
2026-07-21 15:10:29 +00:00
2026-06-08 18:24:23 +00:00
2026-07-21 17:04:15 +00:00
2026-02-23 17:53:09 +00:00
2026-02-12 09:50:01 +00:00
2026-07-22 11:30:23 +02:00
2025-10-28 11:36:05 +00:00
2026-03-05 18:11:40 +01:00
2025-10-22 15:56:36 +00:00
2026-07-02 07:37:53 +02:00
2026-07-21 07:34:44 +02:00
2026-06-17 16:32:01 +00:00
2026-03-05 18:11:40 +01:00
2026-03-07 19:51:38 +01:00
2026-04-07 21:03:06 +00:00
2026-07-23 13:47:28 +02:00
2026-07-23 13:47:28 +02:00
2026-07-04 19:10:52 +02:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-07-07 08:25:16 +00:00
2026-07-09 01:53:43 +02:00
2026-07-09 01:53:43 +02:00
2026-07-09 01:53:43 +02:00
2026-07-07 08:25:16 +00:00
2026-02-28 09:11:00 +00:00
2026-03-24 09:45:37 +00:00
2026-07-07 08:25:16 +00:00
2026-06-17 17:23:14 +00:00
2026-07-07 08:25:16 +00:00
2026-02-11 19:29:44 +00:00
2026-04-10 14:35:13 +00:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-04-16 15:56:41 +00:00
2025-12-01 11:18:37 +00:00
2026-07-08 14:35:57 +00:00
2026-02-12 09:50:01 +00:00
2026-03-26 18:28:18 +00:00
2026-04-10 16:40:23 +00:00
2026-03-05 18:11:40 +01:00
2026-07-23 23:21:24 +02:00
2026-07-16 15:55:44 +02:00
2026-06-15 10:23:16 +02:00
2026-06-16 00:46:53 +02:00
2026-07-07 14:27:00 +02:00
2026-07-07 14:27:00 +02:00
2026-07-17 19:36:51 +02:00
2026-06-02 22:10:16 +00:00
2026-07-06 09:23:54 +02:00
2026-06-16 14:12:08 +02:00
2026-07-21 14:01:44 +00:00
2026-06-08 11:52:41 +00:00
2026-07-21 14:01:44 +00:00
2026-02-23 17:53:09 +00:00
2026-03-05 18:11:40 +01:00
2026-07-07 14:27:00 +02:00
2026-06-22 09:21:14 +02:00
2025-11-21 13:01:33 +00:00
2026-03-04 10:46:34 +00:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-04-21 21:07:48 +00:00
2026-07-07 08:25:16 +00:00
2026-07-21 10:53:52 +00:00
2026-07-09 01:53:43 +02:00
2025-10-22 15:56:36 +00:00
2026-02-12 18:20:22 +00:00
2026-06-15 10:23:16 +02:00
2026-07-24 09:58:27 +02:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-06-08 18:24:23 +00:00
2026-06-01 23:29:19 +00:00
2026-03-05 18:11:40 +01:00
2026-02-24 06:37:55 +00:00
2026-03-05 06:19:51 +00:00
2026-05-06 10:25:50 +00:00
2026-03-24 16:47:33 +00:00
2026-07-08 14:35:57 +00:00
2026-07-23 23:21:24 +02:00
2026-07-07 14:27:00 +02:00
2026-06-01 10:22:50 +02:00
2026-05-22 13:27:50 +00:00
2026-03-31 18:26:56 +00:00
2026-03-10 10:13:26 +00:00
2026-03-05 18:11:40 +01:00
2026-02-03 17:20:35 +00:00
2026-02-03 17:20:35 +00:00
2026-02-24 19:55:20 +00:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-03-31 18:26:56 +00:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-05-01 18:03:40 +00:00
2026-04-28 20:00:03 +00:00
2026-06-24 13:37:33 +00:00
2026-07-08 10:11:29 +02:00
2026-06-24 13:37:33 +00:00
2025-10-22 15:56:36 +00:00
2025-12-08 16:42:35 +00:00
2026-03-26 18:52:15 +00:00
2025-12-04 22:09:25 +00:00
2026-07-11 15:50:41 +02:00
2026-07-22 13:00:01 +02:00
2025-10-22 15:56:36 +00:00
2026-07-22 13:00:01 +02:00
2026-03-05 18:11:40 +01:00
2026-05-01 20:55:24 +00:00
2026-07-21 17:06:32 +00:00
2026-05-30 10:40:56 +00:00
2025-10-22 15:56:36 +00:00
2026-05-22 21:01:15 +00:00
2025-10-22 15:56:36 +00:00
2026-07-10 13:51:16 +00:00
2026-07-10 13:51:16 +00:00
2026-07-01 14:42:02 +00:00
2026-06-01 23:29:19 +00:00
2026-03-20 16:28:38 +00:00
2025-10-22 15:56:36 +00:00
2026-07-08 12:01:05 +00:00
2025-10-22 15:56:36 +00:00
2026-07-09 01:53:43 +02:00
2026-03-18 12:50:50 +00:00
2025-12-04 22:09:25 +00:00
2025-11-29 01:23:47 +00:00
2026-02-24 06:37:55 +00:00
2026-03-05 18:11:40 +01:00
2026-01-21 19:38:28 +00:00
2026-06-11 07:49:02 +00:00
2026-05-12 14:33:21 +00:00
2026-03-05 18:11:40 +01:00
2026-04-30 14:02:54 +00:00
2026-03-05 18:11:40 +01:00
2026-03-17 01:19:46 +00:00
2026-03-05 18:11:40 +01:00
2026-07-17 15:57:00 +02:00
2026-07-20 20:56:57 +02:00
2026-07-20 22:09:59 +02:00
2026-02-12 09:50:01 +00:00
2026-03-05 18:11:40 +01:00
2026-01-08 06:24:23 +00:00
2025-10-22 15:56:36 +00:00
2026-07-01 11:41:36 +02:00
2026-07-23 18:31:40 +02:00
2026-01-20 13:38:02 +00:00
2026-02-03 17:20:35 +00:00
2025-12-20 15:43:44 +02:00
2025-12-26 23:21:42 +00:00
2026-05-11 22:30:15 +00:00
2026-05-11 22:30:15 +00:00
2025-12-04 22:09:25 +00:00
2026-05-12 14:33:21 +00:00
2025-10-22 15:56:36 +00:00
2026-07-02 11:58:31 +02:00
2026-03-05 18:11:40 +01:00
2026-05-20 12:46:58 +00:00
2026-03-05 18:11:40 +01:00
2026-06-02 22:10:16 +00:00
2025-10-22 15:56:36 +00:00
2025-12-04 22:09:25 +00:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-07-08 12:01:05 +00:00
2026-07-08 12:01:05 +00:00
2026-07-16 11:17:20 +02:00
2026-07-16 15:49:20 +02:00
2025-10-21 15:28:52 +00:00
2026-03-05 18:11:40 +01:00
2026-01-13 15:20:06 +00:00
2025-11-04 19:13:09 +00:00
2026-05-20 16:15:11 +00:00
2026-03-05 18:11:40 +01:00
2026-07-10 13:51:16 +00:00
2026-06-03 17:27:24 +00:00
2026-07-21 15:10:29 +00:00
2026-05-20 13:26:34 +00:00
2026-05-11 22:30:15 +00:00
2026-07-06 18:43:17 +00:00
2026-04-09 17:21:36 +00:00
2026-02-11 06:27:21 +00:00
2026-03-07 19:51:38 +01:00
2026-03-07 19:51:38 +01:00
2026-05-11 22:30:15 +00:00
2026-07-09 01:53:43 +02:00
2026-07-03 18:05:50 +02:00
2025-12-04 22:09:25 +00:00
2026-07-21 15:10:29 +00:00
2026-04-09 17:31:36 +00:00
2026-04-09 17:31:36 +00:00
2026-04-09 17:31:36 +00:00
2026-05-11 22:30:15 +00:00
2026-05-07 13:29:10 +00:00
2026-06-18 08:44:46 +02:00
2026-06-18 08:44:46 +02:00
2026-07-07 14:27:00 +02:00
2026-06-30 17:01:07 +00:00
2026-07-15 21:18:15 +02:00
2026-03-31 09:33:26 +00:00
2026-03-31 09:33:26 +00:00
2026-07-21 15:10:29 +00:00
2026-07-09 01:53:43 +02:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-05-11 22:30:15 +00:00
2026-03-05 18:11:40 +01:00
2026-04-03 13:03:22 +00:00
2026-07-07 14:27:00 +02:00
2026-02-19 09:33:33 +00:00
2026-04-08 15:54:44 +00:00
2026-05-26 04:51:53 +00:00
2026-03-05 18:11:40 +01:00
2026-06-18 18:09:02 +02:00
2026-03-05 18:11:40 +01:00
2026-04-01 05:25:22 +02:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-07-02 11:58:31 +02:00
2026-07-23 00:09:24 +02:00
2026-06-20 16:18:00 +02:00
2025-10-22 15:56:36 +00:00
2026-07-10 15:23:09 +00:00
2026-07-10 15:23:09 +00:00
2026-02-23 17:53:09 +00:00
2026-01-20 18:30:52 +00:00
2026-02-23 17:53:09 +00:00
2026-07-08 14:35:33 +00:00
2026-03-05 18:11:40 +01:00
2025-12-08 16:42:35 +00:00
2026-07-22 11:49:08 +02:00
2025-10-22 15:56:36 +00:00
2026-07-09 01:53:43 +02:00
2026-07-09 01:53:43 +02:00
2026-07-17 19:36:51 +02:00
2026-07-09 01:53:43 +02:00
2026-03-03 12:37:37 +00:00
2026-07-09 01:53:43 +02:00
2026-03-05 18:11:40 +01:00
2026-02-03 17:20:35 +00:00
2026-07-09 01:53:43 +02:00
2025-11-29 01:23:47 +00:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-07-09 01:53:43 +02:00
2026-02-03 17:20:35 +00:00
2026-07-14 15:52:20 +02:00
2026-07-23 23:21:24 +02:00
2026-07-23 23:21:24 +02:00
2026-07-14 15:52:20 +02:00
2025-11-24 21:41:05 +00:00
2026-07-17 19:48:08 +02:00
2026-03-31 15:13:23 +00:00
2026-07-23 23:21:24 +02:00
2026-07-23 23:21:24 +02:00
2026-07-23 23:21:24 +02:00
2025-10-22 15:56:36 +00:00
2026-07-11 15:50:41 +02:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-07-09 01:53:43 +02:00
2026-07-02 11:58:31 +02:00
2026-05-19 16:37:08 +00:00
2025-10-22 15:56:36 +00:00
2026-07-22 13:00:01 +02:00
2026-07-07 08:25:16 +00:00
2026-03-05 18:11:40 +01:00
2026-07-21 07:34:44 +02:00
2026-07-21 07:34:44 +02:00
2026-07-21 07:34:44 +02:00
2026-02-28 07:01:23 +00:00
2026-02-04 18:48:51 +00:00
2025-10-27 14:29:53 +00:00
2026-03-31 09:33:26 +00:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-06-11 07:49:02 +00:00
2026-03-05 18:11:40 +01:00
2026-03-24 19:18:36 +00:00
2026-06-23 14:31:41 +00:00
2026-07-23 00:09:24 +02:00
2026-03-05 18:11:40 +01:00
2026-05-06 10:25:50 +00:00
2025-12-04 22:09:25 +00:00
2025-12-04 22:09:25 +00:00
2026-03-10 18:25:09 +00:00
2026-06-01 23:29:19 +00:00
2026-07-21 20:02:34 +02:00
2026-01-22 15:55:18 +00:00
2026-06-24 13:37:33 +00:00
2026-05-20 14:58:26 +00:00
2026-05-25 16:13:28 +00:00
2026-03-05 18:11:40 +01:00
2025-10-29 21:03:12 +00:00
2026-02-28 08:52:10 +00:00
2026-02-28 08:52:10 +00:00
2026-07-21 15:10:29 +00:00
2026-03-05 18:11:40 +01:00
2026-03-05 18:11:40 +01:00
2026-07-17 19:48:08 +02:00
2026-07-10 15:23:09 +00:00
2026-06-17 17:22:42 +00:00
2026-07-01 14:42:02 +00:00
2026-02-05 13:45:09 +00:00
2026-07-09 01:53:43 +02:00
2026-07-09 01:53:43 +02:00
2026-03-05 18:11:40 +01:00
2026-05-20 14:04:10 +00:00
2026-02-09 00:23:42 +00:00
2026-03-05 18:11:40 +01:00
2026-04-01 06:11:37 +00:00
2026-06-10 08:28:53 +00:00
2026-02-28 08:52:10 +00:00
2026-07-07 14:27:00 +02:00
2026-07-08 14:35:57 +00:00
2026-03-24 21:22:35 +00:00
2026-03-16 15:37:28 +00:00
2025-11-28 16:00:11 +00:00
2026-06-08 18:24:23 +00:00
2026-07-23 13:47:28 +02:00
2026-06-30 17:01:07 +00:00
2026-05-26 04:51:53 +00:00
2026-07-09 01:54:58 +02:00
2026-07-22 12:39:35 +02:00
2026-06-29 20:33:50 +00:00
2026-07-16 14:56:57 +02:00
2026-07-16 14:56:57 +02:00
2026-07-09 14:40:46 +00:00
2026-07-16 14:56:57 +02:00
2026-07-16 14:56:57 +02:00
2025-12-23 18:19:30 +00:00
2026-05-07 13:35:54 +00:00
2026-05-11 22:30:15 +00:00