Skip to content

fix(lineage): open the drawer on the entity id, not the scene node id - #33802

Merged
chirag-madlani merged 1 commit into
mainfrom
chirag-madlani/lineage-drawer-entity-id
Sep 22, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
chirag-madlani/lineage-drawer-entity-id

Conversation

@chirag-madlani

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

Copy link
Copy Markdown
Collaborator

Describe your changes:

"Verify LineageSearchSelect in lineage mode" failed asserting the selected node renders. The selection had worked — the search box shows the container and the drawer is open — but the drawer reads:

You don't have necessary permissions. Please check with the admin to get the View Data Asset permission.

...for an admin. The trace shows why:

GET 404 /api/v1/permissions/container/container:45bfac5c-...
GET 200 /api/v1/containers/name/pw-storage-service-...pw-container-f10e87e6

The permission request carries the scene node id where an entity UUID belongs. toLineageNode spreads the real entity and then overwrites id with node.id so React Flow can key on it, so data.node.id is <entityType>:<uuid>. That object is handed to the drawer as-is, and DataAssetSummaryPanelV1 fetches permissions by dataAsset.id, so the request 404s, no permissions come back, and the panel reports denial for an entity the caller can plainly read.

Resolve the real id through the existing getRealEntityRef accessor, which reads it from the scene node's sourceEntity, and fall back to the previous object when there is no sceneNode, so legacy non-scene nodes are untouched.

Type of change:

  • Bug fix (user-visible: admins see denied-permission panel on lineage drawer)

Notes:

Cherry-picked from #33088 (commit `ebd72c7bb3`) to land as a small, independently-mergeable PR. Original commit authored by @harshach.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge because drawer permission requests and graph updates now use their respective entity and scene identifiers without introducing a reachable regression.

Summary

This PR corrects lineage drawer identity handling while preserving the distinct identifier required for React Flow updates.

  • Resolves the underlying entity UUID from a lineage scene node before opening the asset drawer, allowing asset-level permission requests to target the correct entity.
  • Uses the active React Flow node ID when applying drawer edits so the rendered lineage node updates immediately.
  • Preserves the existing behavior for legacy nodes without scene-node metadata.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Clicked React Flow node] --> B[Keep scene ID in activeNode]
    A --> C[Resolve entity UUID from sceneNode]
    C --> D[Open asset drawer]
    D --> E[Fetch entity permissions by UUID]
    D --> F[Submit metadata edit]
    F --> G[Update React Flow node by activeNode scene ID]
Loading

Reviews (3) · Last reviewed commit: "fix(lineage): open the drawer on the ent..."

@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 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 35 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), 35 warning(s) across 1 changed file(s).

Count Rule
33 react-hooks/exhaustive-deps
1 no-restricted-imports
1 openmetadata-imports/no-lower-layer-page-imports
All findings
Location Rule Message
🟡 src/context/LineageProvider/LineageProvider.tsx:20:1 no-restricted-imports '@untitledui/icons' import is restricted from being used by a pattern. Import icons from @openmetadata/ui-core-components/icons, not directly from @untitledui/i
🟡 src/context/LineageProvider/LineageProvider.tsx:107: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/context/LineageProvider/LineageProvider.tsx:756:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'isEditMode'. Either exclude it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:867:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setColumnsHavingLineage', 'setEdges', 'setIsRepositioning', and 'setNodes'. Either include them or remove the
🟡 src/context/LineageProvider/LineageProvider.tsx:935:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:994:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'isTourOpen', 'setEdges', 'setNodes', 't', and 'timeFilter'. Either include them or remove the dependency array
🟡 src/context/LineageProvider/LineageProvider.tsx:1023:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'navigate', 'setActiveLayer', and 'setPlatformView'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1095:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'exportLineageData', 'showModal', and 't'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1193:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'lineageData?.downstreamEdges', 'lineageData?.upstreamEdges', 't', and 'updateLineageData'. Either include them
🟡 src/context/LineageProvider/LineageProvider.tsx:1245:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setTracedColumns' and 'setTracedNodes'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1266:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'onPlatformViewChange' and 'setIsPlatformLineage'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1282:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'setSelectedEdge', 'setTracedColumns', and 'setTracedNodes'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1295:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'setTracedColumns'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1455:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'edges', 'removeEdgesBySourceTarget', and 'removeNodeById'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1651:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'setSelectedNode'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1674:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'selectLoadMoreNode', 'setActiveNode', 'setSelectedEdge', and 'setSelectedNode'. Either include them or remove
🟡 src/context/LineageProvider/LineageProvider.tsx:1684:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setActiveNode', 'setSelectedColumn', 'setSelectedNode', 'setTracedColumns', and 'setTracedNodes'. Either inclu
🟡 src/context/LineageProvider/LineageProvider.tsx:1696:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setActiveNode', 'setSelectedEdge', 'setSelectedNode', 'setTracedColumns', and 'setTracedNodes'. Either include
🟡 src/context/LineageProvider/LineageProvider.tsx:1744:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'setSelectedEdge'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1854:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'addTracedColumns', 'setColumnsHavingLineage', and 'setTracedNodes'. Either include them or remove the dependen
🟡 src/context/LineageProvider/LineageProvider.tsx:1873:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'setSelectedEdge'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:1954:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'bumpLineageMutationTick', 'handleModalCancel', and 'updateEdge'. Either include them or remove the dependency
🟡 src/context/LineageProvider/LineageProvider.tsx:2018:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'bumpLineageMutationTick', 'setSelectedEdge', and 'updateEdge'. Either include them or remove the dependency ar
🟡 src/context/LineageProvider/LineageProvider.tsx:2081:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setActiveNode' and 'updateLineageData'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2086:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'redraw'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2137:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'fetchLineageData', 'fetchPlatformLineage', and 'timeFilter'. Either include them or remove the dependency arra
🟡 src/context/LineageProvider/LineageProvider.tsx:2164:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'setActiveLayer' and 'setLineageConfig'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2207:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'removeNodeHandler'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2221:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'redraw'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2225:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'onPlatformViewUpdate'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2274:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'queryFilter' and 'setNodes'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2328:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'updateActiveLayer'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2334:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchDataQualityLineage'. Either include it or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2376:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'platformView' and 't'. Either include them or remove the dependency array.
🟡 src/context/LineageProvider/LineageProvider.tsx:2381:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'reset'. Either include it or remove the dependency array.

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

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.47% (103660/143036) 57.58% (63132/109634) 58.63% (20662/35237)

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit a3c274257aa72e726bbceb1ae18986db9c476a0b in Playwright run 35721239097, attempt 1.

✅ 655 passed · ❌ 0 failed · 🟡 3 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 55m 55s

⏱️ Max setup 4m 24s · max shard execution 19m 49s · max shard-job elapsed before upload 23m 20s · reporting 6s

🌐 218.94 requests/attempt · 2.70 app boots/UI scenario · 22.88% common-shard skew

Optimization targets still in progress:

  • Common shard skew was 22.88% (convergence target: at most 15%).
  • Browser traffic was 218.94 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.7 per UI scenario (1931 boots / 716 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 116 0 1 0 0 0
✅ Shard chromium-02 147 0 0 0 0 0
🟡 Shard chromium-03 114 0 1 0 0 0
✅ Shard chromium-04 112 0 0 0 0 0
🟡 Shard chromium-05 154 0 1 0 0 0
✅ Shard ingestion-01 12 0 0 0 0 0
🟡 3 flaky test(s) (passed on retry)
  • Pages/Domains.spec.ts › Verify domain and subdomain asset count accuracy (shard chromium-01, 1 retry)
  • Features/AccessControlSettings.spec.ts › should show all 4 landing cards and navigate to each panel (shard chromium-03, 1 retry)
  • Features/AIMode/CustomPropertiesPanel.spec.ts › deletes a custom property via the confirmation modal (shard chromium-05, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/lineage-drawer-entity-id branch from b60bd4c to 1710420 Compare September 22, 2026 11:17
"Verify LineageSearchSelect in lineage mode" failed asserting the selected
node renders. The selection had worked -- the search box shows the
container and the drawer is open -- but the drawer reads:

  You don't have necessary permissions. Please check with the admin to get
  the View Data Asset permission.

for an admin. The trace shows why:

  GET 404 /api/v1/permissions/container/container:45bfac5c-...
  GET 200 /api/v1/containers/name/pw-storage-service-...pw-container-f10e87e6

The permission request carries the scene node id where an entity UUID
belongs. `toLineageNode` spreads the real entity and then overwrites
`id` with `node.id` so React Flow can key on it, so `data.node.id` is
`<entityType>:<uuid>`. That object is handed to the drawer as-is, and
DataAssetSummaryPanelV1 fetches permissions by `dataAsset.id`, so the
request 404s, no permissions come back, and the panel reports denial for an
entity the caller can plainly read.

Resolve the real id through the existing `getRealEntityRef` accessor, which
reads it from the scene node's sourceEntity, and fall back to the previous
object when there is no sceneNode, so legacy non-scene nodes are untouched.
`handleEntityUpdate` uses the same id as its entity fallback and gets the
same correction.

Verified: tsc unchanged at 581 errors with the one LineageProvider entry
pre-existing in the test file, eslint 0 errors, 11/11 LineageProvider tests
pass. The Playwright test above is the regression guard.

(cherry picked from commit ebd72c7)
@chirag-madlani
chirag-madlani force-pushed the chirag-madlani/lineage-drawer-entity-id branch from 1710420 to a3c2742 Compare September 22, 2026 11:24
@chirag-madlani

Copy link
Copy Markdown
Collaborator Author

Good catch — real bug. Applied the suggested fix at 1710420f2c → a3c274257a:

  • handleEntityUpdate now falls back to activeNode?.id (the scene id that updateNodeData matches on), not selectedNode?.id (the real entity UUID).
  • Added activeNode to the useCallback deps.
  • Added a comment explaining the scene-id vs entity-id distinction so this doesn't get flipped back by a future refactor.

The drawer's onEntityUpdate callers (EntitySummaryPanel.component.tsx — owners/tags/extension) all pass partial payloads without id, so the fallback is the code path that actually fires in practice, per the review.

@gitar-bot

gitar-bot Bot commented Sep 22, 2026

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

🔴 High risk · Lineage drawer permission lookups change the entity used for authorization decisions

Fixes the lineage drawer to open with the real entity UUID instead of the React Flow scene node ID, resolving permission request failures for admins viewing permitted entities. Drawer edits no longer incorrectly update the graph node in scene mode.

✅ 1 closed
✅ Bug: Drawer edits no longer update the graph node in scene mode

📄 openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.tsx:1643 📄 openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.tsx:1665 📄 openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.tsx:180-187
onNodeClick now stores toDrawerEntity(node) in selectedNode, whose id is the real entity UUID rather than the scene node id (<type>:<uuid>). handleEntityUpdate computes entityId = updatedEntity.id ?? selectedNode?.id, and the drawer's onEntityUpdate is always called with partial payloads that omit id ({ owners }, { tags }, { extension } in EntitySummaryPanel.component.tsx). So entityId falls back to the real UUID and is passed to updateNodeData, which matches React Flow nodes by node.id — the scene id assigned in toLineageNode/nextNodes. The UUID never matches the scene id, so owner/tag/custom-property edits made from the lineage drawer no longer propagate to the node in the graph (they did before this change, when selectedNode.id was the scene id).

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

@chirag-madlani
chirag-madlani added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit d4362e2 Sep 22, 2026
103 of 105 checks passed
@chirag-madlani
chirag-madlani deleted the chirag-madlani/lineage-drawer-entity-id branch September 22, 2026 14:52

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.

3 participants