Skip to content

Fixes #35986: Keep library installs durable, filter packs by industry, and preview pack concepts - #35989

Open
harshach wants to merge 18 commits into
harshach/ontology-studio/12-binding-rowsfrom
harshach/ontology-studio/15-library-install-state
Open

harshach wants to merge 18 commits into
harshach/ontology-studio/12-binding-rowsfrom
harshach/ontology-studio/15-library-install-state

Conversation

@harshach

@harshach harshach commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #35986

Library installations persist on the ontology and are listed through paged permission checks. Users can filter packs by industry and preview bounded concept samples. Applying a stamped draft validates the complete bundled operation plan under the working lock before writing installation provenance in the same transaction.

The published stack targets release 2.1.0. Each linked Shipping issue is In Progress with Product, P1 and Governance metadata.

main → PR1 #35990 → PR2 #35994 → PR3 #35997 → PR4 #35995. Two chains start at PR4:

This PR targets PR12 #35996. It is the tip of its chain. PR9, PR11, PR13, PR14 and PR16 are not published yet.

Current assessment for 1482d33415a, recorded 2026-10-28.

Verdict. The last independent review on record is the 2026-10-25 source integration review at f2f2910b225c, which passed. The plan audit at that head closed with no change. This head merges PR12 cc7c8306185, with no file that PR15 changes. PR15's patch-id is f3cd1753f03 over 84 files before and after the merge, and the verdict ledger carries the verdict to this head on that basis.

Test evidence at this head. The merge gate passed package and spotless, and 664 unit tests in 56 classes with no failures. Nine container-backed classes stop on the missing Docker socket. TypeScript 7.0.2 reports 0 errors. Jest passes 196 tests in 16 files.

CI. Every check at this head passes except maven-collate-ci. That job fails with HTTP 422 (No ref found for: harshach/ontology-studio/12-binding-rows). The Collate build is pointed at this PR's base branch, and the Collate repository has no branch of that name. That is a limit of the CI setup for stacked PRs, not a fault in this PR's code. PR1, whose base is main, passes it.

Still owed. Docker is down on the build machine, so none of these has run. Run each IT on -Pmysql-elasticsearch and then -Ppostgres-opensearch, and confirm a Tests run: line.

  • NativeOntologyLibraryPreviewIT and NativeOntologyPackInstallStateIT, this PR's own ITs. OntologyPackInstallations and OntologyPackSampler call importer.reconcile, which now runs the list rules.
  • NativeOntologyDataGraphPageIT, NativeOntologyImportPreviewIT and OntologyResourceIT, then the 63 IT classes the planner selects for OntologyResource, which main and this PR both changed.
  • The import ITs listed for PR10, which are owed at this head too, first NativeOntologyImportListRulesIT and NativeOntologyCsvInverseReimportIT.
  • The container-backed unit classes, including OntologyPrefixLineageDaoTest and OntologyConceptBindingMigrationTest.
  • Playwright OntologyNativeLibrary.spec.ts and OntologyNativeOperations.spec.ts against a live stack.
  • Changed-class coverage, which needs the ITs above.
  • The plan's live and performance lanes for this PR.

Not verified yet. This PR is verified only when its unit, live and performance boxes in the plan are all checked. The operator lands the stack.

Earlier description and verification records

These records preserve the earlier design notes, test results and attachments. Earlier statements about the current head or readiness apply to their recorded revisions. The integration assessment above supersedes those statements.

Describe your changes:

Fixes #35986

Ontology Studio previously forgot a library installation after reload and previewed packs as module hubs without their concepts. This PR stores pack provenance on the applied ontology, derives installation marks from authorized stored ontologies, groups six L2 packs by industry, and renders a bounded sample of real concepts and labeled relations before install.

The sourcePack metadata travels with the previewed change set. Applying it writes installedPacks with the ontology in the same transaction. The catalogue scans all raw ontology pages, checks view permission in batches per page, and returns every visible installation, including after wholly hidden pages. Administrators avoid unnecessary hydration. The detail header says Aligned to FIBO; the full standard remains in its row.

Type of change:

  • New feature

High-level design:

  • industry and layer are pack manifest fields; sourcePack and installedPacks are schema-first fields on the change set and ontology.
  • GET /v1/ontologyPacks derives visible installation locations from stored ontology data; GET /v1/ontologyPacks/{packId}/sample returns at most 60 concepts and their relations for selected modules.
  • Industry filters, card navigation, module toggles, graph preview, layer selection, installation marks, and disabled create state are connected to the server responses.
  • ADR:2026-10-19-native-ontology-imports-use-working-drafts includes a v5 amendment specifying bounded keyset pages and a complete visible response, including its response-size cost.

Tests:

  • Native Java 21.0.11 service/operator/MCP/integration-test compilation, 11-module distribution build, Spotless, decision-record check, normal pre-commit hooks, and Java impact-map check passed on the final source.
  • Real MySQL and PostgreSQL storage regression passed 2/2, including a wholly authorization-hidden page, a noninstalled gap, and later visible installs.
  • Focused UI Jest passed 64 suites/460 tests; TypeScript diagnostics had no introduced delta against the same base. Format and i18n checks passed.
  • Private MySQL/Elasticsearch HTTP proof covered both pack samples, apply, durable metadata, reload, conditional-owner visibility, denied create, and deletion removing an install mark. Five non-admin catalogue requests caused zero per-row ontology reads and five batch reads; five admin requests caused zero of either.
  • Focused Playwright auth setup and library E2E each passed 1/1. Current-head browser review passed ten assertions and produced screenshots plus a 35.52-second MP4 in the owner evidence.
  • Full MySQL/Elasticsearch, PostgreSQL/OpenSearch, and PostgreSQL/Elasticsearch/Redis workflows were dispatched on c36d0ba and remain pending. Baseline comparison and formal quiet-host latency proof remain open.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: no SQL migration is needed because optional provenance fields are stored in the entity JSON; schema-first generated types were refreshed.
  • I have added tests that prove my fix is effective or that my feature works.

Summary by Gitar

  • Ontology import and export:
    • Added native CSV reader, writer, and format detection for ontology imports
    • Import preview now reports new, updated, and skipped definitions
  • Class model and relations:
    • Native classes record abstraction, source, and deprecation metadata
    • Object properties map to registry relationship types with inverse links
  • Definition status:
    • Definition status now derives from releases and unpublished changes
  • Concept bindings:
    • Concept bindings move to dedicated rows with a v2.1.0 migration
  • Review workflow:
    • Ontology reviews bind workflow tasks to revisions and track votes
  • Library installs:
    • Installed packs persist on ontologies and appear in paged catalogue listings
    • Packs can be filtered by industry and previewed with bounded concept samples
    • Pack installs validate the bundled plan and record provenance in the same transaction
  • Pack metadata:
    • Packs declare industry and layer, with six L2 industry packs
    • Pack previews enforce bounded concept samples for selected modules

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge; no new blocking issue was established.

Summary

This PR stores library installation records on ontologies, lists the installations each user may view, and adds industry filters and concept previews.

  • Native pack installs stay on their ontology and reappear in the library.
  • The library catalogue filters its six bundled packs by industry.
  • Pack previews show a bounded graph of selected concepts and relations.

Diagram

sequenceDiagram
  participant User
  participant Library
  participant Server
  participant Database
  User->>Library: Select pack and modules
  Library->>Server: Request concept sample
  Server-->>Library: Return bounded concepts and relations
  Library->>Server: Preview against target ontology
  Server-->>Library: Return draft with sourcePack
  Library->>Server: Apply draft
  Server->>Database: Lock working ontology
  Server->>Server: Compare complete plan with bundled import
  Server->>Database: Write definitions and installedPacks together
  Library->>Server: Reload catalogue
  Server-->>Library: Return visible installations
Loading

Reviews (13) · Last reviewed commit: "Merge native relations fixes into librar..." · Reviewed by Greptile

…ract

Library pack manifests gain an industry and the layer a new target
ontology uses. Change sets carry the sourcePack a library preview
stamps, and ontologies carry the installedPacks the server records
when such a change set applies. Every bundled pack is an L2 industry
pack. TypeScript types are regenerated.
@harshach harshach added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs backend labels Oct 22, 2026
@harshach
harshach requested a review from a team as a code owner October 22, 2026 15:07
@harshach
harshach requested a review from manerow October 22, 2026 15:07
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

… the import ADR

The pack catalogue now reports, per installed pack, the native ontologies the
caller may view, as records that pair an ontology reference with its stored
installation entry. A new sample response describes the concepts and relations
that installing a module selection creates, bounded to 60 concepts.

The decision record gains a v4 amendment: installed state is durable on the
ontology, written in the apply transaction through the versioned updater, and
clients cannot write it. TypeScript types are regenerated.
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 79%
79.86% (131981/165247) 66.45% (46644/70191) 69.43% (26453/38099)

@harshach
harshach requested a review from a team as a code owner October 23, 2026 18:40
@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: 984 → 984
- 0 added, 0 removed, 8 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/playwright/support/fixtures/isolatedUser.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/apiResponse.ts
  openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts
  openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyLibraryDetail.tsx
  openmetadata-ui/src/main/resources/ui/src/components/governance/ontology/OntologyNativeLibraryDetail/OntologyNativeLibraryDetail.tsx
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/ontology.ts
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/table.ts
  openmetadata-ui/src/main/resources/ui/src/pages/OntologyExplorerPage/OntologyExplorerPage.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

Comment thread openmetadata-ui/src/main/resources/ui/src/rest/ontologyAPI.ts
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

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

Count Rule
2 openmetadata-imports/no-api-calls-in-iteration
1 openmetadata-imports/review-sequential-api-calls
All findings
Location Rule Message
🟡 src/hooks/governance/ontology/useOntologyChangeSetApply.ts:123:30 openmetadata-imports/no-api-calls-in-iteration Avoid issuing one API request per item. Fetch at the data owner, use a bulk endpoint, or use useQueries with an intentional concurrency policy.
🟡 src/hooks/governance/ontology/useOntologyChangeSetApply.ts:272:9 openmetadata-imports/review-sequential-api-calls Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent
🟡 src/rest/ontologyAPI.ts:124:28 openmetadata-imports/no-api-calls-in-iteration Avoid issuing one API request per item. Fetch at the data owner, use a bulk endpoint, or use useQueries with an intentional concurrency policy.

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

make ui-checkstyle-changed

@greptile-apps

This comment has been minimized.

@harshach
harshach added this pull request to stack #36185 October 26, 2026 00:55
Regenerate docs/generated/api-reference.md: both sides moved the endpoint count from 1987 to 1988, this branch for the pack sample endpoint and binding rows for the data graph pages endpoint, so the merged file listed 1989 endpoints under a count of 1988.
@gitar-bot

gitar-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 3 closed / 3 findings

🔴 High risk · Atomic pack-install writes and permission-filtered catalogue listings affect ontology integrity and visibility; mistakes could misrecord provenance or expose hidden installs.

Adds durable library install provenance on ontologies, industry filters, and bounded concept previews for packs, with installs written in the same transaction as the applied draft. Resolved the ADR conflict on session-scoped installs, overlapping sample graph nodes, and per-ontology catalogue re-fetches. No open issues remain.

✅ 3 closed
✅ Quality: Durable installedPacks contradicts Accepted ADR's session-scoped install

📄 openmetadata-spec/src/main/resources/json/schema/entity/data/ontology.json:82-89 📄 openmetadata-spec/src/main/resources/json/schema/entity/data/ontologyChangeSet.json:107-110 📄 openmetadata-spec/src/main/resources/json/schema/api/data/createOntologyChangeSet.json:59-62 📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyPackManifest.json:28-42 📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyPackManifest.json:83-84 📄 openmetadata-service/src/main/resources/json/data/ontology/packs/fibo.json:6-7
ADR:2026-10-19-native-ontology-imports-use-working-drafts (Accepted, v3 amendment) says: "Installed state retains the actual target and module selection for the mounted library session… browser reload recovery is outside this session-scoped contract." This commit adds installedPacks to ontology.json and sourcePack to change sets, so install state is persisted on the ontology when the apply transaction runs. That reverses the recorded decision. The PR says the amendment comes in a later commit, but the record is unchanged on this branch, so merging as-is leaves the Accepted record contradicting the schema.

Add an amendment (v4) in this PR that replaces the session-scoped paragraph. Suggested wording: "Applying a change set whose sourcePack is set records one ontologyPackInstallation per pack ID in the target ontology's installedPacks in the same transaction; a failed apply records nothing, and GET /v1/ontologyPacks reports installs from this durable state." Also add a Guard test name to the record.

✅ Bug: Sample graph nodes overlap when a layer has more than four concepts

📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyPackSampleGraph.utils.ts:19-22 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyPackSampleGraph.utils.ts:63-69 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/OntologyPackSampleGraph.utils.ts:89-96
layoutOntologyPackSample places each depth layer's nodes at x = (index+1) * 720 / (n+1) with a fixed node width of 148, so the spacing drops below the node width once a layer holds five or more concepts. The sample endpoint returns up to 60 concepts, and a shallow broader hierarchy puts most of them in one or two layers. Their rectangles and truncated labels then sit on top of each other and the preview can't be read. To fix it, wrap wide layers into extra rows, or widen the viewBox to layer.length * (NODE_WIDTH + gap) so preserveAspectRatio scales the graph down.

✅ Performance: Catalogue list re-fetches every installed ontology one at a time

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/ontology/OntologyPackResource.java:106-118 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/OntologyRepository.java:126-140
canView now builds new ResourceContext<>(Entity.ONTOLOGY, ontology.getId(), ontology.getName()). That throws away the ontology already read from the page, so resolveEntity() calls entityRepository.get(...) again for each row, loading its owner/domain relationships. In the same commit, listWithInstalledPacks drops the old MAX_INDEXED_ONTOLOGIES cap and scans every installed ontology in pages of 1000. As a result, every GET /v1/ontologyPacks from a non-admin user does one extra entity fetch per installed ontology (an N+1 query pattern), and the cost grows without limit as installs pile up. Since this endpoint loads the library page, the cost hits every visit. Keep the already-loaded entity and batch-load the authorization fields per page instead, using a shared BulkFieldHydrator the way ViewPermissionFilter/OntologyImpactResource do. That keeps the owner-condition fix without paying one fetch per row.

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

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

This branch was successfully deployed

1 active (outdated) deployment
test — 1482d334 Deployed Oct 27, 2026 by harshach via RDF Playwright execution #40427
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ontology Studio: keep library installs durable, filter packs by industry, and preview pack concepts

2 participants