Repository navigation
fix(ui) + test: PlatformLineage stale-search race + lineage/owner-picker test coverage - #33877
Conversation
The platform lineage search box could show results for a query it was no longer holding. chromium-15's failure screenshot has the typed FQN in the input, the dropdown open, and five suggestions from an empty query -- `work`, `raw_customer`, `raw_product_catalog` -- so the entity being searched for was not offered and the test waited out its timeout. `debounce` coalesces calls inside its own 300ms window, not across them. `onFocus` starts a search for '' and the user's first keystrokes start another more than 300ms later, so both run; the empty one is the slower of the pair because it has no term to narrow three indices by, and `setOptions` ran unconditionally on whichever answered last. Guarded with the request-ordering ref this codebase already uses in useKnowledgePageListing: a response is only applied when no newer request has been issued. `frontend-performance.md` asks for exactly this — "a slow first response can't overwrite a fast second one". The 45 existing unit tests still pass, but none of them covers this: the search tests there assert inside `if (mock.calls.length > 0)`, so they hold vacuously. A deterministic ordering test is still owed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit a9c08fe)
The fix in a9c08fe shipped without a test. The search cases already in this file assert inside `if (mock.calls.length > 0)`, so they hold whether or not anything works, and the `antd` stub here throws every prop away — `Select: jest.fn(() => <div>Select</div>)` — which is why the component's own search wiring was unreachable and those cases ended up vacuous. This one stands in for the parts it drives (focus, typing, the option list the component hands over), starts both searches, resolves them out of order, and asserts the list still belongs to the query the box holds. Verified by removing the guard from PlatformLineage.tsx and watching it fail, then restoring it and watching it pass; the other 45 are unaffected. `beforeEach` now restores the `Select` and `EntitySuggestionOption` stubs alongside the implementations it already resets, since `clearAllMocks` keeps implementations and an override would otherwise leak into the tests that follow. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 29d443d)
…lane The Knowledge Graph and Ontology RDF projects were the only Playwright projects running against a bundle built without PW_E2E_BUILD: different vite chunking, a different entry filename, no app-boot diagnostic, and React Flow virtualisation left on where the rest of the suite turns it off. A lane that tests a different build can fail for a reason that has nothing to do with the feature under test. The cache variant has to move with it. `cache-ui-dist` keys on the variant and exports SKIP_UI_BUILD=true on a hit, so leaving it at `default` would let this job restore a non-e2e dist and skip the frontend build outright -- the flag would change nothing -- and on a miss it would write an e2e-shaped dist into the bucket every non-e2e workflow reads. `pw-e2e-build` is what the main lane produces when PW_E2E_BUNDLE is unset, which is also the case here, so the two now share one bucket instead of each paying for its own frontend build. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit b6e749e)
chromium-06 burned its whole 30s retry budget on `deleteEdge` waiting for `add-pipeline` while clicking the same dead coordinate each time. The trace gives the coordinate: x=112.4. Edit mode paints `.entity-lineage.sidebar.open` over the pane at `left: 0` with a width of 110px and a z-index above the canvas, and the lineage card starts about 63px in, so that point is inside the palette, not the graph. fitView measures the whole pane, so any edge whose midpoint lands in that strip is unreachable. `toBeInViewport` does not catch it — it compares against the viewport rectangle, not against what is painted on top — and `mouse.click` has nothing to intercept, so the click simply goes to the palette and the edge is never selected. `clearMidpointOfOverlays` hit-tests the point first and drags the camera until the canvas owns it, shifting along whichever axis clears the occluder in fewer pixels so it is not specific to this one panel. It fails with a named message rather than a timeout if four pans do not clear it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 891cc10)
UserTeamSelectableList.test.tsx stubs Popover out entirely --
`({children}) => <div>{children}</div>` -- and then asserts only that
`isOpen: true` reaches it. That assertion holds whether or not the popover
can render, which is how the bulk-edit owner picker regressed with the
unit tests green.
Two tests that can actually fail:
- a jsdom case rendering the real Popover, for the shape the bulk-edit
grid uses (`popoverProps={{ open: true }}`, so open on first render),
plus its negative;
- a browser case, since jsdom has no layout and react-aria's positioning
is geometry-dependent. It builds a react-data-grid cell editor around
the real core-components Popover with the same mounted-flag gate,
triggerRef and an onOpenChange wired to close the editor.
Both pass today, and that is the point of recording them: this shape is
NOT what breaks the picker, so the next person does not spend the time I
did eliminating it. If either goes red the regression really is in the
Popover.
The browser bundle aliases react/react-dom to one copy. ui-core-components
is a yarn `link:` and otherwise resolves its own, which leaves every hook
reading a null dispatcher and nothing mounts at all.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
(cherry picked from commit c14b9e3)
The guard's own comment claimed only that the Popover was not at fault. The cause is now known -- a deleted helper left a dangling call -- so say so. (cherry picked from commit ce0002e)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
| Count | Rule |
|---|---|
| 2 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/pages/PlatformLineage/PlatformLineage.tsx:251:6 |
react-hooks/exhaustive-deps |
React Hook useCallback has missing dependencies: 'showModal' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/pages/PlatformLineage/PlatformLineage.tsx:331:6 |
react-hooks/exhaustive-deps |
React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · The PR changes lineage search behavior and Playwright build configuration. Fixes a PlatformLineage search race where stale responses would overwrite newer results, and adds test coverage for the lineage search behavior and owner-picker functionality. Edge-click helper issues were resolved. ✅ 1 closed✅ Bug: Lineage edge-click helpers are never called, and
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|



Describe your changes:
Second-wave batch from #33088 — 6 commits, 6 files grouped around one real UI bug and its supporting test infrastructure.
The bug
PlatformLineage search would overwrite newer results with stale older ones.
If the user typed 'foo', then 'foobar' before the 'foo' request returned, the
late 'foo' response would land last and paint the older list back on top of
'foobar' — the user sees results that don't match what's in the input.
Fix: track the request's search token; drop responses whose token doesn't match
the current input.
Commits
4897ae44cda8127781d227016eb4abPW_E2E_BUILDlike every other Playwright lane08a5c84f4autils/lineage.ts)cdb11b1b67811a013e8dType of change:
Files touched (6)
.github/workflows/playwright-knowledge-graph-postgresql-e2e.ymlopenmetadata-ui/src/main/resources/ui/playwright/browser-tests/gridPopoverEditor.spec.ts(new)openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.tsopenmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableList/UserTeamSelectableList.popover.test.tsx(new)openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.tsxopenmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.test.tsxNotes
Cherry-picked from #33088 to land as one reviewable batch. All commits authored by @harshach. Commit #4 required a small conflict resolution against main's newer content in
utils/lineage.ts(pure additive — new helper functions inserted between existing exports, no deletions).🤖 Generated with Claude Code
The PR appears safe to merge; the previously identified lineage issues are fixed and no new actionable failures remain.
Summary
This PR fixes stale PlatformLineage search results and strengthens related UI test infrastructure.
Reviews (3) · Last reviewed commit: "Merge branch 'main' into chirag-madlani/..."