Repository navigation
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
ShaileshParmar11
left a comment
There was a problem hiding this comment.
The classic form and view now follow several sources, but the AI-mode alert form (AlertAiFormFields) still handles one source. That form is used by the AI-mode create/edit modal, the AI-mode alert details view, and the notification alert form on a user's profile.
The PR wires the server's capabilities into the AI form (recipients, filters, triggers, data contract search), which is good. But the source field itself was not changed, so the bug this PR fixes in the classic form is still present in AI mode:
AlertAiFormFields.component.tsx#L112reads only the first source:const [selectedSource] = getAlertAiResources(value, alert);#L273renders a single-select<Select selectedKey={selectedSource}>, notAlertSourcePicker.#L206:handleSourceChangewritesresources: nextSource ? [nextSource] : [].
Repro: open a mention alert that the 2.0 upgrade made watch Conversation and Task (the case in recording 2) from the AI-mode alert page or the profile Notification tab. The source field shows only Conversation. Changing the source drops Task without a warning. Saving after a description-only edit keeps both, because value.resources is left untouched.
I also checked the rest of the stack (#33971 to #33975) and #33740. None of them changes AlertAiFormFields, so this gap would ship as-is.
Suggested fix: use AlertSourcePicker (or a multi-select built on AlertSelectionUtil's source options, with the disabled reasons and the per-source warnings) in AlertAiFormFields, and pass the full resources array instead of selectedSource to the filter, trigger, search and destination sections. Add one AI-mode Playwright spec that edits a two-source alert and asserts both sources survive.
| isViewOnly, | ||
| inlineAlert, | ||
| onChange, | ||
| recipientCategories, |
There was a problem hiding this comment.
recipientCategories now follows every source, but the source field in this component still handles one:
- L112
const [selectedSource] = getAlertAiResources(value, alert);keeps the first source only. - L273 is a single-select
<Select>, so a second source cannot be added or even seen. - L206
resources: nextSource ? [nextSource] : []drops the other sources when the user changes the source. This is the silent drop the PR fixes in the classic form. - L290-L292
getRuleEventTypes(value.alertType, selectedFilterResource)takes event types from the first source's catalog entry only.
Could this use AlertSourcePicker (or the same AlertSelectionUtil source options) and pass the full resources array down instead of selectedSource?
| (resource) => resource.name === selectedSource | ||
| ), | ||
| [alertFormState.filterResources, selectedSource] | ||
| // The configuration view follows every source the alert watches, as the server answers for them. |
There was a problem hiding this comment.
The capabilities now cover every source, but the view still renders AlertAiFormFields in view mode, whose source <Select> shows only selectedSource (the first one, L273). So in AI mode the mention alert from recording 2 still shows only Conversation, while the classic view shows Conversation and Task. The view needs to list every source too.
| const resourceDescriptor = useMemo( | ||
| () => filterResources.find((r) => r.name === selectedTrigger), | ||
| [filterResources, selectedTrigger] | ||
| const sources = formData.resources ?? NO_SOURCES; |
There was a problem hiding this comment.
The profile form now asks the server about every source in formData.resources, but it renders AlertAiForm, whose source field is still single-select. A user can only pick one source here, and changing the source of a two-source alert keeps only the new one. Same fix as in AlertAiFormFields would cover this form.
| if (argument === 'fqnList' && selectedSource === EntityType.DATA_CONTRACT) { | ||
| const contracts = await getDataContractSuggestions(trimmedSearchText); | ||
| // A source whose names are not in the search indexes, such as a data contract, has a search of its own. | ||
| const ownSearch = selectedSource |
There was a problem hiding this comment.
This and the index lookup in getAlertAiFqnSearchIndexes (L131-L149) use one selectedSource. The classic form now searches names across every chosen source (Table + Data Contract in AlertSeveralSources.spec). Once the AI form allows several sources, this needs the same: the sources with their own search plus one indexed search over the rest, as AlertSourceSearch does.
| .join(''); | ||
|
|
||
| // What the form offers follows the server's answer about the chosen source, so wait for it. | ||
| export const selectAlertSource = async (page: Page, source: string) => { |
There was a problem hiding this comment.
selectAlertSource picks one option from a single-select, and no AI-mode spec covers several sources (AlertSeveralSources.spec drives only the classic pages). Could you add one AI-mode case: open an alert that watches two sources, edit it, save, and assert filteringRules.resources still has both?
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
…way the page provides them
…health stores only what ticks report
…channel is grouped from
…stopping flag and recipient lookups
…ed once and health per destination
…, fails the event with its reason
🚦 Removed from the merge queue —
|
|
| Count | Rule |
|---|---|
| 14 | react-hooks/exhaustive-deps |
| 13 | openmetadata-imports/no-lower-layer-page-imports |
| 1 | openmetadata-imports/no-cross-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Alerts/AlertDetails/AlertConfigDetails/AlertConfigDetails.tsx:34: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:108: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:139: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:145: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:149: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 146) 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/AlertAiDestinationSection.component.tsx:60:9 |
react-hooks/exhaustive-deps |
The 'destinations' logical expression could make the dependencies of useCallback Hook (at line 107) change on every render. To fix this, wrap the initialization |
| 🟡 | src/components/observability/Alerts/AlertAiFormFields.component.test.tsx:47: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/AlertAiFormFields.interface.ts:24: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/AlertAiFormFieldsSearchUtils.ts:20: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/AlertDetailsPage.test.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/components/observability/Alerts/AlertDetailsPage.tsx:46: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.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:85: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:148: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:193: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:221: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:282: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:288:6 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchTemplates'. Either include it or remove the dependency array. |
| 🟡 | 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/AlertsUtilPure.ts:42: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
|
Code Review ✅ Approved🟡 Medium risk · Multi-source alert editing changes source selection, filters, triggers, and recipients. Enables alert forms and views to follow multiple sources instead of only the first one. Sources are now grouped by kind in a new picker, filters and triggers are queried from the server based on the selected sources, and recipient options are determined by source type. Existing single-source alerts remain unchanged. No issues found. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |



Fixes #20504
What this pull request implements
The alert form and the alert view follow every source an alert watches, not only the first one.
What was wrong before
The form and the view read only the first source of an alert. An alert with several sources, such as a mention alert that the 2.0 upgrade makes watch both conversations and tasks, showed one source, and saving it from the form dropped the others. Each section looked up the first source's filters and triggers in the catalog on its own, so nothing tied what the form offered to what the server accepts on save.
Design
useAlertSelectionis created once by the page that shows an alert and handed down through a context, so the source picker, the filters, the triggers and the recipients read one selection and never disagree.useAlertCapabilitiesasks the server what a selection supports, once per distinct selection. The rules for combining sources stay on the server, where the save applies them too, so the form never decides them itself. While a new answer is on its way the previous one stays on screen, and an answer to a selection the user has already changed is not shown.AlertSelectionUtilturns that answer into what each section offers, and into the source options: which sources can still be chosen, which are disabled and why, and which selected source gets a warning because it can never produce a match. Until the server answers, the catalog the form already has describes the first source.AlertSourceSearchdecides how a field searches the names a source holds. A source with a search of its own uses it (data contracts are not in the search indexes); the other sources share one search over their indexes.AlertSourcePickershows the sources grouped by kind, with a disabled source's reason beside it, rather than failing on save.What users notice
Users can pick several sources for one alert, and the view reads better. Existing single-source alerts look and save as before.
Screen recordings
Recorded on a local Collate deployment.
1. One alert on several sources. Before this change, the form let an alert watch only one source, so the same owner filter on tables and dashboards needed two alerts. The video creates one alert for both. The source picker lists every source, grouped by kind. Conversation shows as disabled, with the reason: it is an activity source, Table is an entity source, and the two share no filters. Once Dashboard joins Table, the form asks the server what the pair supports and offers only those filters; the alert filters by owner and emails the owners. After saving, the alert view lists both sources by their display names, and the edit form opens with both still chosen.
1-several-sources.webm
2. A mention alert the 2.0 upgrade changed. The 2.0 upgrade makes every mention alert watch Task as well as Conversation, so that people mentioned in incident tasks keep being notified. Before this change, the form and the view read only the first source: such an alert showed only Conversation, and saving it from the form, even just to edit its description, dropped Task without a warning. In the video, the view and the edit form show both sources, and after changing only the description and saving, the alert still watches both.
2-upgraded-mention-alert.webm
3. A warning for a source the trigger never reaches. Observability alerts can watch several sources too. This one watches Table and Topic, and its trigger, "Get Schema Changes (Table)", only fires for tables. The form asks the server what the selection supports and shows a warning under Topic, so the user learns before saving that no event from a topic can ever match this alert.
3-observability-warning.webm
4. Recipients in the AI-mode alert form. Who an alert can notify depends on its source: a table has owners and followers, a task has assignees, a conversation has mentioned users. The AI-mode form now offers the recipients the server lists for the chosen source. With Table it offers Users, Teams, Admins, Owners and Followers. Changing the source starts the destinations over, as the form's hint says, and with Task it offers Assignees, Owners and Mentions.
4-ai-mode-recipients.webm
5. Recipients on a user's profile. Users can also create notification alerts from their own profile (in AI mode: user menu, Profile, Notification, Alerts). That form offers recipients the same way: Users, Teams, Admins, Owners and Followers for Table, and Assignees, Owners and Mentions for Task.
5-profile-recipients.webm
How it was tested
Every UI Checkstyle step passes locally, the antd guard and the bundle budget included. Jest: 133 suites, 1,321 tests. Playwright:
NotificationAlerts,ObservabilityAlerts,AlertSeveralSources,AlertRecipientsand the five AI-mode alert specs, profile notifications included, 70 of 70, against a server built from this branch.