Skip to content

fix(ui): drop nodeDepth partitioning so ELK derives lineage layers from edges#29224

Open
chirag-madlani wants to merge 3 commits into
mainfrom
fix-lineage-layout
Open

fix(ui): drop nodeDepth partitioning so ELK derives lineage layers from edges#29224
chirag-madlani wants to merge 3 commits into
mainfrom
fix-lineage-layout

Conversation

@chirag-madlani

@chirag-madlani chirag-madlani commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #29225

I dropped the nodeDepth-based ELK partitioning in the lineage graph and let ELK's layered algorithm derive layers from edge topology (with BRANDES_KOEPF node placement) because pinning each node to its single backend nodeDepth forced a multi-branch node into the column of its first depth while its other edges fanned out to different columns, producing a visually misaligned graph. The result is a cleaner, less rigid horizontal flow, and it also removes the partition-on-cyclic-graph crash source.

Type of change:

  • Bug fix

High-level design:

N/A — small change (3 files): removed the per-node elk.partitioning.partition hint in getELKLayoutedElements, and removed elk.partitioning.activate while switching elk.layered.nodePlacement.strategy from SIMPLE to BRANDES_KOEPF in ELKUtil. Focus/root centering is unaffected — it is handled separately by centerNodePosition, not by partitioning.

Tests:

Use cases covered

  • A lineage node reachable at multiple depths is placed at the layer that best fits all its edges instead of being locked to its first backend depth.

Unit tests

  • Updated ELKUtil.test.ts to match the new layout options (19/19 pass).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (layout-only change to existing graph).

Manual testing performed

  1. Verified ELKUtil unit suite passes.
  2. Reviewed the lineage layout flow to confirm partitioning was the only consumer of nodeDepth in layout and that focus centering is independent.

UI screen recording / screenshots:

To be attached.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added/updated tests and listed them above.

Greptile Summary

This PR fixes a visual misalignment in the lineage graph by dropping ELK's node partitioning feature, which was forcing each node into the column dictated by its single backend nodeDepth value. As a side effect this also eliminates a crash path when partitioning encounters a cyclic graph.

  • EntityLineageLayoutUtils.ts: Removes the per-node elk.partitioning.partition hint so nodes are no longer locked to a fixed column; disconnected or multi-branch nodes can now settle into the layer that best satisfies all their edges.
  • ELKUtil.ts: Drops elk.partitioning.activate and upgrades node placement from SIMPLE to BRANDES_KOEPF with bk.fixedAlignment: BALANCED, which averages the four extreme Brandes-Köpf alignments to keep symmetric nodes vertically centred.
  • ELKUtil.test.ts: Keeps unit coverage in sync — all 19 tests now reflect the new options, including an explicit toBeUndefined check confirming partitioning is off.

Confidence Score: 5/5

Safe to merge — a focused, well-explained layout-only change with no backend or data-model impact.

The change removes a specific, narrowly-scoped feature (ELK partitioning) that was causing node misalignment and cyclic-graph crashes, replaces it with a well-supported ELK algorithm setting, and updates all affected unit tests. The runtime fallback in getELKLayoutedElements is already in place if ELK throws, and focus/centering logic is unchanged.

No files require special attention.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts Removed per-node elk.partitioning.partition hint that was pinning nodes to their backend nodeDepth, letting ELK's layered algorithm place them purely from edge topology.
openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.ts Replaced SIMPLE node placement + elk.partitioning.activate with BRANDES_KOEPF + bk.fixedAlignment: BALANCED; well-commented explaining the alignment rationale.
openmetadata-ui/src/main/resources/ui/src/utils/Lineage/Layout/ELKUtil/ELKUtil.test.ts Tests updated to match new layout options; renamed test descriptions, added assertion for bk.fixedAlignment, and added an explicit toBeUndefined check for the now-removed elk.partitioning.activate.

Reviews (3): Last reviewed commit: "fix(ui): use BALANCED Brandes-Köpf align..." | Re-trigger Greptile

…om edges

Pinning each node to its backend nodeDepth via elk.partitioning forced a
multi-branch node into the column of its first depth, misaligning its other
edges. Let ELK's layered algorithm derive layers from edge topology and use
BRANDES_KOEPF node placement for a cleaner, less rigid horizontal flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chirag-madlani chirag-madlani requested a review from a team as a code owner June 19, 2026 13:47
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.27% (66682/107071) 44.07% (37353/84743) 45.39% (11207/24687)

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (9 flaky)

✅ 4311 passed · ❌ 0 failed · 🟡 9 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 301 0 1 4
🟡 Shard 2 814 0 1 9
🟡 Shard 3 815 0 1 8
🟡 Shard 4 858 0 1 12
🟡 Shard 5 731 0 2 47
🟡 Shard 6 792 0 3 8
🟡 9 flaky test(s) (passed on retry)
  • Pages/Roles.spec.ts › Roles page should work properly (shard 1, 2 retries)
  • Features/ActivityAPI.spec.ts › renders a description-updated activity item in the feed (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/Entity.spec.ts › User as Owner Add, Update and Remove (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 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

BRANDES_KOEPF aligned a node to one child (top-biased), so a source with
children Y and Z sat parallel to Y instead of vertically centered. Switch
node placement to NETWORK_SIMPLEX, which assigns cross-axis coordinates by
minimizing weighted edge deviation, keeping a source balanced between its
children.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
NETWORK_SIMPLEX (and bare Brandes-Köpf) resolve a symmetric source's
placement to a top-aligned corner because all alignments tie on edge length,
so the source did not sit centered between its upstream/downstream branches.
Setting elk.layered.nodePlacement.bk.fixedAlignment to BALANCED averages the
four extreme alignments into a centroid, restoring vertical centering while
keeping edge-aware, straight-segment placement.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Removes nodeDepth partitioning from the lineage graph to resolve node misalignment and cyclic graph crashes, allowing ELK to derive layers from edge topology. Unit tests successfully updated to reflect the new layout configuration.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

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.

UI - enhance lineage rendering to show lineage without crossing edges

1 participant