Skip to content

Fixes 33256: Preserve ontology graph across Studio modes - #33257

Open
harshach wants to merge 2 commits into
mainfrom
harshach/fix-ontology-mode-switch
Open

Fixes 33256: Preserve ontology graph across Studio modes#33257
harshach wants to merge 2 commits into
mainfrom
harshach/fix-ontology-mode-switch

Conversation

@harshach

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #33256

Keep the loaded Ontology Studio explorer mounted across Query/AI navigation so the recorded View → Edit → Query → Edit → View sequence preserves the graph, search and counts without refetching the catalog; retain existing refresh behavior after Model workbench changes and library installations.

Type of change:

  • Bug fix

High-level design:

N/A — small, four-file fix: a stable, hidden/inaccessible explorer container while other read-only Studio surfaces are active, without a new cache or API changes.

Tests:

Use cases covered

  • Recorded all-glossaries mode sequence with catalog reload requests unavailable
  • Scoped search, graph nodes/edges, zoom and counts retained
  • RDF-enabled and RDF-disabled Query screens
  • Original in-flight graph load completing while Query is open
  • Library open/close and existing Model workbench refresh behavior

Unit and frontend integration tests

  • OntologyExplorerPage.test.tsx: component lifetime and search preservation
  • OntologyExplorerPage.integration.test.tsx: real explorer, data hook and graph builders with API/canvas boundaries mocked
  • 70 passing tests across 5 suites, including existing explorer and hook tests
  • OntologyExplorerPage.tsx: 95.95% line coverage
  • Regression tests failed on the original implementation with the loading graph remaining visible

Backend integration tests

  • Not applicable — no backend/API changes

Ingestion integration tests

  • Not applicable — no ingestion changes

Playwright (UI) tests

  • playwright/e2e/Features/OntologyStudio.spec.ts: 8/8 passing against this checkout's Vite server and local backend
  • New/extended regression scenarios: 10/10 passing across five repetitions

Manual testing performed

Browser-driven replay on 127.0.0.1:3000, verified to serve this checkout, with 260 synthetic terms and 112 relations: the recorded sequence preserved the graph and counts, with catalog request count unchanged after the fix versus 21 additional requests before it.

Additional checks

  • Changed-file organize-imports → ESLint → Prettier, full Playwright lint, license headers and explicit pre-commit checks
  • TypeScript semantic checks: zero diagnostics in all four changed files
  • Repository-wide TypeScript checks remain failing in unchanged code; the global CSS token audit has 117 existing errors outside this diff

UI screen recording / screenshots:

TODO: attach the locally captured synthetic-data screenshots (.context/ontology-before-switch.png, .context/ontology-edit-local.png); keeping this PR in draft until the required visual evidence is uploaded.

Checklist:

  • PR title follows Fixes <issue-number>: <short explanation>
  • Linked issue via Fixes #33256
  • Non-obvious component-lifetime decision documented
  • Unit, frontend integration and Playwright regression tests listed above
  • Exact recorded click sequence covered
  • Schema/migrations: not applicable
  • Screenshot uploaded — draft pending attachment

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 13, 2026
@harshach
harshach marked this pull request as ready for review September 13, 2026 16:41
@github-actions

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.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 766 → 767
- 1 added, 0 removed, 0 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyLibrary.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@gitar-bot

gitar-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Preserves the ontology graph across Studio mode switches (Query/AI navigation) by keeping the explorer mounted while other surfaces are active, eliminating unnecessary catalog refetches. Comprehensive test coverage includes unit, integration, and Playwright tests with 70 passing tests and 95.95% line coverage on the modified component. No issues found.

Options

Display: compact → Counting what did not apply, without listing it.

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

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

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

Count Rule
1 openmetadata-imports/no-internal-barrel-imports
All findings
Location Rule Message
🟡 src/pages/OntologyExplorerPage/OntologyExplorerPage.tsx:27:1 openmetadata-imports/no-internal-barrel-imports Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph.

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

make ui-checkstyle-changed

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.46% (99173/136853) 57.01% (58522/102652) 58.28% (19554/33547)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 64bbc06b9fd94f68baf63d1ec8e2d80e11c279ac in Playwright run 34769360692, attempt 1.

✅ 607 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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) 46m 41s

⏱️ Max setup 5m 46s · max shard execution 17m 9s · max shard-job elapsed before upload 20m 27s · reporting 4s

🌐 219.93 requests/attempt · 2.07 app boots/UI scenario · 5.93% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 219.93 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.07 per UI scenario (1380 boots / 666 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 149 0 0 0 0 0
✅ Shard chromium-02 163 0 0 0 0 0
✅ Shard chromium-03 137 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 11 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ontology Studio loses its loaded graph after returning from Query

2 participants