Skip to content

feat(alerts): alerting pipeline redesign - #33740

Closed
manerow wants to merge 41 commits into
mainfrom
feat/alerting-pipeline-redesign
Closed

manerow wants to merge 41 commits into
mainfrom
feat/alerting-pipeline-redesign

Conversation

@manerow

@manerow manerow commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Split for review. This pull request is split into nine stacked pull requests, each one topic, approved one by one and merged together: #33967, #33968, #33969, #33970, #33971, #33972, #33973, #33974 and #33975. Together they hold exactly this branch's code merged with main, apart from three files CI regenerates. This pull request stays open as a draft reference with every original commit, is not to be merged, and is closed when the stack lands. #33118 is closed by #33975.

Problem

Alerts share state between steps, which makes them unreliable:

  • The scheduler's job keeps a copy of the alert and writes it back after each run, undoing edits made meanwhile.
  • One dead endpoint, or one recipient without an address, could cost every other recipient.
  • Only the first destination of each type reported a status, so the API could report "Active" while most recipients failed.
  • An alert could watch one source only, and destinations were never checked on PATCH.

What this PR changes

One commit per step, each reviewable alone.

  1. Isolation. A failing target costs only itself.
  2. State lives in rows, written with compare-and-set. Jobs carry no data and have one writer, acting after a save or delete commits; a reconciler repairs drift.
  3. Order and a time budget. Events go out in offset order; a tick stops after about a minute and resumes, so slow endpoints cannot starve others.
  4. Saving. A definition is validated only when it changed; hand-written rules are never recompiled.
  5. One catalog file for sources, filters and triggers.
  6. Matching by every source of an alert; the stored condition text still decides.
  7. Several sources of one kind in one alert, e.g. table plus topic.
  8. The form offers them, with recipients from the server.
  9. Channels are registered. Nothing else names a destination type; a test enforces it.
  10. Targets, content, health. One message per address, content rendered once, a health per destination.
  11. Destinations validated when new or changed, on every save path.
  12. A channel field on a destination, naming a registered channel; without one, the type's channel serves it.
  13. Dead code removed: message builders, the scheduler's publisher methods.

What users will notice

  • An edit made while an alert runs is kept.
  • The API reports each destination's status and reason, such as "1 of 9 recipients failed. bob: Connection refused", or "Not attempted" when mail is off.
  • Mailboxes differing only in letter case get one email.
  • A PATCH that makes a destination invalid is refused.
  • Saving an alert with hand-written rules from the form keeps them.
  • During a rolling update's minute, a notification can arrive late or twice; nothing is lost.
  • Rolling back means restoring the pre-upgrade database backup.

New settings under alerting: default to today's behaviour.

How it was tested

  • Each step was compared byte for byte with the starting code's output; those scenarios now assert it.
  • About 1,000 unit tests; 75 new integration tests on MySQL and PostgreSQL; the existing alert ones.
  • Playwright: the existing alert specs, plus new ones for several sources and recipients.
  • An upgrade from 2.0.2, checked by hand: alerts keep their definitions and deliver.

Not in this PR

  • The Collate side, in its own pull request. Both merge together: Collate calls scheduler methods this one removes.
  • Destination status and an on/off switch on the alert page, a follow-up.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 42 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 42 warning(s) across 15 changed file(s).

Count Rule
16 no-restricted-imports
14 react-hooks/exhaustive-deps
9 openmetadata-imports/no-lower-layer-page-imports
3 openmetadata-imports/no-cross-page-imports
All findings
Location Rule Message
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:35:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:109:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:140:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'getResourcePermission' and 't'. Either include them or remove the dependency array.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:146:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTemplates'. Either include it or remove the dependency array.
🟡 src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:150:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchFunctions'. Either include it or remove the dependency array. Outer scope values like 'Fqn' aren't valid de
🟡 src/components/Alerts/AlertFormSourceItem/AlertFormSourceItem.tsx:114:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'form'. Either include it or remove the dependency array.
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:36:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:72:9 react-hooks/exhaustive-deps The 'destinations' logical expression could make the dependencies of useMemo Hook (at line 86) change on every render. To fix this, wrap the initialization of '
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItem.component.tsx:72:9 react-hooks/exhaustive-deps The 'destinations' logical expression could make the dependencies of useCallback Hook (at line 143) change on every render. To fix this, wrap the initialization
🟡 src/components/Alerts/DestinationFormItem/DestinationFormItemFormBridge.tsx:19:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Alerts/DestinationFormItem/DestinationSelectItem/DestinationSelectItem.tsx:60:9 react-hooks/exhaustive-deps The 'destinationItem' logical expression could make the dependencies of useMemo Hook (at line 105) change on every render. To fix this, wrap the initialization
🟡 src/components/observability/Alerts/AlertEditModal.component.test.tsx:30:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/observability/Alerts/AlertEditModal.component.tsx:25:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/observability/Alerts/AlertEditModal.component.tsx:29:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:92:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:155:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:200:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchAlert' and 'fetchFunctions'. Either include them or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:228:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'getResourceLimit' and 'setInlineAlertDetails'. Either include them or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:289:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'getResourcePermission' and 't'. Either include them or remove the dependency array.
🟡 src/pages/AddNotificationPage/AddNotificationPage.tsx:295:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTemplates'. Either include it or remove the dependency array.
🟡 src/pages/AddObservabilityPage/AddObservabilityPage.interface.ts:33:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/pages/AddObservabilityPage/hooks/useObservabilityAlertForm.ts:31:1 openmetadata-imports/no-cross-page-imports Page features must not import another page feature. Move shared code to components, hooks, interfaces, or pure utilities.
🟡 src/pages/AddObservabilityPage/hooks/useObservabilityAlertResources.ts:72:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchFunctions'. Either include it or remove the dependency array.
🟡 src/utils/Alerts/AlertsUtil.test.tsx:14:1 no-restricted-imports '../../assets/svg/alert.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/Alerts/AlertsUtil.test.tsx:15:1 no-restricted-imports '../../assets/svg/all-activity.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated a
🟡 src/utils/Alerts/AlertsUtil.test.tsx:16:1 no-restricted-imports '../../assets/svg/clock.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/Alerts/AlertsUtil.test.tsx:17:1 no-restricted-imports '../../assets/svg/ic-check.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstr
🟡 src/utils/Alerts/AlertsUtil.test.tsx:18:1 no-restricted-imports '../../assets/svg/ic-mail.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstra
🟡 src/utils/Alerts/AlertsUtil.test.tsx:19:1 no-restricted-imports '../../assets/svg/ms-teams.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstr
🟡 src/utils/Alerts/AlertsUtil.test.tsx:20:1 no-restricted-imports '../../assets/svg/slack.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/Alerts/AlertsUtil.test.tsx:21:1 no-restricted-imports '../../assets/svg/webhook.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstra
🟡 src/utils/Alerts/AlertsUtil.test.tsx:36:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/utils/Alerts/AlertsUtil.tsx:33:1 no-restricted-imports '../../assets/svg/alert.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/Alerts/AlertsUtil.tsx:34:1 no-restricted-imports '../../assets/svg/all-activity.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated a
🟡 src/utils/Alerts/AlertsUtil.tsx:35:1 no-restricted-imports '../../assets/svg/clock.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/Alerts/AlertsUtil.tsx:36:1 no-restricted-imports '../../assets/svg/ic-check.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstr
🟡 src/utils/Alerts/AlertsUtil.tsx:37:1 no-restricted-imports '../../assets/svg/ic-mail.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstra
🟡 src/utils/Alerts/AlertsUtil.tsx:38:1 no-restricted-imports '../../assets/svg/ms-teams.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstr
🟡 src/utils/Alerts/AlertsUtil.tsx:39:1 no-restricted-imports '../../assets/svg/slack.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/Alerts/AlertsUtil.tsx:40:1 no-restricted-imports '../../assets/svg/webhook.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstra
🟡 src/utils/Alerts/AlertsUtilPure.ts:33:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/utils/AlertsClassBase.ts:28:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

…e-redesign

# Conflicts:
#	openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.test.tsx
#	openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx
#	openmetadata-ui/src/main/resources/ui/src/pages/AddNotificationPage/AddNotificationPage.tsx
@gitar-bot

gitar-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🔴 High risk · The alert pipeline redesign changes event delivery, scheduling, and persisted offsets.

Redesigns the alerting pipeline to isolate failures, store state in rows with compare-and-set semantics, add time budgeting for event delivery, and validate destinations on save. The form now offers multiple sources of each kind with server-provided recipients using a new AlertSourcePicker component. No issues found.

✅ 1 closed
✅ Quality: New AlertSourcePicker built on Ant Design components

📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertSourcePicker/AlertSourcePicker.tsx:13 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertSourcePicker/AlertSourcePicker.tsx:80 📄 openmetadata-ui/src/main/resources/ui/src/components/Alerts/AlertSourcePicker/AlertSourcePicker.tsx:94
AlertSourcePicker.tsx is a new UI component that composes Ant Design's Select, Alert, Space and Typography directly. The repository's UI guidelines state that new work should use @openmetadata/ui-core-components and must not hand-roll or reuse Ant Design components exported by that library (Select is explicitly named). This is consistent with the surrounding legacy alert form (which is also antd-based), so it is a minor convention issue rather than a defect, but it entrenches Ant Design usage in newly added code. Consider using the core-components Select/Alert equivalents, or noting the deliberate exception if the whole alert form is intentionally left on antd for now.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow

manerow commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Merged as the stack #33967 to #33975; closing this draft.

@manerow manerow closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant