Skip to content

Fixes 29415: Show an empty state and the real line count in the topic config and search index settings tabs - #37120

Merged
harsh-vador merged 7 commits into
mainfrom
fix/query-viewer-json-config
Nov 5, 2026
Merged

harsh-vador merged 7 commits into
mainfrom
fix/query-viewer-json-config

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #29415

The topic Config tab and the search index Search Index Settings tab both render QueryViewer with JSON.stringify(config). Three defects followed from that:

  1. Empty state (Empty config tabs show only the config title for Topic and Search Index #29415). With no config, JSON.stringify(undefined) is undefined, QueryViewer hid the editor and showed nothing in its place: a card with only the title. QueryViewer now renders NoDataPlaceholder whenever there is nothing to show, and the two callers pass '' for an empty config — including {}, which Kafka ingestion can store (common_broker_source.py sets topic_config = {}), via a new getJSONEditorValue util.
  2. Wrong line count. The badge counted lines of the compact one-line JSON (always "1 Line"), while SchemaEditor pretty-printed it to 14+ lines. QueryViewer now formats once with getSchemaEditorValue and uses that value for the badge, the copy button (previously copied the minified JSON) and the editor height class; SchemaEditor gets autoFormat={false} so the text is not formatted twice.
  3. Duplicated heading. Both callers passed a title equal to the tab label ("Config" under the "Config" tab) since fix(ui): login page update #12213 / feat(ui): added search index details page changes #13104. The title is dropped there; the dbt tab keeps its project/path title. With no title, the line badge and copy button now sit at the right of the header (justify-end), as they did with antd's Card extra before the core Card migration (fix(ui): entity details pages dark mode (page-by-page) #33987) — this also fixes the View Definition tab.

Other QueryViewer callers affected by the new empty state, by design:

  • table dbt tab for seeds (no SQL): project/path title + "No data available." (asserted in Table.spec.ts)
  • incident SQL Query tab with no inspectionQuery
  • table View Definition when schemaDefinition is ''
  • Collate MostExpensiveQueriesWidget expanded rows with an empty query

Collate companion: open-metadata/openmetadata-collate#8291 drops the same duplicate title from the AI-mode TopicConfigTab.

playwright-report before-after

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Topic with Kafka config → Config tab shows pretty-printed JSON, badge reads the real line count, no repeated "Config" heading
  • Topic with topicConfig: {} → Config tab shows "No data available."
  • Search index with settings → formatted settings, correct line count, no repeated heading
  • Search index without settings → "No data available."
  • dbt seed table (no SQL) → dbt tab shows project/path and the empty state, no line badge

Unit tests

  • QueryViewer.test.tsx: line count and editor value use the formatted JSON, copy gets the formatted JSON, empty query renders the placeholder (with and without a title)
  • SchemaEditor.utils.test.ts: getJSONEditorValue for a non-empty object, {} and undefined
  • npx jest src/utils/SchemaEditor.utils src/components/common/QueryViewer src/components/Topic/TopicDetails src/utils/SearchIndexUtils src/pages/SearchIndexDetailsPage src/components/DataQuality/IncidentManager/SqlQueryTab → all passed (see Verification)

Backend integration tests

  • Not applicable (no backend API changes). make java_affected: "No Java tests are impacted by this change."

Playwright (UI) tests

  • Added playwright/e2e/Features/EntityConfigTabs.spec.ts (4 tests) + timing-baseline entries
  • Table.spec.ts dbt seed tests now assert the empty state
  • Mapped QueryViewer/**, Topic/TopicDetails/**, SearchIndexUtils.tsx in impact-map.json; regenerated impact-map.generated.json

Planner: make playwright_affected → 25 specs (1 changed, 3 impact-mapped, 21 canaries because .github/playwright/* changed). Targeted run at the final commit (1dc15201b48, OSS UI on Vite :3101 → local backend :8585, --workers=2 --retries=0): 13/13 passed (HTML report screenshot below).

Spec Result
Features/EntityConfigTabs.spec.ts (new) ✅ 4/4
Features/Topic.spec.ts ✅ 4/4
Features/DataQuality/IncidentManagerSqlQuery.spec.ts ✅ 3/3
Features/Table.spec.ts › dbt seed (path only) ✅
Features/Table.spec.ts › dbt seed (source project only) ✅

Not attributable to this change, and not control-verified: the run aborted when the host disk filled (ENOSPC), which also took down the local Docker backend before an origin/main control could run.

  • Entity.spec.ts "Domain Add, Update and Remove" (all entity types, 3m timeouts): the local backend has no working Explore/domain search.
  • SearchRelevance.spec.ts (search-nightly): needs the sample-data relevance fixtures.
  • HealthCheck.spec.ts: needs an ingestion orchestrator.
  • SearchSettings.spec.ts (3) and Table.spec.ts pagination / expand-collapse / search-consistency (7), Dashboards.spec.ts:189: none of these render QueryViewer.
  • Tests at 0ms: aborted by ENOSPC.

The merge queue runs the full suite.

Manual testing performed

  1. Local backend on :8585, this branch's UI via Vite on :3101 (VITE_DEV_SERVER_TARGET=http://localhost:8585/)
  2. Seeded a topic with a 12-key Kafka config, a topic without config, a search index with analysis settings and one without
  3. Opened each Config / Search Index Settings tab as admin, before (origin/main) and after (this branch)

Verification

  • Control: EntityConfigTabs.spec.ts on origin/main UI code → 4/4 fail ("1 Line" vs 5/10 lines, no placeholder); on this branch → 4/4 pass
  • Stability: EntityConfigTabs.spec.ts --repeat-each=10 --workers=4 → 40/40 passed
  • Jest (final HEAD): SchemaEditor.utils, QueryViewer, TopicDetails, SearchIndexUtils, SearchIndexDetailsPage, SqlQueryTab → 7 suites, 44/44 passed
  • yarn ui-checkstyle:changed + yarn ui-checkstyle:playwright:changed → 0 errors, tree clean; yarn lint:playwright → 0 errors; yarn test:eslint-rules → 189 pass / 0 fail; generate_playwright_impact_map.py --check → up to date
  • npx tsc --noEmit → 1 error, pre-existing on origin/main (CustomPropertiesDetailPage.tsx isLoading), none in changed files
  • Self-review (fresh-context reviewer against REVIEW.md, two passes, last on 1c75bbeb58d): no 🔴. Nits fixed: {} config treated as empty (getJSONEditorValue + Playwright {} case), editor no longer formats twice (autoFormat={false}), dbt-seed tests assert the empty state, impact map committed, timing-baseline entry re-keyed for the renamed test. Answered: Collate TopicConfigTab title is out of scope for an OSS PR (follow-up noted above).

UI screen recording:

Not applicable — bug fix to existing tabs, no new feature flow. Before/after screenshot (all four states in one image):

Playwright HTML report:

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: no durable decision; no record needed.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the UI UI specific issues label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@harsh-vador
harsh-vador marked this pull request as ready for review November 5, 2026 09:23
@harsh-vador
harsh-vador requested a review from a team as a code owner November 5, 2026 09:23
@harsh-vador
harsh-vador requested a review from Rohit0301 November 5, 2026 09:23
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 12 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 12 warning(s) across 3 changed file(s).

Count Rule
7 react-hooks/exhaustive-deps
2 openmetadata-ui-patterns/deprecated-om-tokens
2 openmetadata-imports/no-circular-imports
1 openmetadata-imports/no-lower-layer-page-imports
All findings
Location Rule Message
🟡 src/components/Topic/TopicDetails/TopicDetails.component.tsx:276:5 react-hooks/exhaustive-deps React Hook useCallback has missing dependencies: 'onTopicUpdate' and 'topicDetails'. Either include them or remove the dependency array. If 'onTopicUpdate' chan
🟡 src/components/Topic/TopicDetails/TopicDetails.component.tsx:344:5 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/components/Topic/TopicDetails/TopicDetails.component.tsx:387:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'fetchActivityCount' and 'fetchTaskCounts'. Either include them or remove the dependency array.
🟡 src/components/Topic/TopicDetails/TopicDetails.component.tsx:455:6 react-hooks/exhaustive-deps React Hook useMemo has missing dependencies: 'customizedPage?.tabs', 'feedCount', 'getEntityFeedCount', and 't'. Either include them or remove the dependency ar
🟡 src/components/Topic/TopicDetails/TopicDetails.component.tsx:502:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 'tabs'. Either include it or remove the dependency array.
🟡 src/components/Topic/TopicDetails/TopicDetails.component.tsx:502:6 react-hooks/exhaustive-deps React Hook useMemo has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked.
🟡 src/components/common/QueryViewer/QueryViewer.component.tsx:58:6 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/components/common/QueryViewer/QueryViewer.component.tsx:74:21 openmetadata-ui-patterns/deprecated-om-tokens Legacy token "--om-legacy-color-eeeeee" is deprecated. Use tw: utilities or --tw-* theme variables. Migrate existing references when editing them; do not add ne
🟡 src/components/common/QueryViewer/QueryViewer.component.tsx:75:21 openmetadata-ui-patterns/deprecated-om-tokens Legacy token "--om-legacy-color-757575" is deprecated. Use tw: utilities or --tw-* theme variables. Migrate existing references when editing them; do not add ne
🟡 src/utils/SearchIndexUtils.tsx:27:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.
🟡 src/utils/SearchIndexUtils.tsx:34:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/utils/SearchIndexUtils.tsx:37:1 openmetadata-imports/no-circular-imports This runtime import participates in a circular dependency. Extract the shared type/constant/utility or invert the dependency.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.39% (138458/170099) 68.44% (49884/72883) 71.48% (28035/39217)

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

…-config

# Conflicts:
#	.github/playwright/timing-baseline.json
@gitar-bot

gitar-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · The shared QueryViewer reformats displayed and copied values and adds empty states across several tabs, potentially changing content users expect to see.

Fixes the empty state and line count in the topic Config and search index Search Index Settings tabs by formatting the JSON once in QueryViewer, showing NoDataPlaceholder when there is no config, and dropping the duplicated tab-label title. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@harsh-vador
harsh-vador enabled auto-merge (squash) November 5, 2026 11:33
@harsh-vador
harsh-vador merged commit 3481320 into main Nov 5, 2026
65 of 68 checks passed
@harsh-vador
harsh-vador deleted the fix/query-viewer-json-config branch November 5, 2026 11:47
shrabantipaul-collate pushed a commit that referenced this pull request Nov 13, 2026
…ix DQ, search index and incident-time fixtures (#37695)

* test(playwright): refresh stale 2.1 visual baselines and fix the data quality and search index scenes

The visual lane on 2.1 still failed 214 tests after #37656. 199 of the 200
mismatched baselines date from the original capture in #36640 and never ran
in the run #37656 refreshed from, because 6 of 7 shards stopped at
maxFailures. Each is replaced with the first-attempt actual from 2.1 run
43212731841.

- visualData: the batch DQ fixture also answers value_count. #37507 switched
  the table total to value_count, the fixture returned no row, and
  DataAssetsCoveragePieChartWidget threw reading totalData[0], raising an
  error toast on the data quality page and its interaction scenes.
- scenarios: the search index settings tab waits for its empty-state
  placeholder. #37120 removed the panel title the scene waited for; the
  fixture index has no settings.

* test(playwright): pin the incident check time in the visual fixture

The incident timestamp equalled FIXED_DATE while the browser clock keeps
running, so the asset health widget rendered 'Last check N secs ago' with N
depending on scene duration. It is now one hour earlier.

* test(playwright): refresh the 2.1 baselines the fixture fixes changed

Run 43264131527 renders the data quality and data observability scenes with
the value_count fixture fix, the table manage menu, and an advanced-search
nested-group frame that the previous run never reached. Each actual matched
its retry.

* test(playwright): refresh the 2.1 shard 02 baselines and nested group frames

Run 43297316037 is the first 2.1 run where shard 02 ran its tests: dark
announcements, bots, incident manager and advanced-search frames. Each actual
matched its retry. The dark nested group-2 card is identical on main, where
it was captured from run 43263784280; the earlier frames of that scene match
pixel for pixel.

* test(playwright): refresh the 2.1 dark nested-group footer frame

The last advanced-search nested-group frame that earlier 2.1 runs never
reached (run 43307968814). The actual matched its retry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty config tabs show only the config title for Topic and Search Index

2 participants