Skip to content

[2.1] Fixes #30677: Paginate topic schema fields from the server (backport 2.1 #37862) - #37900

Closed
Rohit0301 wants to merge 7 commits into
2.1from
backport/2.1/pr-37862
Closed

Rohit0301 wants to merge 7 commits into
2.1from
backport/2.1/pr-37862

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #30677

Backport of #37862 to 2.1. It cherry-picks #37862's five code commits up to e0ab49f (-x, all applied cleanly) and regenerates the 2.1 Playwright impact map. #37862 has since merged. This backport also carries 40c215a, which fixes two review findings raised here: an explicit sortBy=schema for stored order, and the Name sort kept in the URL. The same commit is going to main in #37902.

Topics with hundreds of schema fields froze the Schema tab, because it rendered every field at once. The tab now pages fields from the server, like table columns:

  • Paging: fields load one page at a time through the existing GET /v1/topics/name/{fqn}/columns (page size 15/50, page kept in the URL). No sort keeps schema order.
  • Search: new GET /v1/topics/name/{fqn}/columns/search?q= matches name, display name or description at any nesting level. Each match comes back once as its own childless row, paged on the server. The term is kept in the URL (columnSearch).
  • Sorting: sorting by Name runs on the server before paging, on both endpoints.
  • Edits: description and tag edits still PATCH the topic (unchanged save path), and every saved update reloads the current page.

The search contract is recorded in ADR:2026-11-16-topic-schema-field-search-returns-flat-rows.

Known limitation: the Tags and Glossary column filters cover only the current page, as on the data model page. It's an open question on #37862.

The recording and screenshots are on #37862, recorded against main. The UI and service files are identical here.

Type of change:

  • Improvement

High-level design:

Same as #37862:

  • Backend: TopicRepository.searchSchemaFieldsByFQN flattens, filters, sorts and pages copies of the fields. TopicResource exposes it under /columns/search with VIEW_BASIC.
  • UI: TopicSchema.tsx uses usePaging and useTableFilters, with a request-id guard against stale responses. The version view still renders the full stored schema.

Tests:

Use cases covered

Paging and a reload on page 2; nested search with server paging; a description edit saved and kept after reload; server-side Name sort; reload after a same-version save; fetch error toast; version view.

Unit tests

  • Jest on 2.1: src/components/Topic/TopicSchema/TopicSchema.test.tsx — 16 passed.
  • tsc (app and Playwright) is clean for the changed files, and the CI formatter sequence (organize-imports, ESLint --fix, Prettier) leaves no diff.

Backend integration tests

Ran locally on 2.1 at 700b838e89e (mysql-elasticsearch, parallel lane): mvn -B verify -pl :openmetadata-integration-tests -am -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=TopicResourceIT → PASSED — 260 tests, 0 failures, 0 errors, 21 skipped. This includes the new topic schema-field tests.

Not run locally (pending, merge queue): the rest of the impacted plan (TableResourceIT, ContainerResourceIT, SearchIndexResourceIT, MessagingServiceResourceIT, TopicServiceHydrationIT, …).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

Not run on 2.1. On #37862 the two Pagination.spec.ts tests passed locally (screenshots there). The rest run in the merge queue.

Visual regression baselines

  • Not refreshed. The topic Schema tab gains a pagination footer, so topic visual scenes may need a baseline refresh from the visual lane.

Manual testing performed

Manual checks and the recording are on #37862. They were recorded against main, and the changed files are identical here.

UI screen recording:

See #37862: the recording at its head and screenshots of paging, an edit kept after reload, sorting and nested search. This backport's diff matches #37862's for every changed source file.

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 commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable (no schema change).
  • For a UI feature or feature task: the recording and build/health evidence are on Fixes #30677: Paginate topic schema fields from the server #37862; this is a clean backport of the same files.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: same diff as Fixes #30677: Paginate topic schema fields from the server #37862, which was reviewed against REVIEW.md and whose bot review threads are all resolved.
  • Decision check: includes ADR:2026-11-16-topic-schema-field-search-returns-flat-rows.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

This backport adds server-paged topic schema fields, nested-field search, and Name sorting.

  • The live Topic Schema tab loads fields page by page.
  • Topic schema search finds matching fields at every nesting level.

Reviews (6) · Last reviewed commit: "Keep topic schema order explicitly and r..." · Reviewed by Greptile

Topic schema fields rendered all at once, freezing the page for topics with
hundreds of fields. The schema tab now pages fields through
/v1/topics/name/{fqn}/columns, adds /columns/search for name, display name
and description matches at any depth, and saves field edits through
PUT /v1/columns/name/{fqn}?entityType=topic.

(cherry picked from commit 58274de)
A matched parent carried its children while a matching child was also
returned as its own row, so the same field FQN rendered twice.

(cherry picked from commit 9e149e7)
Field save errors now reach the description modal and tag editor, which
toast and stay open instead of closing as if the save succeeded. A slower
superseded field request no longer overwrites the newer page. The unknown
topic test asserts the 404 status.

(cherry picked from commit 031b5c9)
…cord the search contract

- Field description/tag saves PATCH the topic again, so the shared topic and the
  column detail panel stay current, search rows keep their server shape, and the
  topic save flow (including approvals) is unchanged. The page reloads on the
  version bump.
- Name sorting goes to the server before paging; /columns/search accepts
  sortBy=name and sortOrder.
- ADR:2026-11-16-topic-schema-field-search-returns-flat-rows records the search
  contract.
- Apply the CI formatter output to the changed UI and Playwright files.

(cherry picked from commit 3d48a47)
Same-user edits in quick succession can share one topic version, so watching
the version missed the reload and left saved tags stale. Watch messageSchema,
which every saved update replaces.

(cherry picked from commit e0ab49f)
@Rohit0301
Rohit0301 requested review from a team as code owners November 16, 2026 13:28
@Rohit0301 Rohit0301 added UI UI specific issues backend labels Nov 16, 2026
@Rohit0301
Rohit0301 requested review from chirag-madlani and pmbrull and removed request for a team November 16, 2026 13:28
@github-actions

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.

- Topic field endpoints accept sortBy=schema to return fields in stored order;
  the Schema tab sends it instead of relying on ordinalPosition ties.
- The Name sort is kept in the URL (fieldSort) with the page and search, so a
  reload returns the same rows.
- Amend ADR:2026-11-16-topic-schema-field-search-returns-flat-rows (v2).
@gitar-bot

gitar-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Server-paginated topic schema loading and nested search alter field retrieval and display; paging or matching errors could hide fields from users.

Backports server-side paging, nested search, and Name sorting for topic schema fields to 2.1, so the Schema tab no longer freezes on topics with hundreds of fields. No open issues found; the schema-order trick for sortBy=ordinalPosition is closed without a fix in this PR.

✅ 1 closed
Closed: Quality: Schema-order trick for /columns (sortBy=ordinalPosition) is not recorded

📄 openmetadata-ui/src/main/resources/ui/src/rest/topicsAPI.ts:156-169 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TopicResourceIT.java:1739-1748 📄 docs/decisions/2026-11-16-topic-schema-field-search-returns-flat-rows.md:16-23
The description says "with no sort the schema order is kept" on both endpoints. The new ADR only covers that for /columns/search (it has no default sort). On /columns the order depends on an arrangement that spans three files and is written down nowhere in docs/decisions/:

  • topicsAPI.ts:156-168 sends sortBy=ordinalPosition because the endpoint defaults to sorting by name (TopicResource.java @DefaultValue("name")).
  • That only keeps schema order because ChildFieldPageReader.ordinalPositionOrNull returns null for every non-Column field. All topic fields therefore tie, and List.sort is stable.

If Field ever gets an ordinal position, or someone adds a tiebreaker to childComparator, the live Schema tab quietly stops showing fields in schema order. The only guard is schemaFieldPage_ordinalPositionSortKeepsSchemaOrder, and nothing links it back to the UI code that relies on it. Under the repo's decision-record rules, a cross-component ordering rule needs a record.

Fix: add a sentence to the ADR, or a new record, such as: "The topic Schema tab asks /v1/topics/name/{fqn}/columns for sortBy=ordinalPosition to keep schema order. Topic fields have no ordinal position, so the server's stable sort leaves them in stored order. A schema-order default or explicit sort mode on that endpoint would supersede this." Then cite the record from topicsAPI.ts. Better still, add a real schema-order mode to /columns, e.g. sortBy omitted or sortBy=schema, so the client no longer depends on the tie.

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

@Rohit0301 Rohit0301 closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant