Skip to content

fix(ui): metric group and Assets tab lose rows; harden governance Playwright specs - #37212

Merged
anuj-kumary merged 3 commits into
mainfrom
anuj-kumary/metrichierarchy-ontologystudioflows-fix
Nov 6, 2026
Merged

anuj-kumary merged 3 commits into
mainfrom
anuj-kumary/metrichierarchy-ontologystudioflows-fix

Conversation

@anuj-kumary

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #

Fixes the governance-tagged Playwright failures and flake on main at e21b5ff (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 pageSize and useMetricHierarchy resets its state. When the table query is already cached, MetricListPage calls expandAll() in the same commit as the reset. Its closure still holds the card view's groupPageOverrides, 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 expandAll refetches 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 the Assets 2 badge over an empty list. ES lag is ruled out: the picker had just found both assets via search.
After Save, AssetsTabs fires one search with the old (empty) ids filter, then another once the linked ids refresh. fetchAssets had 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. AssetsTabs is shared, so glossary-term, domain, data-product and tag Assets tabs get the same fix.

3. Test-only fixes

  • MetricHierarchy.spec.ts › paginates… and Pagination.spec.ts › Metrics page asserted 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 to limit/offset = 15.
  • OntologyReview.spec.ts › Publish is disabled in All ontologies…: the header is right-aligned and the N Isolated badge 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, and findEmptyCanvasPoint measures the canvas after the node layout settles instead of before (also used by OntologyNativeRelations.spec.ts).

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Metrics list: switching card ↔ table view with a metric group keeps the group's metrics visible.
  • Metric/glossary/domain/data-product/tag Assets tab: an earlier, slower search never overwrites a newer one.
  • Governance Playwright specs above no longer depend on header layout timing or graph re-render timing.

Unit tests

  • src/hooks/useMetricHierarchy.test.tsx — reloads group members when expanding all on returning to a cached page size (mirrors MetricListPage'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 two queryParam changes tests also fail locally on the untouched HEAD files (order-dependent mock state), unrelated to this change.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Updated: Features/MetricHierarchy.spec.ts, Features/OntologyReview.spec.ts, Features/OntologyStudioFlows.spec.ts, utils/common.ts, utils/ontologyStudio.ts.
  • Not run locally (needs the full stack). Each fix is grounded in the CI failure artifacts of run 42151309967 (error context, page snapshots, screenshots, retry traces). Pending: the impacted specs in the merge-queue / a full Playwright dispatch.

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:

  • 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.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

… 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.
@anuj-kumary
anuj-kumary requested a review from a team as a code owner November 6, 2026 04:23
@anuj-kumary
anuj-kumary requested a review from Rohit0301 November 6, 2026 04:23
@github-actions

github-actions Bot commented Nov 6, 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.

@anuj-kumary anuj-kumary added the skip-pr-checks Bypass PR metadata validation check label Nov 6, 2026
@github-actions github-actions Bot added the UI UI specific issues label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 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!

@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs 2.1 and removed UI UI specific issues labels Nov 6, 2026
@github-actions github-actions Bot added the UI UI specific issues label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 10 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), 10 warning(s) across 1 changed file(s).

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

@gitar-bot

gitar-bot Bot commented Nov 6, 2026

Copy link
Copy Markdown
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.

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

@anuj-kumary
anuj-kumary enabled auto-merge (squash) November 6, 2026 04:45
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.6% (141362/173225) 69.01% (51707/74923) 71.98% (28972/40245)

@anuj-kumary
anuj-kumary merged commit aeb147f into main Nov 6, 2026
63 of 64 checks passed
@anuj-kumary
anuj-kumary deleted the anuj-kumary/metrichierarchy-ontologystudioflows-fix branch November 6, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.1 safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants