Skip to content

Add hierarchical lineage maps - #29204

Merged
harshach merged 72 commits into
mainfrom
harshach/hierarchical-lineage
Sep 11, 2026
Merged

harshach merged 72 commits into
mainfrom
harshach/hierarchical-lineage

Conversation

@harshach

@harshach harshach commented Jun 18, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Issue: not provided in this workspace.

I added the scene-backed hierarchical lineage map because the existing lineage tab needed service/database/schema/asset/field drill-down, focused subtree loading, rollup edges, breadcrumbs, hover path highlighting, and sample lineage data while preserving the existing OpenMetadata lineage styling and impact-analysis table mode.

Type of change:

  • Improvement
  • New feature

High-level design:

The backend adds /lineage/scene plus LineageSceneResolver and schema/types to normalize search lineage into service/domain/data product lenses, level bands, counts, breadcrumbs, field endpoints, and rollup edges without a database migration.
The UI adds a React Flow LineageMap with scene cache/prefetch, semantic zoom and drill controls, existing node/card styling, canvas rollup/field edges, fit/recenter/search controls, first-use popup, and read-only behavior for rollup/container scenes.

Tests:

Use cases covered

  • Service, database, schema, asset, and field-level lineage scene loading
  • Focused subtree drill-down with breadcrumbs, counts, hidden counts, and rollup aggregation
  • Column-level lineage display and sample data lineage examples
  • Layer switcher, semantic zoom, hover path highlighting, search focus, recenter, and fit-to-screen behavior

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: LineageSceneResolverTest.java, LineageMap.utils.test.ts, CustomNodeV1.test.tsx, CustomNode.utils.test.tsx, LineageLayers.test.tsx, lineageAPI.test.ts, ELKUtil.test.ts, Lineage.test.tsx
  • Ran: mvn -pl openmetadata-service spotless:apply
  • Ran: mvn -pl openmetadata-service,openmetadata-dist -am -DonlyBackend -Dtest=LineageSceneResolverTest -Dsurefire.failIfNoSpecifiedTests=false package
  • Ran targeted UI Jest tests for lineage map utilities, custom nodes, lineage layers, lineage API, ELK layout, and lineage component changes
  • Ran UI checkstyle sequence for changed TS/TSX/JSON files

Backend integration tests

  • I added integration tests in openmetadata-integration-tests/ for new/changed API endpoints.
  • Files added/updated: LineageResourceIT.java

Ingestion integration tests

  • Not applicable; sample data lineage fixtures were updated for manual and UI verification.

Playwright (UI) tests

  • Not applicable; no Playwright tests were added.

Manual testing performed

  1. Rebuilt/restarted the local Docker OpenMetadata stack and verified server health.
  2. Reingested sample data and verified /lineage/scene responses for sample_data, sample_data.ecommerce_db, and sample_data.ecommerce_db.shopify counts and focused children.
  3. Started the local Yarn dev server and verified localhost UI availability.

UI screen recording / screenshots:

Not attached in this workspace.

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: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

The PR introduces hierarchical lineage scenes across the service and UI.

  • Adds the /lineage/scene API, scene resolution, bounded caching, search-backed hierarchy aggregation, rollup edges, breadcrumbs, and field-level endpoints.
  • Adds a React Flow lineage map with drill-down, semantic zoom, scene prefetching, path highlighting, controls, and read-only container views.
  • Extends sample lineage fixtures and adds backend, integration, UI, and Playwright coverage.

Confidence Score: 4/5

The PR does not appear safe to merge until root lineage scenes enforce per-asset view permissions.

Root requests omit focus authorization, and the resolver’s domain pruning and direct search aggregation paths do not replace per-asset VIEW_BASIC checks, so callers can still receive metadata and counts for assets they are not permitted to view.

Files Needing Attention: openmetadata-service/src/main/java/org/openmetadata/service/resources/lineage/LineageResource.java; openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneResolver.java

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneResolver.java Implements search-backed hierarchical scene resolution, aggregation, pruning, rollups, breadcrumbs, bounded parallel enrichment, and scene construction.
openmetadata-service/src/main/java/org/openmetadata/service/resources/lineage/LineageResource.java Exposes the new lineage scene endpoint and passes request security context and scene parameters into the resolver.
openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneCache.java Provides a bounded, expiring root-scene cache whose key now includes both traversal depths.
openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/LineageMap.component.tsx Adds the interactive hierarchical lineage map, scene navigation, caching, semantic zoom, search, and canvas controls.
openmetadata-spec/src/main/resources/json/schema/api/lineage/lineageScene.json Defines the generated API contract for hierarchical lineage scenes.
ingestion/src/metadata/ingestion/source/database/sample_data.py Extends sample-data lineage ingestion to deserialize column lineage from camel-case or snake-case fixture fields.

Sequence Diagram

sequenceDiagram
  participant UI as LineageMap
  participant API as /lineage/scene
  participant Resolver as LineageSceneResolver
  participant Search as Elasticsearch/OpenSearch
  participant Cache as LineageSceneCache
  UI->>API: Request lens, band, focus, depths
  API->>Resolver: Resolve scene with SubjectContext
  Resolver->>Cache: Check eligible root-scene key
  alt Cache hit
    Cache-->>Resolver: Cached LineageScene
  else Cache miss or focused scene
    Resolver->>Search: Fetch lineage and asset aggregations
    Search-->>Resolver: Nodes, edges, and counts
    Resolver->>Resolver: Prune, roll up, and build breadcrumbs
    Resolver->>Cache: Store eligible root scene
  end
  Resolver-->>API: LineageScene
  API-->>UI: Render hierarchical map
Loading

Reviews (21): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@harshach
harshach requested review from a team as code owners June 18, 2026 22:16
@github-actions

github-actions Bot commented Jun 18, 2026 •

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 backend safe to test Add this label to run secure Github workflows on PRs labels Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ TypeScript Types Auto-Updated

The generated TypeScript types have been automatically updated based on JSON schema changes in this PR.

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.13% (99496/137927) 56.78% (58927/103773) 58.08% (19614/33767)

harshach added 2 commits June 18, 2026 15:54
…-lineage

# Conflicts:
#	ingestion/examples/sample_data/lineage/lineage.json
#	ingestion/src/metadata/ingestion/source/database/sample_data.py
#	openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/LineageResourceIT.java
#	openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.component.tsx
#	openmetadata-ui/src/main/resources/ui/src/components/Lineage/Lineage.test.tsx
#	openmetadata-ui/src/main/resources/ui/src/locale/languages/en-us.json
#	openmetadata-ui/src/main/resources/ui/src/rest/lineageAPI.test.ts

Copilot AI left a comment

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.

🔵 Needs a closer look

It modifies an already-versioned native DB migration (append-only rule) and the PR metadata is missing a linked issue, both of which block merge readiness.

Review details

Suppressed comments (2)

bootstrap/sql/migrations/native/2.1.0/mysql/schemaChanges.sql:3

  • This edits an existing native migration under .../native/2.1.0/.... Repo migration guidance is append-only (don’t modify already-applied migrations) because existing installs won’t re-run the edited file, causing silent schema drift. Please move this index change into a new bootstrap/sql/migrations/native/<new-version>/{mysql,postgres}/schemaChanges.sql migration instead of changing the 2.1.0 script.
    openmetadata-ui/src/main/resources/ui/package.json:144
  • lru-cache is added at major v6, but the repo also adds @types/lru-cache at major v5 (line 225). That version skew can lead to incorrect typings (or runtime/type mismatches) as the package API evolves. Please align the majors (either use lru-cache@^5.1.1 to match the types package, or update/remove @types/lru-cache if you intend to stay on v6 and it ships its own typings).
  • Files reviewed: 102/141 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

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.

🔵 Needs a closer look

The new UI dependency set introduces a lru-cache vs @types/lru-cache major-version mismatch that can break TypeScript builds, and the PR still lacks the required linked GitHub issue for CI metadata validation.

Review details

Suppressed comments (1)

openmetadata-ui/src/main/resources/ui/package.json:145

  • lru-cache is pinned to v6 ("lru-cache": "^6.0.0") but the repo also adds @types/lru-cache v5 ("@types/lru-cache": "^5.1.1"). Those major versions don't match, and can lead to incorrect typings (or duplicate/incorrect method signatures) for LineageSceneCache which relies on specific APIs like peek/del/reset.

Align the runtime package and typings to the same major version (either downgrade lru-cache to ^5.1.1, or upgrade/remove @types/lru-cache and adjust code to the v6+ API), then regenerate yarn.lock.

  • Files reviewed: 103/142 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…-lineage

Conflicts resolved:

- .github/playwright/impact-map.generated.json — regenerated with
  scripts/generate_playwright_impact_map.py rather than hand-merged; CI
  validates it with --check, so the generator is the only correct resolution.

- playwright/eslint-rules/tests/corpus.test.mjs — semantic conflict git could
  not see. Both sides changed the no-positional-locator guard 1305 -> 1304 with
  identical text, but each pruned a different suppression (this branch:
  LineageInteraction.spec.ts 2 -> 1; main #33058: GlobalPageSize.spec.ts
  removed). The union is 1303, so the guard was stale after a clean auto-merge.
Two unit-test failures on this PR's CI run.

RdfOntologyContractTest (2 failures) is inherited from main, not introduced
here: #31829 added Table.aliases while #32262 added the writer/ontology
contract test, and neither run saw the other. The contract test has been red on
main since df17bd6; the Detect Changes gate skipped the job on every commit
after it, so the breakage stayed invisible. openmetadata.ttl now declares
om:aliases as a Stored property, matching every other projected schema field.

LineageSceneTasks.runBounded dropped a caller's interrupt roughly 6% of the
time. ExecutorService.invokeAll(tasks, timeout, unit) only reports an already-set
interrupt from the f.get() it performs on a pending future, so when every task
finishes before that check it returns normally and the fan-out's results are
handed back to a caller that has already been cancelled. Measured over 2000
trials on JDK 21 with a virtual-thread pool: 128 (6.4%) swallowed the interrupt;
with the up-front check, 0. That race is what made callerInterruptionIsPreserved
flaky in CI.
chirag-madlani
chirag-madlani previously approved these changes Sep 10, 2026
ulixius9
ulixius9 previously approved these changes Sep 10, 2026
mohityadav766
mohityadav766 previously approved these changes Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — merge_conflict (2026-09-10T15:48:52Z)

The entry left the queue before it was built, so no checks ran against it.

…-lineage

Conflicts resolved:

- playwright/e2e/Pages/Lineage/LineageInteraction.spec.ts — both sides fixed the
  same shared-fixture bug, and both sides rewrote the same test. Kept this
  branch's side in both hunks, applied in place so main's non-conflicting edits
  to the file survive:
    * "Verify edge delete button in drawer" — this branch seeds its own
      source/target tables instead of deleting the shared table1->topic edge, so
      no restore is needed and no later test in the file depends on the cleanup
      running. Main's fix (restore the shared edge in a finally) addresses the
      same breakage for a test this branch no longer has.
    * "Verify node panel opens on click" (main) vs "Verify node click drills
      into the field scene" (this branch) — contradictory, not redundant.
      handleNodeClick now calls handleDrill outside edit mode, so a node click
      no longer opens the entity panel and main's test asserts removed
      behaviour.
  Main's fitToScreen fix (wait for the menu popover to detach) lives in
  playwright/utils/lineage.ts, auto-merged, and is kept.

- playwright/QUARANTINE.md — taken from main, which burned the quarantine 9->4
  and moved the LineageInteraction entry to the fixed list with its own writeup.
  This branch had only dropped that same entry, so nothing is lost.

- playwright/eslint-rules/tests/corpus.test.mjs — the recurring semantic
  conflict: both sides edited the no-positional-locator guard (1303 vs 1300).
  Neither number is right by inspection, so the value was measured instead:
  `yarn lint:playwright:suppressions` over the merged tree leaves the baseline
  untouched at 1300, which also confirms the spec resolution above produces
  exactly the suppression counts the merged baseline claims.

- .github/playwright/impact-map.generated.json — regenerated, not hand-merged.

The om:aliases ontology declaration added on this branch last week also landed
on main; the two are byte-identical, so the merge leaves exactly one.
…sis pagination tests

The two Impact Analysis pagination tests added by #32699 timed out on
chromium-19, both on the first attempt and the retry: the click on `next` was
swallowed by a full-screen react-aria overlay.

The overlay is LineageMapOnboardingDialog, added on this branch. It is gated on
the `lineageMapsOnboardingSeen` cookie, so it opens in every fresh Playwright
context. EntityLineageTab mounts <Lineage> (and therefore LineageMap) in both
view modes and only hides it with `display: none` when mode=impact_analysis, so
the dialog still renders -- and it portals to the document root rather than into
the hidden subtree, leaving its overlay over the Impact Analysis table.

Every other lineage spec reaches the page through visitLineageTab, which already
calls dismissLineageMapOnboarding. These two are the only specs that `page.goto`
a lineage URL directly, so they were the only ones that never dismissed it.
Fixed the same way LearningResources.spec.ts does it: navigate, wait for
loaders, dismiss.

Neither side's CI could have caught this -- the onboarding modal and these tests
landed on different branches.
mohityadav766
mohityadav766 previously approved these changes Sep 11, 2026
ulixius9
ulixius9 previously approved these changes Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-11T08:21:29Z)

Blocked the queue: integration-tests-postgres-opensearch

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-11T11:30:52Z)

Blocked the queue: playwright-summary

…-lineage

Conflicts resolved:

- playwright/e2e/Flow/PlatformLineage.spec.ts (modify/delete) and
  Pages/Lineage/PlatformLineage.spec.ts — main's #33197 deleted the duplicate
  Flow spec and folded it into Pages/Lineage, while this branch had rewritten
  the Flow spec for the scene API. Took main's structure (the shared tests moved
  under a `Entity Lineage tab` describe so its beforeEach no longer leaks into
  the new platform tests) and kept this branch's bodies, then ported main's two
  new tests off the endpoint this branch replaced:
    * `Verify Platform Lineage View` — reused this branch's already-adapted
      version of it from the deleted Flow spec (scene API, lens-* testids,
      onboarding dismissed) instead of main's getPlatformLineage copy.
    * `Settings depth change refetches platform lineage` — main's regression
      for #33197 waits on getPlatformLineage, but this page now fetches through
      LineageMap, so the wait would hang. Repointed at /lineage/scene; the depth
      assertions are unchanged because getLineageScene sends the same
      upstreamDepth/downstreamDepth params, and LineageMap does read
      lineageConfig off useLineageStore, so main's fix is what makes it pass.
  Main's production fix (PlatformLineage.tsx routing settings through the store)
  and its Jest coverage both auto-merged and pass unmodified: 45/45.

- playwright/e2e/Pages/Lineage/LineageFilters.spec.ts — main's #33017 changed
  the tier filterValue from FQN to name because the dropdown now renders the
  name; this branch had added `searchField: 'tier.tagFQN'`, whose term query
  needs the FQN. Both are right for their own use, so the label and the indexed
  value are now separate fields (`searchValue`, defaulting to `filterValue`).

- .github/playwright/impact-map.generated.json — regenerated, not hand-merged.

The corpus.test.mjs suppression guard auto-merged consistently this time (1297
on both sides); verified against a real prune rather than assumed.
@gitar-bot

gitar-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 13 resolved / 14 findings

Adds hierarchical lineage scenes with drill-down, semantic zoom, and focused subtree loading across service and domain lenses. Comprehensive test coverage and integration with existing lineage styling are in place.

Consider addressing the malformed queryFilter parameter: it currently returns HTTP 500 on invalid JSON, but client-supplied input should return 400 Bad Request instead. Confirm whether surfacing the error (per the malformedFiltersAreNotSilentlyDiscarded test) is the intended behavior and adjust the exception handling accordingly.

💡 Edge Case: Malformed queryFilter now returns HTTP 500 instead of 400

📄 openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneQuery.java:40-50

LineageSceneQuery.parseQueryFilter calls JsonUtils.readTree(queryFilter), which throws JsonParsingException (a WebServiceException hard-coded to INTERNAL_SERVER_ERROR) on invalid JSON. Since queryFilter is a client-supplied query parameter on /lineage/scene, a bad value now surfaces as a 5xx server error. The previous implementation caught the parse failure and logged a warning, treating the request as unfiltered. If surfacing the error is intended (per the new malformedFiltersAreNotSilentlyDiscarded test), it should be classified as a 400 Bad Request for client-controlled input rather than a 500.

Translate malformed client-supplied JSON into a 400 Bad Request.
static Query parseQueryFilter(String queryFilter) {
  Query result = null;
  if (!nullOrEmpty(queryFilter)) {
    JsonNode filter;
    try {
      filter = JsonUtils.readTree(queryFilter);
    } catch (RuntimeException exception) {
      throw new BadRequestException("Invalid lineage scene query filter", exception);
    }
    JsonNode innerQuery = filter.has("query") ? filter.path("query") : filter;
    if (!nullOrEmpty(innerQuery)) {
      result = Query.of(clause -> clause.withJson(new StringReader(innerQuery.toString())));
    }
  }
  return result;
}
✅ 13 resolved
✅ Performance: Scene resolver issues N+1 sequential search queries

📄 openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneResolver.java:431-445 📄 openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneResolver.java:328-342
Building a focused scene triggers a large number of sequential Elasticsearch calls. enrichFocusedChildLineage loops over up to FOCUSED_CHILD_LINEAGE_LOOKUP_LIMIT (50) seeds and calls fetchLineage (a search) once per seed. In addition, enrichServiceDatabaseTotals/enrichDatabaseSchemaTotals perform one search for the child containers and then an extra count search per container (classic N+1). For a service/database/schema with many children this means dozens of blocking, round-trip search requests per single /lineage/scene request, which will dominate latency under load. Consider batching these lookups (e.g., a single aggregation query for per-container counts, and parallelizing or bulk-fetching child lineage) instead of issuing one query per child.

✅ Quality: Lineage scene cache is an unbounded Map

📄 openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/LineageMap.component.tsx:769 📄 openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/LineageMap.component.tsx:864 📄 openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/LineageMap.component.tsx:885-887
cacheRef = useRef(new Map<string, LineageScene>()) is used as a scene cache and is written on every fetch (cacheRef.current.set(cacheKey, response)) and on every prefetch of adjacent bands, but entries are never evicted. As a user drills through services/databases/schemas/assets/fields and switches lenses/bands, the cache key space (lens|band|focusFqn|entityType) grows without bound, retaining every previously loaded scene (each containing up to size nodes plus source entities) for the lifetime of the component. The project guidelines require caches to be bounded (LRU/size cap). Wrap this in a small bounded LRU (cap by entry count) to prevent unbounded memory growth during long browsing sessions.

✅ Performance: toFlowEdge repeatedly scans scene.nodes per edge

📄 openmetadata-ui/src/main/resources/ui/src/components/Lineage/LineageMap/LineageMap.component.tsx:330-344
toFlowEdge calls scene.nodes.find(...) four times for every edge to resolve the source/target node's entityType and FQN, making edge construction O(edges × nodes). With the scene size allowed up to 1000 nodes (and a comparable number of edges), this is an avoidable quadratic pass executed each time the scene changes. Build a Map<id, LineageSceneNode> once and look up nodes by id.

✅ Edge Case: FQN delete routes can't remove lineage for soft-deleted entities

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/lineage/LineageResource.java:132-134 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/lineage/LineageResource.java:1264-1265 📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/lineage/LineageResource.java:1348-1350
The new FQN-based authorization helper getLineageReferenceByName resolves entities with Include.NON_DELETED (LineageResource.java:132-134) and is now used by deleteLineageByName (L1264-1265) and deleteLineageByTypeAndName (L1348). If either endpoint of a lineage edge has been soft-deleted, Entity.getEntityReferenceByName(..., NON_DELETED) throws EntityNotFoundException (404), so the lineage edge can no longer be deleted via the FQN routes. This is a behavior change from the previous deleteLineageByName, which authorized against a generic LineageResourceContext and did not require the entities to be resolvable/non-deleted. The id-based deleteLineage path remains permissive, creating an asymmetry. Cleaning up lineage after an entity is soft-deleted is a plausible operation, so consider using Include.ALL for the delete-path authorization resolution (or catching the not-found case) while keeping NON_DELETED for the add/patch routes.

✅ Performance: New thread pool created per scene request

📄 openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneResolver.java:413-415 📄 openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneResolver.java:488-489
Both fetchContainerAssetCounts and enrichFocusedChildLineage call Executors.newFixedThreadPool(...) to fan out the search lookups and then executor.shutdownNow() in the finally block. This means every /lineage/scene request creates (and tears down) one or more short-lived thread pools — getScene invokes these enrich methods sequentially per request, so each scene load can allocate several pools of up to 6 threads. Thread creation/teardown is comparatively expensive, and under concurrent load (this is an interactive lineage tab, a hot path) it produces a lot of churn and unbounded total thread count across simultaneous requests. The parallelization correctly fixes the prior N+1 serial-query issue, but it should draw from a single shared, bounded executor (e.g. a class-level fixed pool or a managed ExecutorService) rather than creating one per call. This also aligns with the repo's 'caches/resources must be bounded' guidance.

...and 8 more resolved from earlier reviews

🤖 Prompt for agents
Code Review: Adds hierarchical lineage scenes with drill-down, semantic zoom, and focused subtree loading across service and domain lenses. Comprehensive test coverage and integration with existing lineage styling are in place.
  
  Consider addressing the malformed `queryFilter` parameter: it currently returns HTTP 500 on invalid JSON, but client-supplied input should return 400 Bad Request instead. Confirm whether surfacing the error (per the `malformedFiltersAreNotSilentlyDiscarded` test) is the intended behavior and adjust the exception handling accordingly.

1. 💡 Edge Case: Malformed queryFilter now returns HTTP 500 instead of 400
   Files: openmetadata-service/src/main/java/org/openmetadata/service/lineage/LineageSceneQuery.java:40-50

   `LineageSceneQuery.parseQueryFilter` calls `JsonUtils.readTree(queryFilter)`, which throws `JsonParsingException` (a `WebServiceException` hard-coded to `INTERNAL_SERVER_ERROR`) on invalid JSON. Since `queryFilter` is a client-supplied query parameter on `/lineage/scene`, a bad value now surfaces as a 5xx server error. The previous implementation caught the parse failure and logged a warning, treating the request as unfiltered. If surfacing the error is intended (per the new `malformedFiltersAreNotSilentlyDiscarded` test), it should be classified as a 400 Bad Request for client-controlled input rather than a 500.

   Fix (Translate malformed client-supplied JSON into a 400 Bad Request.):
   static Query parseQueryFilter(String queryFilter) {
     Query result = null;
     if (!nullOrEmpty(queryFilter)) {
       JsonNode filter;
       try {
         filter = JsonUtils.readTree(queryFilter);
       } catch (RuntimeException exception) {
         throw new BadRequestException("Invalid lineage scene query filter", exception);
       }
       JsonNode innerQuery = filter.has("query") ? filter.path("query") : filter;
       if (!nullOrEmpty(innerQuery)) {
         result = Query.of(clause -> clause.withJson(new StringReader(innerQuery.toString())));
       }
     }
     return result;
   }

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

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

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

Count Rule
45 react-hooks/exhaustive-deps
4 openmetadata-imports/no-rest-ui-imports
3 openmetadata-ui-patterns/no-raw-title-attribute
2 openmetadata-imports/no-lower-layer-page-imports
2 openmetadata-imports/no-circular-imports
2 openmetadata-imports/no-hook-ui-imports
2 openmetadata-imports/no-internal-barrel-imports
1 no-restricted-imports
All findings
Location Rule Message
🟡 src/components/Entity/EntityLineage/CanvasEdgeRenderer.component.tsx:165:6 react-hooks/exhaustive-deps React Hook useMemo has an unnecessary dependency: 'nodes'. Either exclude it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/CustomControls.component.tsx:63: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/components/Entity/EntityLineage/CustomControls.component.tsx:240:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'selectedQuickFilters' and 'setSelectedQuickFilters'. Either include them or remove the dependency array.
🟡 src/components/Entity/EntityLineage/CustomControls.component.tsx:328:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/CustomControls.component.tsx:586:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'handleClearAllClick'. Either include it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/CustomNodeV1.component.tsx:279:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'node.id' and 'setNodeFilterState'. Either include them or remove the dependency array.
🟡 src/components/Entity/EntityLineage/CustomNodeV1.test.tsx:175:11 openmetadata-ui-patterns/no-raw-title-attribute Use from @openmetadata/ui-core-components instead of raw title="" attributes for consistent tooltip behavior.
🟡 src/components/Entity/EntityLineage/LineageControlButtons/LineageControlButtons.tsx:76:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx:69:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'node.testSuite'. Either include it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx:76:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'node'. Either include it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx:168:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'fetchTestSuiteSummary'. Either include it or remove the dependency array.
🟡 src/components/Entity/EntityLineage/NodeChildren/NodeChildren.interface.ts:18:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/Entity/EntityLineage/NodeChildren/VirtualColumnList.component.tsx:149:5 react-hooks/exhaustive-deps React Hook useCallback has an unnecessary dependency: 'selectedColumn'. Either exclude it or remove the dependency array.
🟡 src/components/Lineage/Lineage.interface.ts:33:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/components/Lineage/LineageMap/LineageMap.component.tsx:815:63 openmetadata-ui-patterns/no-raw-title-attribute Use from @openmetadata/ui-core-components instead of raw title="" attributes for consistent tooltip behavior.
🟡 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:103: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:734: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:845: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:913: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:972: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:1001: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:1073: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:1171: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:1223: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:1244: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:1260: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:1273: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:1433: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:1625: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:1648: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:1658:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setActiveNode', 'setSelectedColumn', 'setSelectedNode', 'setTracedColumns', and 'setTracedNodes'. Either inclu
🟡 src/context/LineageProvider/LineageProvider.tsx:1670:6 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'setActiveNode', 'setSelectedEdge', 'setSelectedNode', 'setTracedColumns', and 'setTracedNodes'. Either include
🟡 src/context/LineageProvider/LineageProvider.tsx:1718: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:1828: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:1847: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:1928: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:1992: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:2055: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:2060: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:2111: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:2138: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:2181: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:2195: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:2199: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:2248: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:2302: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:2308: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:2350: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:2355:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'reset'. Either include it or remove the dependency array.

… and 11 more. Run make ui-checkstyle-changed locally for the full list.


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

make ui-checkstyle-changed

@sonarqubecloud

Copy link
Copy Markdown

@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

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants