Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Playwright specs that write an intake form run only in the single-worker IntakeForm project

- **Status:** Accepted
- **Revisions:** v1 2026-10-14 (initial)
- **Deciders:** UI team
- **Guard:** reviewer
- **Related:** #35416; merge-queue flakes on #35338 and #32840

## Context
Intake forms are global, one per entityType. While a form with a `required: true` field is
enabled, every create of that entity type fails with
`400 Missing required field(s) per intake form '<type>'`. `IntakeForm.spec.ts` already ran in its
own project for this reason, but `ProfileGovernance.spec.ts` › "Intake Forms CRUD" did not. It ran
in the parallel `chromium` lane, and its required `dataProduct` field failed
`DataProduct.create()` in `RestoreEntityInheritedFields.spec.ts`.

## Decision
Any Playwright spec that creates, edits or enables an intake form is listed in the `IntakeForm`
project's `testMatch` in `playwright.config.ts` (`fullyParallel: false`, `workers: 1`) and in
`chromium`'s `testIgnore`. The planner routes that project to the single-worker `global-state` lane.

## Consequences
Intake-form specs never overlap each other or any other spec, so they may leave a required field
enabled between their own steps. Adding a spec that writes intake forms means touching both
lists. The nightly AUT does not read this config: it copies its own overlay
(`openmetadata-nightly/automate-upgrade-tests/scripts/k8s/playwright.config.ts`, `INTAKE_FORM_SPECS`).
That overlay has to list the same specs. Revisit if intake forms become scoped per test (for
example per domain), so specs no longer share one form per entityType.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export default defineConfig({
'**/SystemCertificationTags.spec.ts',
'**/SearchRBAC.spec.ts',
'**/IntakeForm.spec.ts',
'**/ProfileGovernance.spec.ts',
Comment thread
gitar-bot[bot] marked this conversation as resolved.
Resolved
'**/AdvancedSearch.spec.ts',
...dedicatedStateTestIgnore,
'**/DomainIsolation/**',
Expand Down Expand Up @@ -570,11 +571,15 @@ export default defineConfig({
},
{
name: 'IntakeForm',
testMatch: '**/IntakeForm.spec.ts',
// ADR:2026-10-14-intake-form-specs-run-in-the-single-worker-intakeform-project
// Intake forms are one-per-entityType and global: a required field on the
// dataProduct form makes every parallel DataProduct.create() fail with 400.
testMatch: ['**/IntakeForm.spec.ts', '**/ProfileGovernance.spec.ts'],
use: { ...devices['Desktop Chrome'] },
dependencies: isPlannedShard ? authDependencies : ['setup', 'chromium'],
grep: shardGrep,
fullyParallel: false,
workers: 1,
},
// AdvancedSearch runs in its own dedicated lane so its timing-sensitive
// waitForResponse/debounce flow is not interleaved with other chromium shards.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,17 @@ export const setupGlossaryDenyPermissionTest = async (
};

export const performExpandAll = async (page: Page) => {
const termRes = page.waitForResponse('/api/v1/glossaryTerms?*');
// Match only the expand-tree fetch (?glossary= / ?parent=). A bare
// glossaryTerms glob also matches the tab's first-level ?directChildrenOf=
// fetch, so the wait could resolve before the tree request was even sent.
const termRes = page.waitForResponse((response) => {
const url = new URL(response.url());

return (
url.pathname.endsWith('/api/v1/glossaryTerms') &&
(url.searchParams.has('glossary') || url.searchParams.has('parent'))
);
});
await page.getByTestId('expand-collapse-all-button').click();
await termRes;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,11 @@
setSearchTerm(value);
}, []);

const debouncedSetSearchTerm = useCallback(debounce(handleSearch, 500), [

Check warning on line 654 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback received a function whose dependencies are unknown. Pass an inline function instead
handleSearch,
]);

const fetchChildTerms = async (parentFQN: string, after?: string) => {

Check warning on line 658 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'fetchChildTerms' function makes the dependencies of useCallback Hook (at line 1213) change on every render. To fix this, wrap the definition of 'fetchChildTerms' in its own useCallback() Hook
setLoadingChildren((prev) => ({ ...prev, [parentFQN]: true }));
try {
const response = await getGlossaryTermChildrenLazy(parentFQN, 50, after);
Expand Down Expand Up @@ -739,7 +739,7 @@
};
}

const response = await getFirstLevelGlossaryTermsPaginated(

Check warning on line 742 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent
activeGlossary?.fullyQualifiedName || '',
pageSize,
options?.after,
Expand All @@ -754,7 +754,7 @@
};
};

const fetchAllTerms = async (options?: {

Check warning on line 757 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'fetchAllTerms' function makes the dependencies of useCallback Hook (at line 1499) change on every render. To fix this, wrap the definition of 'fetchAllTerms' in its own useCallback() Hook
after?: string;
before?: string;
offset?: number;
Expand Down Expand Up @@ -827,7 +827,11 @@
}
};

const fetchExpadedTree = async (loadMore = false) => {

Check warning on line 830 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

The 'fetchExpadedTree' function makes the dependencies of useCallback Hook (at line 1499) change on every render. To fix this, wrap the definition of 'fetchExpadedTree' in its own useCallback() Hook
// Shares fetchAllTerms' sequence so a first-level page still in flight
// (e.g. the tab's mount fetch) cannot land after this and re-collapse
// the tree while the button already reads "Collapse All".
const requestSeq = ++fetchRequestSeqRef.current;
if (loadMore) {
setIsLoadingMoreTree(true);
} else {
Expand All @@ -850,6 +854,10 @@
],
});

if (requestSeq !== fetchRequestSeqRef.current) {
return;
}

// Accumulate the flat term list across pages and rebuild the tree from
// it; nesting fills in progressively as parents/children load.
const mergedFlat = uniqBy(
Expand Down Expand Up @@ -890,7 +898,9 @@
} catch (error) {
showErrorToast(error as AxiosError);
} finally {
setIsTableLoading(false);
if (requestSeq === fetchRequestSeqRef.current) {
setIsTableLoading(false);
}
setIsExpandingAll(false);
setIsLoadingMoreTree(false);
}
Expand Down Expand Up @@ -967,7 +977,7 @@
setPreviousGlossaryFQN(currentFQN);
fetchAllTerms();
}
}, [

Check warning on line 980 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useEffect has missing dependencies: 'fetchAllTerms', 'handlePagingChange', and 'setGlossaryChildTerms'. Either include them or remove the dependency array
activeGlossary?.fullyQualifiedName,
previousGlossaryFQN,
toggleExpandBtn,
Expand All @@ -979,7 +989,7 @@
return () => {
setGlossaryChildTerms([]);
};
}, []);

Check warning on line 992 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useEffect has a missing dependency: 'setGlossaryChildTerms'. Either include it or remove the dependency array

const glossaryTermStatus: EntityStatus | null = useMemo(() => {
if (!isGlossary) {
Expand Down Expand Up @@ -1146,7 +1156,7 @@
return false;
}
},
[expandedRowKeys, glossaryChildTerms, selectedStatus, termTaskThreads]

Check warning on line 1159 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useCallback has missing dependencies: 'applyGlossaryTermApprovalOutcome', 'notifyPendingApprovalTasks', and 't'. Either include them or remove the dependency array
);

const handleApproveGlossaryTerm = useCallback(
Expand Down Expand Up @@ -1405,7 +1415,7 @@
}

return data;
}, [

Check warning on line 1418 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has missing dependencies: 'currentUser', 'onAddGlossaryTerm', 'onEditGlossaryTerm', and 't'. Either include them or remove the dependency array
permissions,
tableColumnsWidth,
termTaskThreads,
Expand Down Expand Up @@ -1596,7 +1606,7 @@
</div>
</>
);
}, [

Check warning on line 1609 in openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryTermTab/GlossaryTermTab.component.tsx

View workflow job for this annotation

GitHub Actions / checkstyle

React Hook useMemo has missing dependencies: 'handleEditGlossary', 'handleSearchChange', 'handleStatusSelectionDropdownCancel', 'handleStatusSelectionDropdownSave', and 't'. Either include them or remove the dependency array
toggleExpandBtn,
isExpandingAll,
isStatusDropdownVisible,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

import {
act,
fireEvent,
getByText,
render,
Expand Down Expand Up @@ -717,6 +718,43 @@ describe('Test GlossaryTermTab component', () => {
undefined
);
});

it('should not let a first-level page in flight overwrite the expanded tree', async () => {
let resolveFirstLevel!: (value: unknown) => void;
mockGetFirstLevelGlossaryTermsPaginated.mockReturnValue(
new Promise((resolve) => {
resolveFirstLevel = resolve;
})
);
const staleFirstLevelPage = [mockedGlossaryTerms[1]];

render(<GlossaryTermTab isGlossary={false} />, {
wrapper: MemoryRouter,
});

await waitFor(() =>
expect(mockGetFirstLevelGlossaryTermsPaginated).toHaveBeenCalled()
);

fireEvent.click(screen.getByTestId('expand-collapse-all-button'));

await waitFor(() =>
expect(mockSetGlossaryChildTerms).toHaveBeenLastCalledWith(
mockedGlossaryTerms
)
);

await act(async () => {
resolveFirstLevel({ data: staleFirstLevelPage, paging: {} });
});

expect(mockSetGlossaryChildTerms).not.toHaveBeenCalledWith(
staleFirstLevelPage
);
expect(
screen.getByTestId('expand-collapse-all-button')
).toHaveTextContent('label.collapse-all');
});
});

describe('Actions', () => {
Expand Down
Loading