test(ui): select tables by shared attributes, not AntD class names - #31960
Conversation
Tests that select on `.ant-table-row` break the moment a page moves to TableV2, which would put an unrelated red suite in the middle of every sweep PR. AntD's rc-table emits `data-row-key` natively and TableV2 emits it too, so a selector written against it passes on both wrappers and survives the migration. Rewrites the three suites that reached for AntD class names, and adds `filter-trigger` / `filter-dropdown` testids to TableV2 so the filter UI has a hook that does not depend on AntD's DOM. The stable hooks are listed in the TableV2 header comment. The parity suite keeps its `.ant-table` selectors: they live in the legacy adapter, which exists precisely to drive the AntD DOM. Adds docs/antd-migration/table.md — the review contract for the call-site sweeps: what is supported (with a spec behind each claim), what is blocked and why, the selector table, and the per-page checklist. Playwright specs are deliberately not touched. They need a running stack to verify, and rewriting e2e selectors blind is how a suite goes quietly broken — each one moves in the sweep PR for its page, where it can actually be run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 553 passed · ❌ 0 failed · 🟡 0 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) 1h 2m 12s ⏱️ Max setup 4m 34s · max shard execution 16m 6s · max shard-job elapsed before upload 19m 6s · reporting 4s 🌐 215.50 requests/attempt · 2.83 app boots/UI scenario · 20.70% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
The rule reversed the filter icon and title by targeting .ant-table-filter-column, which TableV2 does not render — so the icon would silently move back to the right on every filtered table the sweep touches (5 call sites across both repos). TableV2's column header now carries data-testid=column-header-content, and the rule matches both, so the class keeps working either side of a migration.
84343ea to
6405dbd
Compare
0b3930b to
7ef2d44
Compare
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsRefactors UI component tests to use shared data-row-key attributes instead of AntD class names and adds stable TableV2 test hooks. Consider mirroring dedup IDs in sort and onChange column lookups. 💡 Edge Case: Dedup ids not mirrored in sort/onChange column lookups📄 openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx:319-329 📄 openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx:1005 📄 openmetadata-ui/src/main/resources/ui/src/components/common/Table/TableV2.tsx:1145
🤖 Prompt for agentsOptionsDisplay: 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 |
❌ UI Checkstyle Failed❌ ESLint + Prettier + Organise Imports (src)One or more source files have linting or formatting issues. Affected files
🔍 ESLint findings in this PR's files — 0 error(s), 20 warning(s)Errors block the build. Warnings do not yet — they are rules whose backlog is still 0 error(s), 20 warning(s) across 1 changed file(s).
All findings
Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
|
df03820
into
feat/core-table-compact-radio



Prep for the call-site sweeps, plus the guide those sweeps get reviewed against.
The selector problem
A test that selects
.ant-table-rowbreaks the moment its page moves to TableV2 — which would drop an unrelated red suite into the middle of every sweep PR.AntD's
rc-tableemitsdata-row-keynatively, and TableV2 emits it too. So a selector written against it passes on both wrappers and survives the migration. Same for the expander: both renderdata-testid="expand-icon".Three suites rewritten (
SampleDataTable×2, andChildTermsTabin the Collate repo). All pass against the legacy wrapper, which is the point — nothing has migrated yet.Adds
filter-trigger/filter-dropdowntestids to TableV2 so the filter UI has a hook that doesn't depend on AntD's DOM, and lists the stable hooks in the TableV2 header comment.The parity suite keeps its
.ant-tableselectors — they live in the legacy adapter, which exists precisely to drive the AntD DOM.docs/antd-migration/table.mdThe review contract for every sweep PR: what's supported (with a spec behind each claim), what's blocked and why, the selector table, the per-page checklist, and the gotchas that cost time during the parity work — including that
ts-jestdoes not fail on a missing export here, so a green jest run is not a typecheck.Playwright is deliberately untouched
13 specs reference
.ant-table. They need a running stack to verify, and rewriting e2e selectors blind is how a suite goes quietly broken. Each moves in the sweep PR for its page, where it can actually be run. The mapping for the three cases with no shared hook (tree depth, filter trigger, filter dropdown) is in the guide.Scope correction
An earlier estimate of "39 jest files" was wrong — that grep caught source files using AntD classes for styling, which is Phase 6 work, not selectors. The real count is 3.
Verification
SampleDataTable— 37 tests,ChildTermsTab— 10 tests,common/Table— 144 tests🤖 Generated with Claude Code
Greptile Summary
The PR replaces AntD-specific selectors in SampleDataTable tests with shared row attributes and adds stable TableV2 filter/header hooks. Major changes:
data-row-key.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
data-row-keyattribute in duplicate-column assertions.Reviews (3): Last reviewed commit: "Merge branch 'feat/tablev2-parity-and-ga..." | Re-trigger Greptile