Repository navigation
Backport #32115 to 2.0: declare the data asset types once and make the field catalog deterministic - #32560
Conversation
…eld catalog deterministic (#32115)
❌ 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 ✅ 1283 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 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) 2h 1m 16s ⏱️ Max setup 3m 7s · max shard execution 17m 47s · max shard-job elapsed before upload 21m 47s · reporting 7s 🌐 193.30 requests/attempt · 2.13 app boots/UI scenario · 26.62% common-shard skew Optimization targets still in progress:
🟡 2 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 |
Code Review ✅ ApprovedBackport of #32115 to 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 |
|
|



Backport of #32115 to
2.0. Onmainas72f02a21c1. Original issue: #31963.Four Data Insights defects. The first three return a number that looks right and is wrong, with
nothing thrown and nothing logged; the fourth returns HTTP 500. Full analysis, measurements and the
revert-by-revert test table are in #32115.
metricfields never reach the chart builder. The set of entity types Data Insights coverswas hand-written in three places. Two of them stay in sync only because a mismatch throws;
nothing checked the third. Fixes: Add Metric entity type to Data Insights description coverage chart #26260 added
metricto those two in March, sodi-data-assets-metrichas been created and filled daily ever since while
metricType,unitOfMeasurementandgranularityhave never appeared in the chart builder. Fixed by deriving all three from oneschema enum,
dataAssetType.json.The field catalog changed on every server restart.
getFieldNamesdeduplicated field namesglobally, so the first entity type iterated claimed a shared name permanently, and the iteration
order came from a
Set.of, which Java salts per JVM start.topicshares all 28 of its fieldnames with
table, so picking "Topic" in the field picker returned an empty list on roughly acoin flip. Fixed by deduplicating on
(entityType, name)and iterating the enum in declarationorder.
Charts picked categories from data they did not count. A terms x-axis picks its buckets first
and counts inside them with the metric filter applied; picking ignored the filter. A "tables per
service" chart therefore ranked services by their total document count, so a BI service with
5,000 dashboards and 3 tables took a slot and a warehouse with 800 tables was missing entirely.
Fixed by ordering the axis on the filter wrapper each metric is already built into, ranked by the
wrapper's document count rather than the metric's value.
An empty category returned HTTP 500.
avg,minandmaxover a bucket the metric filteremptied return
null, and both aggregators unboxed that straight into a primitive. Pre-existingon
mainand not caused by this change; §3 is what makes it reachable, because keeping the emptycategories is what produces the
nullbuckets. Fixed with a null guard on both engines.What had to be adapted
One line:
import java.util.stream.Collectors;inDataInsightSystemChartRepository.On
mainthat import arrived with #31759 (NON_DATA_ASSET_ENTITY_TYPES/DATA_ASSET_FILTER),which is not on
2.0. It was therefore an unchanged context line in the original diff rather than anaddition, the cherry-pick applied cleanly, and the compile then failed on
Collectors.toCollection. Putting the import back is the entire adaptation.Nothing else diverges. Apart from #31759's block the file is identical to
main's, and the other 12pre-existing files touched here are byte-identical between
2.0andmain's pre-fix state, so therest is the merged change verbatim (25 files, +2099/-316 against the original's +2098/-316).
Verification
Built and run from a worktree on
origin/2.0:green (main and test sources),
spotless:checkclean, and the suite the original PR added:DataAssetTypeCoverageTestDataInsightsSearchConfigurationTestDataInsightsSearchInterfaceTestDataInsightMetricFilterTestElasticSearchLineChartAggregatorTestOpenSearchLineChartAggregatorTestElasticSearchDataInsightAggregatorManagerTestOpenSearchDataInsightAggregatorManagerTestElasticSearchCategoricalAxisRealEngineTestOpenSearchCategoricalAxisRealEngineTestThe two real-engine classes also assert the control, i.e.
main's pre-fix shape picking 0 of 10services, so a fixture that stopped discriminating would fail rather than pass quietly.
Checklist:
dataAssetType.jsonis added, carried over from fix(data-insights): declare the data asset types once and make the field catalog deterministic #32115 unchanged, with its generated TS type.On
skip-pr-checks: a PR whose base is not the default branch cannot create GitHub's nativeclosingIssuesReferenceslink, so the metadata gate has no way to see the linked issue and can neverbe satisfied here. The issue is #31963, already closed by #32115.