Fixes #31495: key data product ports by entity id, not request index - #32939
Fixes #31495: key data product ports by entity id, not request index#32939sonika-shah wants to merge 1 commit into
Conversation
getPaginatedPorts and bulkAssetsOperation zipped getEntities results to the request list by index. getEntities -> findByIds runs WHERE id IN (...) with no ORDER BY and applies the include filter, so it may return fewer rows and in a different order than requested. Positional zipping then misattributed each port's data to the wrong id and silently dropped the trailing entries, showing a non-empty ports badge with an empty lineage panel. Key each fetched entity by its own id instead.
Code Review ✅ ApprovedFixes data product ports being keyed by request index instead of entity id, which caused misattribution when OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ 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 Results — workflow succeededValidated commit ✅ 4475 passed · ❌ 0 failed · 🟡 8 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 47m 47s ⏱️ Max setup 4m 33s · max shard execution 23m 9s · max shard-job elapsed before upload 26m 47s · reporting 26s 🌐 215.84 requests/attempt · 2.31 app boots/UI scenario · 39.81% common-shard skew Optimization targets still in progress:
🟡 8 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Describe your changes:
Fixes #31495
DataProductRepository.getPaginatedPorts(and the siblingbulkAssetsOperation) correlated the entities fetched byEntity.getEntities(...)with the request list by list index. That underlying call resolves toEntityDAO.findByIds, which runsWHERE id IN (...)with noORDER BYand applies theIncludefilter (NON_DELETEDfor the ports view). So the returned rows can arrive in a different order than requested and can be fewer than requested. Zipping them back to the request list by position then attributes each port's data to the wrong id and silently drops the trailing entries — surfacing as an Input/Output Ports badge showing a port while the lineage panel renders empty.The fix keys each fetched entity by its own id (
entity.getId()) instead of the request-list index, so the subsequent order-preserving lookup by relationship id is always correct regardless of howfindByIdsorders or filters its rows. The same index-zipping existed inbulkAssetsOperation, where it could feed the wrong asset entity into add-time validation; it is fixed identically.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
NON_DELETEDfetch returns fewer rows than the relationship list).Unit / integration tests
DataProductResourceIT#test_getPorts_survivingPortsKeepIdentityWhenOneDeleted: creates three input ports, soft-deletes the middle one, and asserts the two surviving ports are returned with their own ids and the deleted port is absent.mvn clean install -pl openmetadata-service,openmetadata-integration-tests -am -DskipTests→ BUILD SUCCESS.UI