Skip to content

Backport #32115 to 2.0: declare the data asset types once and make the field catalog deterministic - #32560

Merged
manerow merged 2 commits into
2.0from
backport/32115-to-2.0
Sep 7, 2026
Merged

manerow merged 2 commits into
2.0from
backport/32115-to-2.0

Conversation

@manerow

@manerow manerow commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Backport of #32115 to 2.0. On main as 72f02a21c1. 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.

  1. metric fields never reach the chart builder. The set of entity types Data Insights covers
    was 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 metric to those two in March, so di-data-assets-metric
    has been created and filled daily ever since while metricType, unitOfMeasurement and
    granularity have never appeared in the chart builder. Fixed by deriving all three from one
    schema enum, dataAssetType.json.

  2. The field catalog changed on every server restart. getFieldNames deduplicated field names
    globally, 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. topic shares all 28 of its field
    names with table, so picking "Topic" in the field picker returned an empty list on roughly a
    coin flip. Fixed by deduplicating on (entityType, name) and iterating the enum in declaration
    order.

  3. 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.

  4. An empty category returned HTTP 500. avg, min and max over a bucket the metric filter
    emptied return null, and both aggregators unboxed that straight into a primitive. Pre-existing
    on main and not caused by this change; §3 is what makes it reachable, because keeping the empty
    categories is what produces the null buckets. Fixed with a null guard on both engines.

What had to be adapted

One line: import java.util.stream.Collectors; in DataInsightSystemChartRepository.

On main that 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 an
addition, 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 12
pre-existing files touched here are byte-identical between 2.0 and main's pre-fix state, so the
rest 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:

mvn -pl openmetadata-service -am package

green (main and test sources), spotless:check clean, and the suite the original PR added:

mvn -pl openmetadata-service -am package -Dtest='DataAssetTypeCoverageTest,DataInsightsSearchConfigurationTest,\
DataInsightsSearchInterfaceTest,DataInsightMetricFilterTest,ElasticSearchLineChartAggregatorTest,\
OpenSearchLineChartAggregatorTest,ElasticSearchDataInsightAggregatorManagerTest,\
OpenSearchDataInsightAggregatorManagerTest,ElasticSearchCategoricalAxisRealEngineTest,\
OpenSearchCategoricalAxisRealEngineTest'

Tests run: 65, Failures: 0, Errors: 0, Skipped: 0
Test Tests run
DataAssetTypeCoverageTest 4
DataInsightsSearchConfigurationTest 2
DataInsightsSearchInterfaceTest 2
DataInsightMetricFilterTest 4
ElasticSearchLineChartAggregatorTest 19
OpenSearchLineChartAggregatorTest 18
ElasticSearchDataInsightAggregatorManagerTest 5
OpenSearchDataInsightAggregatorManagerTest 5
ElasticSearchCategoricalAxisRealEngineTest 3 (17.3s, real Elasticsearch 9.3 via testcontainers)
OpenSearchCategoricalAxisRealEngineTest 3 (13.1s, real OpenSearch 3.4 via testcontainers)

The two real-engine classes also assert the control, i.e. main's pre-fix shape picking 0 of 10
services, so a fixture that stopped discriminating would fail rather than pass quietly.

Checklist:

On skip-pr-checks: a PR whose base is not the default branch cannot create GitHub's native
closingIssuesReferences link, so the metadata gate has no way to see the linked issue and can never
be satisfied here. The issue is #31963, already closed by #32115.

@manerow
manerow requested review from a team as code owners September 3, 2026 11:29
@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend skip-pr-checks Bypass PR metadata validation check labels Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 67%
67.13% (80653/120143) 51.74% (49602/95850) 52.54% (14744/28060)

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 34ccf02b868c285f8fef5055cc97877b44670354 in Playwright run 33845059750, attempt 2.

✅ 1283 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 26.62% (convergence target: at most 15%).
  • Application boot ratio was 2.13 per UI scenario (2790 boots / 1310 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 144 0 0 0 0 0
✅ Shard chromium-02 145 0 0 0 0 0
✅ Shard chromium-03 154 0 0 0 0 0
✅ Shard chromium-04 173 0 0 0 0 0
🟡 Shard chromium-05 176 0 2 0 0 0
✅ Shard chromium-06 149 0 0 0 0 0
✅ Shard chromium-07 158 0 0 0 0 0
✅ Shard data-asset-rules-01 63 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 2 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Pages/CustomProperties.spec.ts › String (shard chromium-05, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard chromium-05, 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

@gitar-bot

gitar-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backport of #32115 to 2.0 fixes four Data Insights defects: metric fields never reaching the chart builder, non-deterministic field catalog on server restart, charts ranking by wrong metrics, and HTTP 500 on empty categories. One import (java.util.stream.Collectors) was added to adapt for 2.0's missing dependency. All 65 tests pass, including new coverage and real-engine validation. No issues found.

Options

Display: compact → Showing less information.

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@manerow
manerow merged commit b472f12 into 2.0 Sep 7, 2026
154 of 157 checks passed
@manerow
manerow deleted the backport/32115-to-2.0 branch September 7, 2026 14:35

This branch was previously deployed

1 inactive deployment
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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants