Skip to content

fix(lineage): service nodes appearing in entity lineage view and empty By Service view#27258

Merged
harshach merged 26 commits intomainfrom
mohit/b719-issue-in-lineage
Apr 17, 2026
Merged

fix(lineage): service nodes appearing in entity lineage view and empty By Service view#27258
harshach merged 26 commits intomainfrom
mohit/b719-issue-in-lineage

Conversation

@mohityadav766
Copy link
Copy Markdown
Member

@mohityadav766 mohityadav766 commented Apr 10, 2026

Problem

Two lineage visualization bugs affecting OpenMetadata when using a pipeline as an edge annotator (i.e., lineage stored as table → topic with pipeline in LineageDetails, rather than as explicit pipeline nodes):

Bug 1 — Service nodes bleeding into entity-level lineage view
In the default lineage view, service entities (DatabaseService, MessagingService, PipelineService) were incorrectly appearing in the graph.

Bug 2 — "By Service" view is empty for pipeline entities
Switching to the "By Service" view returned an empty graph instead of showing lineage grouped by service.

Root Causes

Bug 1: getOrCreateLineageDetails() in addServiceLineage(), addDomainLineage(), and addDataProductsLineage() was copying the pipeline annotation from entity-level LineageDetails into service/domain/dataProduct-level LineageDetails. This caused service entities to have upstreamLineage.pipeline.fqnHash populated in their Elasticsearch documents. The BFS traversal in ESLineageGraphBuilder uses PIPELINE_AS_EDGE_KEY = "upstreamLineage.pipeline.fqnHash.keyword" to discover pipeline-connected nodes — so service entities incorrectly matched this query and appeared in the entity-level lineage view.

Bug 2: addServiceLineage() only created a direct database_service → kafka_service edge. When a pipeline is used as an annotator (not a node), the pipeline's own service (flink_pipeline_service) received zero service-level edges. Since the frontend fetches lineage for entity.service.fullyQualifiedName in "By Service" mode, Elasticsearch returned an empty result.

Changes

openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java

  • Bug 1 fix: Added .withPipeline(null) on the LineageDetails returned by getOrCreateLineageDetails() in addServiceLineage(), addDomainLineage(), and addDataProductsLineage(). This strips the pipeline annotation before persisting service/domain/dataProduct-level edges, preventing service entities from matching the PIPELINE_AS_EDGE_KEY Elasticsearch query.

  • Bug 2 fix: Added three new private methods:

    • addPipelineServiceEdges() — called from addServiceLineage(), creates additional service edges for the pipeline's own service
    • getPipelineService() — resolves the pipeline entity's service reference from LineageDetails
    • insertServiceEdgeIfDistinct() — inserts a service edge only if the two service IDs differ (avoids self-edges)

    When entity lineage has a pipeline annotator, two additional service-level edges are created: fromService → pipelineService and pipelineService → toService, so the pipeline service has edges in the service-level lineage graph.

openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/LineageRepositoryTest.java

  • Added 4 unit tests verifying that LineageDetails for service/domain/dataProduct-level edges never inherit the pipeline annotation from entity-level lineage.

openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/LineagePipelineAnnotatorIT.java

  • Added integration tests covering the full end-to-end scenario: creates a table→topic lineage edge annotated with a pipeline, then verifies Bug 1 (no service nodes in entity lineage) and Bug 2 (pipeline service appears in service lineage).

openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/LineagePipelineAnnotator.spec.ts

  • Added Playwright E2E tests covering the same scenario via the UI lineage API, verifying both bugs via response interception and direct API assertions.

Test Results

Tests run: 14, Failures: 0, Errors: 0, Skipped: 0 — BUILD SUCCESS

…in/dataProduct lineage and add pipeline service edges

Bug #1: Service nodes (e.g., DatabaseService, MessagingService) were incorrectly appearing in
entity-level lineage views. Root cause: getOrCreateLineageDetails() in addServiceLineage(),
addDomainLineage(), and addDataProductsLineage() was copying the pipeline annotation from
entity-level LineageDetails to service/domain/dataProduct-level LineageDetails. This caused
service entities to have upstreamLineage.pipeline.fqnHash set in their Elasticsearch documents,
making them match the PIPELINE_AS_EDGE_KEY query during BFS traversal and incorrectly appear
alongside actual data assets. Fix: add .withPipeline(null) on each service/domain/dataProduct
LineageDetails object to strip the pipeline annotation before persisting.

Bug #2: "By Service" view was empty when viewing lineage for pipeline entities that were stored
as edge annotators (Case B: table → topic with pipeline=flink_pipeline in LineageDetails) rather
than as actual nodes (Case A). Root cause: addServiceLineage() only created database_service →
kafka_service edges but no edges involving flink_pipeline_service. Fix: add addPipelineServiceEdges()
called from addServiceLineage() that creates fromService → pipelineService and pipelineService →
toService edges when a pipeline annotation exists in the entity-level lineage details.

Also add unit tests covering both fixes to prevent regression.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 10, 2026 19:04
@github-actions github-actions bot added backend safe to test Add this label to run secure Github workflows on PRs labels Apr 10, 2026
@mohityadav766 mohityadav766 changed the title Issue in Lineage where Service Node Lineage Appear in Data Asset Lineage (vibe-kanban) fix(lineage): service nodes appearing in entity lineage view and empty By Service view (Vibe Kanban) Apr 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a lineage visualization issue where service-level lineage edges were being annotated with pipeline details, causing services to “bleed into” default asset lineage and making “By Service” views behave incorrectly.

Changes:

  • Strip pipeline from extended lineage edges (service/domain/data product) by forcing LineageDetails.pipeline to null before persisting/indexing those edges.
  • Add pipeline-service intermediary service edges derived from the pipeline’s owning service.
  • Add unit tests asserting pipeline can be absent from ES lineage data / lineage details.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java Nulls pipeline on extended lineage edges; adds logic to insert pipeline-service service edges.
openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/LineageRepositoryTest.java Adds tests around pipeline == null behavior in lineage ES data and LineageDetails.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

🟡 Playwright Results — all passed (29 flaky)

✅ 3634 passed · ❌ 0 failed · 🟡 29 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 478 0 2 4
🟡 Shard 2 645 0 2 7
🟡 Shard 3 651 0 5 1
🟡 Shard 4 614 0 10 27
✅ Shard 5 616 0 0 42
🟡 Shard 6 630 0 10 8
🟡 29 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the ApiEndpoint entity item action after rules disabled (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should show online status badge on user profile for active users (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for ApiEndpoint (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Owner Rule Is_Set (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Set (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate DataProduct Rule Any_In (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with data products attached at domain and subdomain levels (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with owners and experts preserves assignments (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Glossary Term Add, Update and Remove (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Glossary Term Update in Glossary Page should persist tree (shard 6, 1 retry)
  • Pages/HyperlinkCustomProperty.spec.ts › should display URL when no display text is provided (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Dashboard (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Spreadsheet (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for mlModel -> table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@mohityadav766 mohityadav766 self-assigned this Apr 11, 2026
mohityadav766 and others added 2 commits April 13, 2026 13:30
…e/domain/dataProduct lineage edges

The previous fix (e6df7a6) prevented new lineage from inheriting pipeline annotations on
service/domain/dataProduct-level edges. However, existing data in the entity_relationship table
already has pipeline set on those edges from before the fix, and Elasticsearch reindex reads from
the DB — so reindex alone does not fix stale data.

This migration removes the pipeline field from all service-to-service, domain-to-domain, and
dataProduct-to-dataProduct lineage edges (relation=13/UPSTREAM) in entity_relationship.

After upgrading and running this migration, operators should trigger an Elasticsearch/OpenSearch
reindex so that the corrected DB records are reflected in the search index, which is what the
lineage graph BFS traversal reads from.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves the data migration that removes the pipeline field from
service/domain/dataProduct lineage edges in entity_relationship to the
1.13.0 migration scripts, which is the correct target version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 13, 2026 09:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread bootstrap/sql/migrations/native/1.13.0/postgres/postDataMigrationSQLScript.sql Outdated
Comment thread bootstrap/sql/migrations/native/1.13.0/mysql/postDataMigrationSQLScript.sql Outdated
….12.6

Creates a new 1.12.6 migration with the data fix that removes the pipeline
field from service/domain/dataProduct lineage edges in entity_relationship,
and removes it from 1.13.0 where it was previously placed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…es for existing data

For installations upgrading to 1.12.6 with existing lineage data, service edges
fromService→pipelineService and pipelineService→toService were never created
(only added by the code fix for new lineage going forward). This migration
reads service-level lineage edges that have a pipeline annotation, resolves
the pipeline entity's service, and inserts the two missing service edges into
entity_relationship (DB only). After the SQL migration strips pipeline from
service edges and a reindex runs, the "By Service" lineage view for pipeline
services correctly shows their upstream/downstream service connections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 13, 2026 10:52
…nario

Tests Bug #1 (service nodes absent from entity-level lineage) and Bug #2
(pipeline service appears in service-level lineage) using API interception
and direct request assertions via page.request.get().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

mohityadav766 and others added 2 commits April 16, 2026 12:27
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the json column in entity_relationship is NULL, JsonUtils.readValue
returns null. getPipelineService now short-circuits on a null argument
instead of throwing NullPointerException via entityLineageDetails.getPipeline().

Fixes NPE in deleteLineageByFQN and deleteLineage cleanup paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.74% (59601/93500) 43.65% (31364/71851) 46.74% (9425/20161)

mohityadav766 and others added 2 commits April 16, 2026 16:16
page.request.get() sends browser cookies but OpenMetadata authenticates
via JWT in localStorage, so those calls were unauthenticated (non-2xx).
Replace with getToken + getAuthContext pattern used elsewhere.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

let topicFqn: string;
let pipelineFqn: string;

const LINEAGE_API = '/api/v1/lineage/getLineage?fqn=*';
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The LINEAGE_API glob (/api/v1/lineage/getLineage?fqn=*) assumes fqn is the first query param. If the UI adds params before fqn (or changes ordering), waitForResponse(LINEAGE_API) can miss the request and make the test flaky/hang. Using a broader glob like /api/v1/lineage/getLineage?* (pattern used elsewhere in the Playwright suite) or a predicate on response.url().includes('/api/v1/lineage/getLineage') would be more robust.

Suggested change
const LINEAGE_API = '/api/v1/lineage/getLineage?fqn=*';
const LINEAGE_API = '/api/v1/lineage/getLineage?*';

Copilot uses AI. Check for mistakes.
Comment thread bootstrap/sql/migrations/native/1.12.0/mysql/postDataMigrationSQLScript.sql Outdated
Comment on lines +8 to +10
'mlmodelService', 'storageService', 'searchService', 'apiService')
AND toEntity IN ('databaseService', 'messagingService', 'pipelineService', 'dashboardService',
'mlmodelService', 'storageService', 'searchService', 'apiService')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There is driveService too

mohityadav766 and others added 3 commits April 16, 2026 19:37
Directory, File, Spreadsheet, and Worksheet entities map to driveService,
so service-level lineage edges between driveService instances could also
have incorrectly inherited the pipeline annotation. Include driveService
in the 1.12.6 cleanup migration for both MySQL and PostgreSQL.

Also drops the stray trailing-newline changes from the 1.12.0 migration
files — those edits were unnecessary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
driveService-to-driveService edges must be skipped during the pipeline
service edge migration scan, same as all other service-level edges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Entity.METADATA_SERVICE,
Entity.STORAGE_SERVICE,
Entity.SEARCH_SERVICE,
Entity.API_SERVICE,
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

SERVICE_ENTITY_TYPES is missing Entity.DRIVE_SERVICE, even though the 1.12.6 SQL migrations treat driveService as a service entity. This can cause the Java migration to incorrectly treat driveService* relationships as data-asset lineage edges during the scan (and attempt unnecessary Entity.getEntity(...) lookups). Add Entity.DRIVE_SERVICE to the set to keep behavior consistent with the SQL migration scripts and avoid misclassification.

Suggested change
Entity.API_SERVICE,
Entity.API_SERVICE,
Entity.DRIVE_SERVICE);

Copilot uses AI. Check for mistakes.
mohityadav766 and others added 2 commits April 16, 2026 20:09
The rebase left MigrationUtil with duplicate imports and a missing closing
brace on insertEdgeIfMissing. Merged both method sets cleanly and ran
spotless.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 16, 2026

Code Review ✅ Approved 3 resolved / 3 findings

Fixes service node visibility in entity lineage and empty service views by resolving null pointer exceptions and syntax errors. Comprehensive tests have been added to validate the new edge-handling logic.

✅ 3 resolved
Quality: Missing tests for new addPipelineServiceEdges logic

📄 openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/LineageRepositoryTest.java:468-482 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:245-259
The new methods addPipelineServiceEdges(), getPipelineService(), and insertServiceEdgeIfDistinct() (Bug #2 fix) have no unit test coverage. The 4 added tests only cover the .withPipeline(null) stripping (Bug #1). Consider adding tests that verify:

  • Pipeline service edges are created when a pipeline annotator exists
  • No edges are created when entityLineageDetails.getPipeline() is null
  • Self-edges are avoided when pipeline service equals from/to service
  • The entityHasField guard in getPipelineService() works correctly for entity types without a service field
Bug: NullPointerException when lineageDetails is null in cleanup path

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:1136-1149 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:261
When the json column in entity_relationship is NULL (which is allowed per the schema definition json DEFAULT NULL), JsonUtils.readValue(null, LineageDetails.class) returns null. This null lineageDetails is then passed through cleanUpExtendedLineagecleanUpPipelineServiceEdgesgetPipelineService, where entityLineageDetails.getPipeline() at line 261 will throw a NullPointerException.

This affects both deleteLineageByFQN (line 1040) and deleteLineage (line 1110).

Bug: Missing closing brace for insertEdgeIfMissing — won't compile

📄 openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v1126/MigrationUtil.java:191-193
The insertEdgeIfMissing method at line 171 is missing its closing } brace. After return true; on line 191, the next statement is a field declaration (private static final String UPDATE_MYSQL), which is syntactically invalid inside a method body. This will cause a compilation failure.

It appears the new code was appended inside the existing method rather than after it.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment on lines +160 to +168
private static LineageDetails buildServiceLineageDetails(LineageDetails source) {
return new LineageDetails()
.withCreatedAt(source.getCreatedAt())
.withCreatedBy(source.getCreatedBy())
.withUpdatedAt(source.getUpdatedAt())
.withUpdatedBy(source.getUpdatedBy())
.withSource(LineageDetails.Source.CHILD_ASSETS)
.withPipeline(null)
.withAssetEdges(1);
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

buildServiceLineageDetails() always sets assetEdges to 1. If multiple entity-level lineage edges require the same derived service edge (e.g., many table→topic edges annotated with pipelines from the same pipeline service), the migrated service edge should reflect the aggregate assetEdges count; otherwise later cleanup can delete the edge prematurely when only one child edge is removed. Consider accumulating a count per ServiceEdge while scanning records and setting assetEdges accordingly (or updating existing edges by incrementing assetEdges).

Copilot uses AI. Check for mistakes.
Comment on lines +62 to +112
for (CollectionDAO.EntityRelationshipObject record : batch) {
if (SERVICE_ENTITY_TYPES.contains(record.getFromEntity())) {
continue;
}
String json = record.getJson();
if (json == null || !json.contains("\"pipeline\"")) {
continue;
}
collectPipelineServiceEdges(record, edgesToCreate);
}
offset += batchSize;
} while (batch.size() == batchSize);

int created = 0;
for (Map.Entry<ServiceEdge, LineageDetails> entry : edgesToCreate.entrySet()) {
try {
if (insertEdgeIfMissing(collectionDAO, entry.getKey(), entry.getValue())) {
created++;
}
} catch (Exception e) {
LOG.warn(
"Failed to insert pipeline service edge {} -> {}: {}",
entry.getKey().fromId(),
entry.getKey().toId(),
e.getMessage());
}
}

LOG.info("Pipeline service edges migration complete: {} edges created", created);
}

private static void collectPipelineServiceEdges(
CollectionDAO.EntityRelationshipObject record,
Map<ServiceEdge, LineageDetails> edgesToCreate) {

try {
LineageDetails details = JsonUtils.readValue(record.getJson(), LineageDetails.class);
EntityReference pipelineRef = details.getPipeline();
if (pipelineRef == null || pipelineRef.getId() == null) {
return;
}

EntityInterface fromEntity =
Entity.getEntity(
record.getFromEntity(), UUID.fromString(record.getFromId()), "service", Include.ALL);
EntityInterface toEntity =
Entity.getEntity(
record.getToEntity(), UUID.fromString(record.getToId()), "service", Include.ALL);
EntityInterface pipelineEntity =
Entity.getEntity(pipelineRef.getType(), pipelineRef.getId(), "service", Include.ALL);

Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The migration scans any non-service entity_relationship row whose JSON contains a pipeline key, and then unconditionally calls Entity.getEntity(..., "service", ...) for record.getFromEntity() / record.getToEntity(). Rows like domain→domain or dataProduct→dataProduct (which are explicitly mentioned as affected by Bug #1) will throw IllegalArgumentException because those entity types don’t allow the service field, leading to noisy logs and extra work. Consider filtering upfront to only process relationships where both fromEntity and toEntity support service (e.g., Entity.entityHasField(type, "service")) and skipping everything else before attempting entity fetches.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link
Copy Markdown

@sonarqubecloud
Copy link
Copy Markdown

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.

3 participants