Repository navigation
Fixes #35891: Fix hierarchical lineage issues found in 2.1 release testing - #35892
Conversation
…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.
❌ 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 |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated 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 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 |
| 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() | ||
| ); |
There was a problem hiding this comment.
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!
|
| 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-changedCollate'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.
…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.
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
| 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); | ||
| } |
There was a problem hiding this comment.
💡 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 👍 / 👎
| /** 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, |
There was a problem hiding this comment.
⚠️ 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 👍 / 👎
…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.
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
|
…sting (#35892) (#37118) Co-authored-by: Mohit Yadav <[email protected]>
…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>



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)platformViewURL parameter, which the map no longer writes, so it said "Service Lineage" under the Domain and Data Product lenses. It now readslineageLensthrough the map's owngetSceneRequestFromSearch, and the lens name is translated.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}} Lineagekey with the entity name.LineageExportButtonexports 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).Lineageno longer mirrors its empty classic graph over them on this page.PNG export (both lineage views)
beforeCapturethen 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 afterbeforeCapture, at the size the capture renders, and the capture hands the same frame to the edge overlay.Lineage settings
graphPerformanceConfig. Both now send the loaded value back with the edited fields.Scene API
GET /v1/lineage/scenereturns 400 for a malformedquery_filter(broken JSON, or JSON the search client cannot read as a query), withInvalid query_filter: …. It returned 500.Nightly scale benchmark (
LineageScenePerformanceScaleIT)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 throughserver.sdk(), as the other scale classes do.LineageMapPagefollows today's map. It now matches the markup Fixes #33865: Inline lineage editing via node and column menus #34551 changed:lineage-map-canvasagain, on a wrapper, because React Flow overwrites its own root'sdata-testid.docs/perf/lineage-scale-validation.mdrecords these changes, anddocs/index.mdloses a duplicate, older row for that doc.Merged with main (latest 2026-11-04)
pageTitle. The lens label, the tab title and the export fixes apply to both layouts.LineageMapPagestill wheels over its own node, anddocs/perf/lineage-scale-validation.mdnow describes the new rule.useUncontrolledNodeDrag. The map still publishes its laid-out nodes, which take a dragged node's position on drop, so the export frames what the canvas shows.Left out on purpose:
Type of change:
High-level design:
Not applicable: these are separate bug fixes. Two structural points:
getLineagePngExportOptionsinCanvasUtils.ts: the frame, the edge overlay and the capture hooks. The map publishes the graph it draws to the lineage store'snodesandedges, which is what those fields already hold on the asset tab, andLineageExportButtonexports it from there.onExportClickinLineage.tsxnow serves only the asset tab; nothing on the Lineage page calls it.ExportDatagainsgetViewport(imageWidth, imageHeight), which takes precedence over the precomputedviewport. The lineage export frames its capture with it, through the new puregetExportViewportForNodes.ExportData.viewportandgetViewportForLineageExport(nodes, selector)keep their signatures and behaviour, because Collate's ER diagram export uses both. No Collate change is needed.Tests:
Use cases covered
/lineageheader reads Service, Domain and Data Product Lineage as the lens changes; a legacy?platformView=Domainlink no longer relabels it./lineage/:entityType/:fqntab title starts with " Lineage".graphPerformanceConfig; when the settings fail to load, both forms offer Reload, not Save.viewport(Collate's ER diagram) is framed as before.Invalid query_filter.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 nodesLineageConfigPage.test.tsxandLineageSettingsForm.test.tsx:keeps the settings the form does not edit,does not offer saving until the settings loadPlatformLineage.test.tsx: the header, title and export tests (6)Lineage.test.tsx:keeps the map's graph in the storeUnit tests
LineageSceneQueryTest; all 8LineageScene*Testclasses pass (69 tests).LineageExportButton.test.tsx(it fails against a button that goes through the<Lineage>handlers, which do nothing in the AI-mode header), plusCanvasUtils.test.ts(getLineagePngExportOptionsfits 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.tsxandLineageSettingsForm.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: newSaving the lineage config keeps the settings the form does not edit, which reads the stored setting back.Features/ProfilePlatformSettings.spec.ts: the lineage save keepsgraphPerformanceConfig.Local run against this branch on 2026-10-21, before the merges with main (server plus Vite UI):
PlatformLineage.spec.tsandLineageSettings.spec.ts: 15 passed, including the setup projects.ProfilePlatformSettings.spec.ts›lineage: saves depths and layer: passed.Verify Platform Lineage ViewandDataAssetLineage.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.
LineageScenePerformanceScaleIT#sceneApiLatencyStaysWithinBudgetin external mode (OM_URL,OM_ADMIN_TOKEN,OM_EXTERNAL_USERNAME/PASSWORD) on 6,000 tables and 6,000 edges.401 Expired token!, the nightly's error.semantic-zoom-in, which led to the wheel change above.GET /api/v1/lineage/scenereturned 400Invalid query_filter: …forquery_filter={"query":,{"term":{}}and["not","a","query"]. A valid tier filter returned 200.UI screen recording:
Not applicable: these are bug fixes, not a feature. Before and after images of the export are available on request.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md.lineage-map-canvastest id the benchmark relies on is documented indocs/perf/lineage-scale-validation.md.🤖 Generated with Claude Code
The remaining PNG test gap must be addressed before merging to meet the repository’s testing requirement.
Findings
Summary
This PR fixes lineage labels, PNG framing, settings saves, malformed-filter responses, and the nightly benchmark.
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]Reviews (3) · Last reviewed commit: "Do not offer saving lineage settings tha..." · Reviewed by Greptile