Removing dataProduct asset should remove output port asset as well#25885
Removing dataProduct asset should remove output port asset as well#25885
Conversation
| deleteRelationship( | ||
| dataProduct.getId(), DATA_PRODUCT, ref.getId(), ref.getType(), Relationship.OUTPUT_PORT); |
There was a problem hiding this comment.
⚠️ Bug: INPUT_PORT relationship not cleaned up when removing assets
When an asset is removed from a data product, only the OUTPUT_PORT relationship is deleted (line 252), but the INPUT_PORT relationship is not. An asset can be designated as either an input port or an output port (not both, as enforced by validation at line 331). If the removed asset was an input port, the INPUT_PORT relationship will be left orphaned.\n\nThe fix should also delete the INPUT_PORT relationship for the removed asset. Since deleteRelationship is a no-op when no matching row exists, it's safe to call both deletes unconditionally.
Suggested fix:
for (BulkResponse response : listOrEmpty(result.getSuccessRequest())) {
EntityReference ref = (EntityReference) response.getRequest();
LineageUtil.removeDataProductsLineage(
ref.getId(), ref.getType(), List.of(dataProduct.getEntityReference()));
deleteRelationship(
dataProduct.getId(), DATA_PRODUCT, ref.getId(), ref.getType(), Relationship.OUTPUT_PORT);
deleteRelationship(
dataProduct.getId(), DATA_PRODUCT, ref.getId(), ref.getType(), Relationship.INPUT_PORT);
}
Was this helpful? React with 👍 / 👎
🔍 CI failure analysis for cd88924: CI failures persist: MCP tests (Docker version incompatibility), integration tests (resource cleanup timing), Playwright E2E (28 flaky tests across shards), Python 3.10 CockroachDB profiler (2 failed). Python 3.11 all tests passed. All unrelated to PR changes.IssueMultiple CI jobs continue to fail after merging main into PR branch (commit cd88924): 1. MCP Tests: Docker client version incompatibility Root CauseMCP Tests - Docker Compatibility IssueError: Details: 2 tests failed ( Integration Tests - Resource LifecycleJobs: integration-tests-postgres-opensearch, integration-tests-mysql-elasticsearch Identical failure pattern: Async background operations fail: Pattern: Race condition between test completion and resource cleanup in virtual threads. Playwright E2E Tests - FlakinessShard 3/6: 1 failed (Settings navigation drag-and-drop), 16 flaky Total: 28 flaky tests with element timing issues. Python Tests - Version-Specific FailuresPython 3.10 (job 63639151162) - CONFIRMED FAILURES:
Python 3.11 (job 63639151158) - ✅ ALL PASSED:
DetailsComplete Test Summary:
Unrelated to PR ChangesThis PR modifies:
Evidence of no relation:
PR's own tests pass:
Conclusion: All failures are pre-existing infrastructure issues (Docker version incompatibility, resource cleanup timing), test flakiness (Playwright UI timing with 28 flaky tests), and version-specific issues (Python 3.10 CockroachDB profiler fails; Python 3.11 same code passes completely). None are related to the data product asset cleanup changes in this PR. Code Review
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|



Describe your changes:
Fixes
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
DataProductRepository.bulkRemoveAssets()to deleteOUTPUT_PORTrelationships when removing data product assets, preventing orphaned relationshipsgetSuccessRequest()for individual operations, improving error resiliencetest_removingAssetFromDataProductRemovesItFromOutputPortsto validate API behavior and Playwright E2E test for UI asset removal workflow