Skip to content

Fixes #38784: lineage filter, count and metric column ITs; make BaseEntityIT lineage test assert - #38785

Merged
chirag-madlani merged 1 commit into
mainfrom
test/lineage-java-it-gaps
Nov 27, 2026
Merged

chirag-madlani merged 1 commit into
mainfrom
test/lineage-java-it-gaps

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

Fixes #38784

Describe your changes:

Java ITs for the lineage API behaviour that only DataAssetLineage.spec.ts and LineageFilters.spec.ts (Playwright) check today, so those tests can move off Playwright (Wave 2 of open-metadata/openmetadata-collate#8315). Tests only; no product code changes.

New LineageFilterIT. Graph: root table → mid table → Snowflake table, Postgres table and Kafka topic, with each table on its own service, database and schema.

  • getLineage_serviceFilter_keepsPathToMatch, getLineage_serviceTypeFilter_keepsPathToMatch: the canvas keeps root and intermediate nodes along with the match.
  • getLineage_hierarchyFilters_matchIntermediateNode: database, schema and column filters on the mid node.
  • impactAnalysis_serviceFilter_returnsOnlyMatches, impactAnalysis_serviceTypeFilter_returnsOnlyMatches: impact analysis returns only the matches.
  • entityCount_totalsForRootMidAndLeafOfMixedTypes: the per-depth counts behind the Upstream/Downstream radios.

Added to LineageResourceIT

  • columnLineage_tableColumnToMetric, columnLineage_metricToTableColumn: a metric as a column-lineage endpoint, stored and shown in the downstream column view.
  • tempLineageTables_roundTrip
  • testExportLineageIncludesPipelineAndServiceColumns: the async CSV export end to end, checking the from/to service name and type and pipelineName.

BaseEntityIT#testLineageFluentAPI could never fail. No subclass set supportsLineage, and its body swallowed every exception. It now adds an edge between two entities of the type, reads it from both ends, deletes it and asserts it is gone. Exceptions fail the test, and unsupported types skip through Assumptions instead of passing silently. It's enabled in all 15 entity ITs whose types the lineage API accepts: Table, Container, Topic, Dashboard, MlModel, Pipeline, StoredProcedure, SearchIndex, DashboardDataModel, APIEndpoint, Metric, Directory, File, Spreadsheet, Worksheet.

Product bug found: #38783. Database, Schema and Column filters stop at the first node that doesn't match, because LineageFilterClassifier.NODE_LEVEL_FIELDS doesn't list them. The ITs here pin only the behaviour that works today (a match on the first node below root), so this PR neither hides the bug nor locks it in. The fix and its deep-match tests come in a follow-up.

Type of change:

  • Improvement

Tests

Run locally (Docker/testcontainers, mysql-elasticsearch): LineageFilterIT, LineageResourceIT, LineageImpactAnalysisIT and testLineageFluentAPI in the 15 entity ITs, 144 run, 0 failures, 0 errors, 3 skipped (already @Disabled). The full suites for those entities weren't run, only their lineage test. spotless:check is clean. plan_local_java_tests.py --check-branch: the map is complete (*Lineage*IT already covers the new class).

🤖 Generated with Claude Code

…yIT lineage test assert

Add LineageFilterIT: Service, Service Type, Database, Schema and Column
filters on /getLineage (canvas keeps root and path nodes) and on
getLineageByEntityCount (impact analysis returns only matches), plus
per-depth upstream/downstream counts over a mixed-type graph.

Add LineageResourceIT tests for a metric as a column-lineage endpoint
(to and from), the tempLineageTables round trip, and the async CSV
export's service and pipeline columns.

BaseEntityIT#testLineageFluentAPI swallowed every exception and no
subclass enabled it. It now adds an edge, reads it from both ends,
deletes it and checks it is gone; lineage is enabled in the 15 entity
ITs the Playwright lineage spec covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 06:54

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk

The PR adds isolated lineage integration coverage and makes previously swallowed test failures assert; production code and runtime behavior remain unchanged.

Adds Java integration tests for lineage filters, column lineage to metrics, lineage CSV export, and the lineage fluent API, covering behavior previously checked only by Playwright specs. Tests only, with no product code changes. No issues found.

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

@chirag-madlani
chirag-madlani merged commit ed5eb68 into main Nov 27, 2026
38 checks passed
@chirag-madlani
chirag-madlani deleted the test/lineage-java-it-gaps branch November 27, 2026 06:10
chirag-madlani added a commit that referenced this pull request Nov 27, 2026
…database, schema and column find deep matches (#38899)

* test(it): lineage filter, count and metric column ITs; make BaseEntityIT lineage test assert

Add LineageFilterIT: Service, Service Type, Database, Schema and Column
filters on /getLineage (canvas keeps root and path nodes) and on
getLineageByEntityCount (impact analysis returns only matches), plus
per-depth upstream/downstream counts over a mixed-type graph.

Add LineageResourceIT tests for a metric as a column-lineage endpoint
(to and from), the tempLineageTables round trip, and the async CSV
export's service and pipeline columns.

BaseEntityIT#testLineageFluentAPI swallowed every exception and no
subclass enabled it. It now adds an edge, reads it from both ends,
deletes it and checks it is gone; lineage is enabled in the 15 entity
ITs the Playwright lineage spec covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(lineage): apply database, schema, column, owner, data product and glossary term filters after the walk so deep matches are found

The lineage page's filter dropdown sends database.displayName.keyword,
databaseSchema.displayName.keyword, columns.name.keyword, ownerDisplayName,
dataProducts.displayName.keyword and glossaryTags in query_filter.
LineageFilterClassifier.NODE_LEVEL_FIELDS listed none of database,
databaseSchema, columns, ownerDisplayName, dataProducts or glossaryTags, so
these filters were classed as structural and pushed into the search walk
itself. The walk stops at the first node that fails the filter, so a match
behind a non-matching node was never reached: the canvas (getLineage)
returned only the root and Impact Analysis (getLineageByEntityCount)
returned nothing.

Classing them as node-level makes both ES and OS builders walk with the
structural filter only and apply the filter afterwards: in memory with path
preservation for the canvas, and as an ES/OS query over the walked FQN hashes
for Impact Analysis, the same path Service and Service Type already take.

LineageFilterClassifierTest lists every field the dropdown sends and asserts
each is node-level, so a new dropdown field cannot silently regress this.

Builds on #38785 (LineageFilterIT).

Fixes #38783

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lineage Java ITs for the API behaviour only Playwright checks (Wave 2)

3 participants