Skip to content

fix(ui) + test: PlatformLineage stale-search race + lineage/owner-picker test coverage - #33877

Merged
chirag-madlani merged 8 commits into
mainfrom
chirag-madlani/playwright-test-hardening-batch2
Sep 24, 2026
Merged

chirag-madlani merged 8 commits into
mainfrom
chirag-madlani/playwright-test-hardening-batch2

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

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

# Commit Purpose
1 4897ae44cd fix(ui): don't let a stale lineage search overwrite newer suggestions
2 a8127781d2 test(ui): cover the lineage search race that had no regression guard (101-line new test)
3 27016eb4ab ci: build the RDF lane with PW_E2E_BUILD like every other Playwright lane
4 08a5c84f4a fix(test): pan the lineage edge midpoint out from under the node palette (new helpers in utils/lineage.ts)
5 cdb11b1b67 test: cover the owner picker with tests its mocked suite cannot fail (new browser-test + jest test)
6 811a013e8d docs(test): record what actually broke the bulk-edit owner picker (comment on the guard test)

Type of change:

  • Bug fix (PlatformLineage stale-search race — user-visible regression)
  • Test coverage additions
  • CI configuration

Files touched (6)

  • .github/workflows/playwright-knowledge-graph-postgresql-e2e.yml
  • openmetadata-ui/src/main/resources/ui/playwright/browser-tests/gridPopoverEditor.spec.ts (new)
  • openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts
  • openmetadata-ui/src/main/resources/ui/src/components/common/UserTeamSelectableList/UserTeamSelectableList.popover.test.tsx (new)
  • openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.tsx
  • openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.test.tsx

Notes

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

RetriggerConfidence Score: 5/5

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.

  • Invalidates in-flight searches synchronously whenever the search input changes.
  • Routes lineage edge selection through an overlay-aware, stabilized coordinate click.
  • Adds browser and component coverage for the owner picker.
  • Aligns the knowledge-graph Playwright lane with the standard E2E build and cache variant.
  • The previously reported search invalidation and unused edge-stabilization issues are fixed in the current code.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into chirag-madlani/..."

harshach and others added 6 commits September 23, 2026 16:22
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)
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 23, 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), 2 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), 2 warning(s) across 1 changed file(s).

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

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.86% (105345/144584) 58.22% (64530/110824) 59.19% (21155/35738)

@gitar-bot

gitar-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown
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 Locator isn't imported

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:13 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:167 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:213 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:263 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:340-353 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:355-369
Commit 08a5c84 adds panCanvas, clearMidpointOfOverlays, clickCanvasEdge and edgeMarker, but nothing calls them. clickEdgeBetweenNodes (lines 355-372) still does getByTestId(...) plus dispatchEvent('click'), and deleteEdge still goes through it. So the fix for the node palette covering the edge midpoint has no effect, and the flaky retry loop it describes is still there. The new signatures also use Locator as a type, but line 13 only imports APIRequestContext, expect, Page. That breaks tsc for the Playwright sources, and ESLint will also report the unused consts. This looks like the conflict resolution kept the new helpers but dropped the import and the call-site change. The fix is to add Locator to the import and make clickEdgeBetweenNodes call clickCanvasEdge(page, edgeMarker(page, fromNodeFqn, toNodeFqn, isPipeline)).

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants