Skip to content

fix(ui): keep OntologyNativeTreeShell spec inside the UI tree - #36741

Merged
anuj-kumary merged 2 commits into
mainfrom
anuj-kumary/ontology-spec-bundled-seeds
Oct 31, 2026
Merged

anuj-kumary merged 2 commits into
mainfrom
anuj-kumary/ontology-spec-bundled-seeds

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #

The nightly AUT run 41178829782 (1.12.14 ➡ main) fails on both full lanes (MySQL and PostgreSQL) at Playwright test collection, before any test runs:

Error: ENOENT: no such file or directory, open '/collate/collate-ui/src/openmetadata-service/src/main/resources/json/data/settings/sparqlQuerySettings.json'
   at src/openmetadata-ui/playwright/e2e/Features/OntologyNativeTreeShell.spec.ts:32
Listing tests:
Total: 0 tests in 0 files

Cause. OntologyNativeTreeShell.spec.ts (added in #36190) reads the backend seed file sparqlQuerySettings.json at module load through ../../../../../../../../openmetadata-service/.... That path resolves in this repo. Collate runs the OSS specs from a mirrored copy of the UI tree, where the same eight levels end at collate-ui/src/, which has no openmetadata-service. A module-load error aborts collection for the whole project.

Fix.

  • Added playwright/constant/ontology.ts, a copy of the three seed query templates typed with the generated SavedSparqlQuery.
  • OntologyNativeTreeShell.spec.ts reads the seeds from that constant and no longer uses fs/path.

I first tried importing the app's BUNDLED_GLOSSARY_QUERY_TEMPLATES, but no-restricted-imports forbids app code from src/ in Playwright and asks for a copy under playwright/. Drift between the backend seeds and the app constant is still caught by OntologyStudioQueryConsole.test.tsx, which loads the real backend file. If the Playwright copy drifts, the spec's visibility assertions fail.

Type of change:

  • Bug fix

Tests:

Use cases covered

  • Playwright can collect OntologyNativeTreeShell.spec.ts from a copy of the UI tree that has no openmetadata-service beside it.

Unit tests

  • Not applicable (test-only change).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • playwright/e2e/Features/OntologyNativeTreeShell.spec.ts, playwright/constant/ontology.ts

  • The new constant is byte-for-byte equal (JSON.stringify) to queryTemplates in openmetadata-service/.../sparqlQuerySettings.json.

  • npx playwright test playwright/e2e/Features/OntologyNativeTreeShell.spec.ts --list lists the spec's tests. ESLint and Prettier pass on both files.

  • Reproduced the AUT failure locally. I copied the Collate layout (OSS UI mirrored under collate-ui/.../src/openmetadata-ui/, no openmetadata-service beside collate-ui/src/) and used the nightly's automate-upgrade-tests/scripts/k8s/playwright.config.ts. Then I ran the command from list-playwright-contract.sh: npx playwright test --project=chromium --grep-invert '@dataAssetRules|@askcollate|@ingestion' --workers=3 --reporter=list --list

    Spec Result
    Before (main) exit 1, ENOENT ... sparqlQuerySettings.json at OntologyNativeTreeShell.spec.ts:32, Total: 0 tests in 0 files (same as CI)
    After (this PR) exit 0, Total: 5508 tests in 560 files, both OntologyNativeTreeShell tests listed
  • Not run against a live server; the assertions themselves are unchanged.

The spec read sparqlQuerySettings.json from openmetadata-service through a
path eight levels above itself. Collate runs the OSS specs from a mirrored
copy where that path does not exist, so Playwright test collection aborted
with ENOENT and both full AUT lanes listed 0 tests.

Read the seeds from a playwright/constant copy instead, as the
no-restricted-imports rule asks.
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Oct 31, 2026
@anuj-kumary
anuj-kumary requested a review from a team as a code owner October 31, 2026 08:37
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Oct 31, 2026
@anuj-kumary
anuj-kumary requested a review from sweta1308 October 31, 2026 08:37
@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.

@anuj-kumary anuj-kumary self-assigned this Oct 31, 2026
@anuj-kumary anuj-kumary added the skip-pr-checks Bypass PR metadata validation check label Oct 31, 2026
@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: 1020 → 1021
- 1 added, 0 removed, 0 changed spec-list

New source→spec entries:
  openmetadata-ui/src/main/resources/ui/playwright/constant/ontology.ts

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 Oct 31, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟢 Low risk · The changes are confined to Playwright fixtures and collection, affecting test setup and assertions without changing application runtime behavior.

Moves the seed query templates for OntologyNativeTreeShell.spec.ts into a local constant at playwright/constant/ontology.ts, so Playwright collection no longer reads openmetadata-service through a relative path that breaks in Collate's mirrored UI tree. 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 October 31, 2026 08:44
@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 28c9a8c Oct 31, 2026
68 checks passed
@anuj-kumary
anuj-kumary deleted the anuj-kumary/ontology-spec-bundled-seeds branch October 31, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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