Skip to content

Fixes #35891: Fix hierarchical lineage issues found in 2.1 release testing - #35892

Merged
mohityadav766 merged 12 commits into
mainfrom
fix/hierarchical-lineage-release-fixes
Nov 4, 2026
Merged

mohityadav766 merged 12 commits into
mainfrom
fix/hierarchical-lineage-release-fixes

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #35891

Fixes the hierarchical lineage issues found while writing the 2.1.0 release-testing plan for #29204.

Lineage page (/lineage)

  • Header follows the lens. It read the legacy platformView URL parameter, which the map no longer writes, so it said "Service Lineage" under the Domain and Data Product lenses. It now reads lineageLens through the map's own getSceneRequestFromSearch, and the lens name is translated.
  • Tab title names the entity. It used label.entity-lineage, which is the literal "Entity Lineage" (also the Entity Lineage layer option, so its text stays). The title now uses the {{platformType}} Lineage key with the entity name.
  • PNG export captures the graph. The page had its own export that passed no nodes, no edge overlay and no capture hooks, so the image framed the canvas origin with no edges. The new LineageExportButton exports the graph the map now publishes to the lineage store (its laid-out nodes and edges), so it needs no <Lineage> around it: in AI mode the page header that holds it renders outside <Lineage> (Fixes 36092: Lineage UI design and testing feedback #36093, Fixes 36242: Use the shared AI page layout on Platform Lineage #36253). Lineage no longer mirrors its empty classic graph over them on this page.

PNG export (both lineage views)

  • The frame is fitted at capture time. The shared export fitted its frame when the modal opened, while only the nodes in view were mounted. beforeCapture then mounts every node and the image grows, so any graph with nodes off screen came out shrunk into a corner. This hit the asset Lineage tab too, since Lineage tab freezes the browser tab for minutes when the lineage response is very large (~20 MB) #34904 virtualized the canvas. ExportData.getViewport(imageWidth, imageHeight) is now called after beforeCapture, at the size the capture renders, and the capture hands the same frame to the edge overlay.

Lineage settings

  • Saving keeps what the form does not edit. The classic Settings page and the AI-mode form sent only their four fields, and the settings PUT replaces the whole value, so every save dropped graphPerformanceConfig. Both now send the loaded value back with the edited fields.
  • No save without a loaded value. If the settings fail to load, both forms show "Something went wrong" with Reload instead of a form. A save from an unloaded form would still have wiped what it does not edit.

Scene API

  • GET /v1/lineage/scene returns 400 for a malformed query_filter (broken JSON, or JSON the search client cannot read as a query), with Invalid query_filter: …. It returned 500.

Nightly scale benchmark (LineageScenePerformanceScaleIT)

  • The token is renewed during seeding. Both nightly runs that reached the class (2026-10-18 and 2026-10-19) failed about an hour into the 50k-table seed with 401 Expired token!. The external admin-token refresher starts when something takes the server handle, which this class did only after seeding, and it also kept an admin client captured before the run. It now takes the handle first and calls through server.sdk(), as the other scale classes do.
  • LineageMapPage follows today's map. It now matches the markup Fixes #33865: Inline lineage editing via node and column menus #34551 changed:
    • the root crumb is clicked through the breadcrumb trail (core Breadcrumbs has no per-crumb test ids);
    • fit to screen is a plain button;
    • the map renders lineage-map-canvas again, on a wrapper, because React Flow overwrites its own root's data-testid.
  • Zoom-in wheels over the benchmark's own service. The map drills only into the node under the pointer, the selected node or the only drillable node in view, so the zoom buttons never drilled while several services were on screen.
  • docs/perf/lineage-scale-validation.md records these changes, and docs/index.md loses a duplicate, older row for that doc.

Merged with main (latest 2026-11-04)

Left out on purpose:

  • The drill button on an empty container. The backend marks every container drillable, and the counts that could say "empty" are complete only on some paths.
  • The "Showing N of M" pill for non-admin users. The server marks every non-admin scene sampled on purpose, so it does not reveal whether anything was hidden. Rewording the pill is a design call.

Type of change:

  • Bug fix

High-level design:

Not applicable: these are separate bug fixes. Two structural points:

  • Both lineage PNG exports share their PNG options, getLineagePngExportOptions in CanvasUtils.ts: the frame, the edge overlay and the capture hooks. The map publishes the graph it draws to the lineage store's nodes and edges, which is what those fields already hold on the asset tab, and LineageExportButton exports it from there. onExportClick in Lineage.tsx now serves only the asset tab; nothing on the Lineage page calls it.
  • ExportData gains getViewport(imageWidth, imageHeight), which takes precedence over the precomputed viewport. The lineage export frames its capture with it, through the new pure getExportViewportForNodes.
  • ExportData.viewport and getViewportForLineageExport(nodes, selector) keep their signatures and behaviour, because Collate's ER diagram export uses both. No Collate change is needed.

Tests:

Use cases covered

  • /lineage header reads Service, Domain and Data Product Lineage as the lens changes; a legacy ?platformView=Domain link no longer relabels it.
  • /lineage/:entityType/:fqn tab title starts with " Lineage".
  • PNG export frames all of the graph's nodes and edges, including those off screen, on both the Lineage page and the asset tab.
  • Saving Lineage settings on the classic page and in the AI-mode form keeps graphPerformanceConfig; when the settings fail to load, both forms offer Reload, not Save.
  • An export that passes a precomputed viewport (Collate's ER diagram) is framed as before.
  • The scene endpoint answers three malformed filters with 400 and Invalid query_filter.
  • The scale benchmark keeps its token across the seed, and its browser scenarios run against today's map.

These tests fail on main (each was run before its fix):

  • LineageSceneQueryTest.malformedFiltersAreRejectedAsBadRequests (3 cases)
  • ExportUtils.test.tsx: frames the capture with the size measured after beforeCapture, draws the edges in the same frame as the nodes
  • LineageConfigPage.test.tsx and LineageSettingsForm.test.tsx: keeps the settings the form does not edit, does not offer saving until the settings load
  • PlatformLineage.test.tsx: the header, title and export tests (6)
  • Lineage.test.tsx: keeps the map's graph in the store

Unit tests

  • Java: LineageSceneQueryTest; all 8 LineageScene*Test classes pass (69 tests).
  • Jest: the new LineageExportButton.test.tsx (it fails against a button that goes through the <Lineage> handlers, which do nothing in the AI-mode header), plus CanvasUtils.test.ts (getLineagePngExportOptions fits every node, draws the graph's edges in that frame on a stubbed canvas, and mounts every node for the capture), PlatformLineage.test.tsx, Lineage.test.tsx, ExportUtils.test.tsx, EntityLineageUtils.test.tsx, LineageMap.utils.test.ts, LineageConfigPage.test.tsx and LineageSettingsForm.test.tsx. On the branch merged with main on 2026-11-04, all lineage, export and lineage-settings suites pass: 72 suites, 1047 tests.

Backend integration tests

  • LineageResourceIT.testLineageSceneRejectsMalformedQueryFilter (status 400 and the message, 3 cases). It passed locally against this branch's server.
  • LineageScenePerformanceScaleIT, run against a local server in external mode the way the nightly runs it (see Manual testing).

Playwright (UI) tests

  • Pages/Lineage/PlatformLineage.spec.ts: the header for each lens, and the tab title.
  • Flow/LineageSettings.spec.ts: new Saving the lineage config keeps the settings the form does not edit, which reads the stored setting back.
  • Features/ProfilePlatformSettings.spec.ts: the lineage save keeps graphPerformanceConfig.

Local run against this branch on 2026-10-21, before the merges with main (server plus Vite UI):

  • PlatformLineage.spec.ts and LineageSettings.spec.ts: 15 passed, including the setup projects.
  • ProfilePlatformSettings.spec.ts › lineage: saves depths and layer: passed.
  • After the export frame change, Verify Platform Lineage View and DataAssetLineage.spec.ts › verify pipeline, export and removal for entity - Table (both PNG exports) passed.

Manual testing performed

These ran on 2026-10-21, before the merges with main. The AI-mode header export is covered by the unit tests above but was not re-run in a browser.

Local stack: this branch's server (Postgres 14, Elasticsearch 9.3), with this branch's UI served by Vite.

  1. Token renewal. I set the login token lifetime to 120 s and ran LineageScenePerformanceScaleIT#sceneApiLatencyStaysWithinBudget in external mode (OM_URL, OM_ADMIN_TOKEN, OM_EXTERNAL_USERNAME/PASSWORD) on 6,000 tables and 6,000 edges.
    • The refresher started before seeding and renewed the token 4 times.
    • The run passed: 4 min 8 s, 19 scenarios, no 401.
    • A 120 s token used after it expired gets 401 Expired token!, the nightly's error.
  2. Browser scenarios. I ran the whole class through the Vite UI on a 400-table cohort.
    • First render, the four drills, the breadcrumb pop, zoom-out, band switch and fit to screen were all measured.
    • The first run timed out on semantic-zoom-in, which led to the wheel change above.
    • The re-run measured all 9 interactions.
  3. Malformed filter. GET /api/v1/lineage/scene returned 400 Invalid query_filter: … for query_filter={"query":, {"term":{}} and ["not","a","query"]. A valid tier filter returned 200.
  4. PNG export, Lineage page. A schema scene of 200 tables, with 40 nodes in view:
    • Before the frame fix: the graph sat at 7.5% scale in one corner of a 6448×9924 image (737 non-white pixels sampled).
    • After: it fills the image with every node and edge (159,631 non-white pixels sampled).
  5. PNG export, asset Lineage tab. Zoomed in to 250% on a hub table (1 node mounted), the export still holds the whole graph and its edges.

UI screen recording:

Not applicable: these are bug fixes, not a feature. Before and after images of the export are available on request.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable, no schema change.
  • For a UI feature or feature task: not applicable, bug fixes.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md.
  • Decision check: no new decision. The lineage-map-canvas test id the benchmark relies on is documented in docs/perf/lineage-scale-validation.md.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The remaining PNG test gap must be addressed before merging to meet the repository’s testing requirement.

Findings

  1. P2 PNG test skips drawing ▶

Summary

This PR fixes lineage labels, PNG framing, settings saves, malformed-filter responses, and the nightly benchmark.

  • PNG exports fit the graph after every node is ready.
  • The Lineage page exports the graph drawn by its map.
  • Lineage headings name the selected view and focused entity.
  • Lineage settings saves keep fields the forms do not edit.
  • Malformed lineage scene filters return a clear client error.
  • The lineage scale benchmark uses the refreshed server and current map controls.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Open PNG export] --> B[Mount off-screen nodes]
  B --> C[Measure capture size]
  C --> D[Fit graph to image]
  D --> E[Capture nodes and draw edges in the same frame]
  E --> F[Restore normal node rendering]
Loading

Reviews (3) · Last reviewed commit: "Do not offer saving lineage settings tha..." · Reviewed by Greptile

…sting

Lineage page (/lineage):
- The header names the lens the map is drawn through (lineageLens), not
  the legacy platformView parameter, which the map no longer reads.
- The browser tab title names the focused entity; "Entity Lineage" had no
  placeholder.
- PNG export goes through the shared onExportClick, which reads the graph
  the map now publishes to the lineage store: its laid-out nodes and its
  edges. Lineage no longer mirrors its empty classic graph over them on
  this page.

PNG export (both lineage views):
- The capture fits its frame after beforeCapture mounts the off-screen
  nodes, at the size it renders (ExportData.getViewport), and hands that
  frame to the edge overlay. A frame fitted when the modal opened shrank
  any graph with nodes out of view into a corner of the image.

Lineage settings:
- The classic page and the AI-mode form send back the fields they do not
  edit. The settings PUT replaces the whole value, so every save dropped
  graphPerformanceConfig.

Scene API:
- GET /v1/lineage/scene answers a malformed query_filter with 400, not 500.

Nightly scale benchmark (LineageScenePerformanceScaleIT):
- Take the server handle before seeding, which starts the admin-token
  refresher, and call through server.sdk(). The seed outlasted the login
  token, and the nightly failed with 401 Expired token.
- LineageMapPage follows the map markup #34551 changed: the root crumb is
  clicked through the breadcrumb trail, fit to screen is a button, and the
  map renders lineage-map-canvas again, on a wrapper because React Flow
  overwrites its own root's data-testid. Zoom-in wheels over the
  benchmark's own service, because the zoom buttons never drill while
  several services are in view.
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 982 → 985
- 3 added, 0 removed, 2 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageExportButton/LineageExportButton.tsx
  openmetadata-ui/src/main/resources/ui/src/components/PageHeader/PageHeader.component.tsx
  openmetadata-ui/src/main/resources/ui/src/components/common/atoms/navigation/usePageHeader.tsx

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/SearchSettings/EntitySeachSettings/EntitySearchSettings.tsx
  openmetadata-ui/src/main/resources/ui/src/pages/PlatformLineage/PlatformLineage.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

Comment on lines +233 to +244
options.renderEdgesOverlay(800, 600, 20, 2, EXPORT_VIEWPORT);

expect(drawEdgesForExport).toHaveBeenCalledWith(
MAP_EDGES,
new Map(MAP_NODES.map((node) => [node.id, node])),
EXPORT_VIEWPORT,
800,
600,
20,
2,
expect.anything()
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 PNG test skips drawing

The new PNG test mocks getViewportForLineageExport, drawEdgesForExport, and the export modal provider, then checks their calls. It never captures an image or draws an edge, so it can pass with incorrect framing or missing edges.

This violates the repository requirement to test real behavior rather than mock wiring. Before merging, add a test that runs the real frame and edge helpers and checks the captured output.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@github-actions

github-actions Bot commented Oct 21, 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/LineageConfigPage/LineageConfigPage.tsx:85:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/LineageConfigPage/LineageConfigPage.tsx:150:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchSearchConfig'. Either include it or remove the dependency array.

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

make ui-checkstyle-changed

Collate's ER diagram export still passes a viewport fitted with
getViewportForLineageExport(nodes, selector), so both keep their
signatures from main. The lineage export fits its frame with the new
getExportViewportForNodes through getViewport, which takes precedence
over a preset viewport.
A new import from assets/svg fails the UI deprecation guard; take Download01 from @openmetadata/ui-core-components/icons instead.
The settings PUT replaces the whole value, so saving a form whose load
failed would wipe what it does not edit, graphPerformanceConfig included.
Both lineage settings forms show the error state with Reload until it loads.
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.37% (138278/169930) 68.4% (49860/72889) 71.46% (28015/39200)

@mohityadav766 mohityadav766 self-assigned this Oct 21, 2026
…age-release-fixes

PlatformLineage keeps #36093's AI-mode header. Its export button becomes
LineageExportButton, and the page header and tab title keep this branch's
lens and entity-name fixes.
#36093 moved the Lineage page's export button into the AI-mode page
header, which renders outside <Lineage>, where the lineage handlers
context only has its no-op default. LineageExportButton now builds the
PNG export itself from the graph the map publishes to the lineage store,
and takes the header's button size.

The PNG options (frame, edge overlay, capture hooks) move into
getLineagePngExportOptions, shared with the asset Lineage tab. Nothing on
the Lineage page calls onExportClick any more, so it drops its platform
branch.
…age-release-fixes

#36253 moved the Lineage page onto the shared AI page layout. The tab
title this branch fixes is now its pageTitle, which the AI layout's
DocumentTitle reads too, so the AI-mode test expects the entity's name.
The Playwright impact map is regenerated.
#36370 drills in once a card fills 35% of the viewport and the zoom has
settled for 250ms, and lets button zoom drill the drillable node nearest
the canvas centre. LineageMapPage still wheels over its own node, which
targets it either way; its Javadoc and the scale doc now say so.
@mohityadav766
mohityadav766 added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-29T13:32:05Z)

Blocked the queue: integration-tests-mysql-elasticsearch

@mohityadav766
mohityadav766 added this pull request to the merge queue Oct 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-29T20:02:12Z)

Blocked the queue: integration-tests-mysql-elasticsearch

@mohityadav766
mohityadav766 added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-30T13:51:39Z)

Blocked the queue: integration-tests-postgres-elasticsearch-redis

@mohityadav766
mohityadav766 added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-11-02T13:12:46Z)

Blocked the queue: integration-tests-postgres-elasticsearch-redis

Comment on lines +46 to 54
try {
JsonNode filter = JsonUtils.readTree(queryFilter);
JsonNode innerQuery = filter.has("query") ? filter.path("query") : filter;
if (!nullOrEmpty(innerQuery)) {
result = Query.of(clause -> clause.withJson(new StringReader(innerQuery.toString())));
}
} catch (JsonParsingException | JsonException e) {
throw new BadRequestException("Invalid query_filter: " + e.getMessage(), e);
}

@gitar-bot gitar-bot Bot Nov 3, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: query_filter that is valid JSON but missing required fields still returns 500

parseQueryFilter now catches only JsonParsingException | JsonException. The Elasticsearch Java client builds each query object after parsing it, and the builder throws MissingRequiredPropertyException (a plain RuntimeException, not a JsonException) when a required property is absent. A filter like {"term":{"name":{}}} or {"match":{"name":{}}} is well-formed JSON, so it gets past both catches and still comes back as a 500 instead of the 400 'Invalid query_filter' this PR promises. The tests only cover truncated JSON, an empty clause and an array, so this path is not exercised. Add the client's MissingRequiredPropertyException (from the shaded es.co.elastic.clients.util package) to the catch, and add a test case like {"term":{"name":{}}}.

Also map the client's missing-required-property failure to a 400:

} catch (JsonParsingException | JsonException | MissingRequiredPropertyException e) {
  throw new BadRequestException("Invalid query_filter: " + e.getMessage(), e);
}

Was this helpful? React with 👍 / 👎

Comment on lines +57 to +71
/** Frames the content of a PNG capture. `getViewport` takes precedence. */
viewport?: ExportViewport;
/**
* Frames the content of a PNG capture. Called after `beforeCapture` with the
* size the capture renders at, so the frame covers what `beforeCapture`
* mounted; a frame fitted before that would shrink the content to a corner.
*/
getViewport?: (imageWidth: number, imageHeight: number) => ExportViewport;
exportConfig?: Partial<PDFLayoutConfig>;
hideExportModal?: boolean;
renderEdgesOverlay?: (
imageWidth: number,
imageHeight: number,
padding: number,
pixelRatio: number
pixelRatio: number,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Quality: Collate's dependency on the export viewport API is only in the PR text

The description says ExportData.viewport and getViewportForLineageExport keep their signatures and behavior because Collate's ER diagram export depends on them. This PR also widens the same ExportData contract: it adds getViewport, which takes precedence over viewport, and passes renderEdgesOverlay a fifth viewport argument. Nothing in the tree records this dependency. The new JSDoc on getViewportForLineageExport only says which canvases it suits, and no record in docs/decisions/ covers ExportData. The repository squash-merges, so the next refactor of these helpers has nothing in the tree telling it that another repository consumes them. A record should state: "ExportData.viewport, ExportData.getViewport (which wins when both are set), the five-argument renderEdgesOverlay, and getViewportForLineageExport(nodes, selector) form a contract with Collate's ER diagram export; changing their signatures or behavior needs a coordinated Collate change."

Was this helpful? React with 👍 / 👎

mohityadav766 and others added 2 commits November 4, 2026 16:55
…age-release-fixes

#36901 drives the lineage map's nodes through useUncontrolledNodeDrag; the
canvas keeps its lineage-map-canvas wrapper around the new flow props.
#35438 gave the Lineage page's settings button a translated tooltip, so the
action-button memo depends on t again. The Playwright impact map is
regenerated.
@gitar-bot

gitar-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 0 closed / 2 findings

🟡 Medium risk · Changing lineage PNG framing and settings preservation could produce incomplete exports or lose unrelated configuration if graph state or loaded settings are wrong.

Fixes hierarchical lineage issues: the lineage header and tab title now follow the lens and entity, PNG exports frame the full graph including off-screen nodes, lineage settings saves keep fields the form does not edit, and the scene API is meant to return 400 for malformed query filters. Changes are requested before merge. A valid-JSON filter missing required fields such as {"term":{"name":{}}} still returns 500 instead of 400, because MissingRequiredPropertyException is not caught in LineageSceneQuery.parseQueryFilter, and that path needs a test. The ExportData viewport contract that Collate depends on, including the new getViewport precedence and the five-argument renderEdgesOverlay, is documented only in the PR text and should be recorded in the repository.

⚠️ Quality: Collate's dependency on the export viewport API is only in the PR text

📄 openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityExportModalProvider/EntityExportModalProvider.interface.ts:57-71 📄 openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts:162-176 📄 openmetadata-ui/src/main/resources/ui/src/utils/Export/ExportUtils.ts:175-189

The description says ExportData.viewport and getViewportForLineageExport keep their signatures and behavior because Collate's ER diagram export depends on them. This PR also widens the same ExportData contract: it adds getViewport, which takes precedence over viewport, and passes renderEdgesOverlay a fifth viewport argument. Nothing in the tree records this dependency. The new JSDoc on getViewportForLineageExport only says which canvases it suits, and no record in docs/decisions/ covers ExportData. The repository squash-merges, so the next refactor of these helpers has nothing in the tree telling it that another repository consumes them. A record should state: "ExportData.viewport, ExportData.getViewport (which wins when both are set), the five-argument renderEdgesOverlay, and getViewportForLineageExport(nodes, selector) form a contract with Collate's ER diagram export; changing their signatures or behavior needs a coordinated Collate change."

💡 Edge Case: query_filter that is valid JSON but missing required fields still returns 500

📄 openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneQuery.java:46-54 📄 openmetadata-service/src/test/java/org/openmetadata/service/lineage/LineageSceneQueryTest.java:64-71

parseQueryFilter now catches only JsonParsingException | JsonException. The Elasticsearch Java client builds each query object after parsing it, and the builder throws MissingRequiredPropertyException (a plain RuntimeException, not a JsonException) when a required property is absent. A filter like {"term":{"name":{}}} or {"match":{"name":{}}} is well-formed JSON, so it gets past both catches and still comes back as a 500 instead of the 400 'Invalid query_filter' this PR promises. The tests only cover truncated JSON, an empty clause and an array, so this path is not exercised. Add the client's MissingRequiredPropertyException (from the shaded es.co.elastic.clients.util package) to the catch, and add a test case like {"term":{"name":{}}}.

Also map the client's missing-required-property failure to a 400
} catch (JsonParsingException | JsonException | MissingRequiredPropertyException e) {
  throw new BadRequestException("Invalid query_filter: " + e.getMessage(), e);
}
🤖 Prompt for agents
Code Review: Fixes hierarchical lineage issues: the lineage header and tab title now follow the lens and entity, PNG exports frame the full graph including off-screen nodes, lineage settings saves keep fields the form does not edit, and the scene API is meant to return 400 for malformed query filters. Changes are requested before merge. A valid-JSON filter missing required fields such as `{"term":{"name":{}}}` still returns 500 instead of 400, because `MissingRequiredPropertyException` is not caught in `LineageSceneQuery.parseQueryFilter`, and that path needs a test. The `ExportData` viewport contract that Collate depends on, including the new `getViewport` precedence and the five-argument `renderEdgesOverlay`, is documented only in the PR text and should be recorded in the repository.

1. 💡 Edge Case: query_filter that is valid JSON but missing required fields still returns 500
   Files: openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneQuery.java:46-54, openmetadata-service/src/test/java/org/openmetadata/service/lineage/LineageSceneQueryTest.java:64-71

   `parseQueryFilter` now catches only `JsonParsingException | JsonException`. The Elasticsearch Java client builds each query object after parsing it, and the builder throws `MissingRequiredPropertyException` (a plain `RuntimeException`, not a `JsonException`) when a required property is absent. A filter like `{"term":{"name":{}}}` or `{"match":{"name":{}}}` is well-formed JSON, so it gets past both catches and still comes back as a 500 instead of the 400 'Invalid query_filter' this PR promises. The tests only cover truncated JSON, an empty clause and an array, so this path is not exercised. Add the client's `MissingRequiredPropertyException` (from the shaded `es.co.elastic.clients.util` package) to the catch, and add a test case like `{"term":{"name":{}}}`.

   Fix (Also map the client's missing-required-property failure to a 400):
   } catch (JsonParsingException | JsonException | MissingRequiredPropertyException e) {
     throw new BadRequestException("Invalid query_filter: " + e.getMessage(), e);
   }

2. ⚠️ Quality: Collate's dependency on the export viewport API is only in the PR text
   Files: openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityExportModalProvider/EntityExportModalProvider.interface.ts:57-71, openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageLayoutUtils.ts:162-176, openmetadata-ui/src/main/resources/ui/src/utils/Export/ExportUtils.ts:175-189

   The description says `ExportData.viewport and getViewportForLineageExport keep their signatures and behavior because Collate's ER diagram export depends on them`. This PR also widens the same `ExportData` contract: it adds `getViewport`, which takes precedence over `viewport`, and passes `renderEdgesOverlay` a fifth `viewport` argument. Nothing in the tree records this dependency. The new JSDoc on `getViewportForLineageExport` only says which canvases it suits, and no record in `docs/decisions/` covers `ExportData`. The repository squash-merges, so the next refactor of these helpers has nothing in the tree telling it that another repository consumes them. A record should state: "`ExportData.viewport`, `ExportData.getViewport` (which wins when both are set), the five-argument `renderEdgesOverlay`, and `getViewportForLineageExport(nodes, selector)` form a contract with Collate's ER diagram export; changing their signatures or behavior needs a coordinated Collate change."

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@mohityadav766
mohityadav766 merged commit c6c6cfa into main Nov 4, 2026
64 of 71 checks passed
@mohityadav766
mohityadav766 deleted the fix/hierarchical-lineage-release-fixes branch November 4, 2026 14:04
manerow added a commit that referenced this pull request Nov 5, 2026
mohityadav766 added a commit that referenced this pull request Nov 6, 2026
…e (backport 2.0 #35892) (#37168)

* Fixes #35891: Fix lineage page PNG export, tab title and settings save (backport 2.0 #35892)

The parts of #35892 that apply to 2.0, which has no hierarchical lineage
map:
- The Lineage page exports through the lineage provider, which frames and
  draws the platform graph it holds. The page's own export framed an empty
  node list and drew no edges.
- The browser tab title on /lineage/:entityType/:fqn names the entity;
  label.entity-lineage is the literal "Entity Lineage".
- Saving the lineage settings sends back the fields the page does not
  edit. The settings PUT replaces the whole value, so every save dropped
  graphPerformanceConfig. A page whose settings failed to load offers
  Reload instead of a form.

* chore(playwright): auto-refresh impact-map.generated.json

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hierarchical lineage: fixes from 2.1 release testing

3 participants