Repository navigation
fix(ui): metric group and Assets tab lose rows; harden governance Playwright specs - #37212
Conversation
… Playwright specs Metric list: switching card -> table view changes the page size (12 -> 15) since #35288, which resets useMetricHierarchy. When the table query is cached, expandAll() runs in the same commit as the reset with the previous scope's group pages in its closure, skips the fetch, and the group renders expanded with no rows. Group pages now carry the request generation and expandAll refetches any page from an earlier generation. Assets tab: after linking assets, AssetsTabs fires a search with the old (empty) ids and then one with the new ids. With no stale-response guard the slower empty response could land last, leaving "No assets linked yet" under a count of 2. Only the latest search now updates the list and the loading state. Playwright: - MetricHierarchy / Pagination: assert the 15-row list page size from #35288. - OntologyReview: re-hover the disabled Publish trigger until the tooltip shows; the right-aligned header shifts when the isolated-terms badge renders late. - OntologyStudioFlows: retry the empty-canvas double-click until the drawer opens, and measure the canvas after the node layout settles.
❌ 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! |
|
| Count | Rule |
|---|---|
| 9 | react-hooks/exhaustive-deps |
| 1 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:58: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/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:590:7 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'handlePagingChange'. Either include it or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:826:7 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'onRemoveAsset'. Either include it or remove the dependency array. If 'onRemoveAsset' changes too often, find t |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:867:8 |
react-hooks/exhaustive-deps |
React Hook useCallback has a missing dependency: 'onAssetRemove'. Either include it or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:897:8 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'onAssetClick'. Either include it or remove the dependency array. If 'onAssetClick' changes too often, find the p |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:903:8 |
react-hooks/exhaustive-deps |
React Hook useEffect has a missing dependency: 'fetchCurrentEntity'. Either include it or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:958:8 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 't' and 'type'. Either include them or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:1045:7 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'getCardMenuItems', 'isLoading', 'isRemovable', 'pageSize', and 't'. Either include them or remove the dependency a |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:1101:8 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'permissions.Create' and 't'. Either include them or remove the dependency array. |
| 🟡 | src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.component.tsx:1110:8 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'selectedCard'. Either exclude it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed
Code Review ✅ Approved🟡 Medium risk · Metric hierarchy now refetches stale group pages and shared Assets searches reject stale responses; regressions could hide or show incorrect rows. Fixes metric group rows disappearing after a card to table view switch by refetching group members on expand when the page is from an earlier request generation, and stops stale asset search responses from overwriting the Assets tab list. Test hardening covers the governance Playwright specs. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #
Fixes the governance-tagged Playwright failures and flake on
mainate21b5ff(run 42151309967). Two of them were real UI bugs, not test problems.1. Metric list: group expanded but empty after a card → table switch (UI bug)
MetricHierarchy.spec.ts › switches list layouts…failed with the group row[expanded]and no metrics under it (CI page snapshot).Since #35288, card view pages at 12 and table view at 15, so switching views changes
pageSizeanduseMetricHierarchyresets its state. When the table query is already cached,MetricListPagecallsexpandAll()in the same commit as the reset. Its closure still holds the card view'sgroupPageOverrides, so it skips fetching members; the reset then clears them and the group renders expanded with nothing inside.Fix: group pages now record the request generation (as child pages already do), and
expandAllrefetches any group whose page is from an earlier generation.2. Metric Assets tab: "No assets linked yet" under a count of 2 (UI bug)
MetricAssets.spec.ts › admin links assets from the header…(flaky) — the failure screenshot shows theAssets 2badge over an empty list. ES lag is ruled out: the picker had just found both assets via search.After Save,
AssetsTabsfires one search with the old (empty)idsfilter, then another once the linked ids refresh.fetchAssetshad no stale-response guard, so when the empty search resolved last it overwrote the list. Only the latest search now updates the list and loading state.AssetsTabsis shared, so glossary-term, domain, data-product and tag Assets tabs get the same fix.3. Test-only fixes
MetricHierarchy.spec.ts › paginates…andPagination.spec.ts › Metrics pageasserted the old 20-row page; Fixes 35468: Standardize UI pagination: 15/25/50 for lists, 12/24/48 for card grids #35288 made the list page 15. Updated tolimit/offset = 15.OntologyReview.spec.ts › Publish is disabled in All ontologies…: the header is right-aligned and theN Isolatedbadge renders after the button was measured, pushing Publish left — the mouse landed on the badge (confirmed from the CI screencast). The test now hovers the Tooltip's wrapper (the disabled button ignores the pointer) and re-hovers until the tooltip shows.OntologyStudioFlows.spec.ts › flow 3(flaky): the empty-canvas double-click after the first concept was dropped while the graph re-rendered (the CI screenshot shows the graph with no drawer). It now retries the double-click until the drawer opens, andfindEmptyCanvasPointmeasures the canvas after the node layout settles instead of before (also used byOntologyNativeRelations.spec.ts).Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
src/hooks/useMetricHierarchy.test.tsx—reloads group members when expanding all on returning to a cached page size(mirrorsMetricListPage's expand-once-per-scope effect, switches 15 → 12 → 15). Fails without the fix, passes with it.src/components/Glossary/GlossaryTerms/tabs/AssetsTabs.test.tsx—keeps the latest results when an earlier search resolves after it. Fails without the fix, passes with it.useMetricHierarchy.test.tsx: 13/13 pass.AssetsTabs.test.tsx: 16/18 — the twoqueryParam changestests also fail locally on the untouched HEAD files (order-dependent mock state), unrelated to this change.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Features/MetricHierarchy.spec.ts,Features/OntologyReview.spec.ts,Features/OntologyStudioFlows.spec.ts,utils/common.ts,utils/ontologyStudio.ts.Manual testing performed
None beyond the unit tests above; ESLint (0 errors) and Prettier on all changed files.
UI screen recording:
Not applicable — bug fixes and test hardening, no new UI feature.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code