Skip to content

Fixes #35988: Add abstract, source, and deprecation fields to native ontology classes - #35997

Merged
harshach merged 58 commits into
mainfrom
harshach/ontology-studio/03-class-model
Oct 29, 2026
Merged

harshach merged 58 commits into
mainfrom
harshach/ontology-studio/03-class-model

Conversation

@harshach

@harshach harshach commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #35988

Native ontology definitions record abstraction, definition source, deprecation and replacements. RDF import and export preserve those fields, and grouped working diffs remain revision-bound. With definition status in the parent, captured release summaries now include the deprecated count.

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 PR2 #35994. Its child is PR4 #35995. PR9, PR11, PR13, PR14 and PR16 are not published yet.

Current assessment for fca4419074b, recorded 2026-10-29.

Verdict. PASS. A scoped independent review of the merge's own code passed this head. This head merges PR2 d63d5123479, which carries main ca9b8c04a93. main #36433 added a change-badge colour map with no entry for PR3's Deprecated change type, so the merge maps it to gray, as main's status badges do. PR3's 58 earlier files keep their changed lines, and the review read the 2 adapted files. The last full review is the 2026-10-25 source integration review at 33601808a79, which passed. No minor issue is declared.

Test evidence at this head. The Java gates ran on the first staged merge tree 2d02b81e6b1. The adaptation changes no Java file. Package and spotless passed, and 285 unit tests in 14 classes passed. OntologyReleaseReviewListTest passed 6 of 6 on local MySQL and PostgreSQL. OntologyEntityDAOTest and OntologyReleaseComparisonStorageTest stop on the missing Docker socket. The UI gates ran on the adapted staged tree, which is the commit's tree 2aaddd9b294. TypeScript reports 0 errors, Jest passes 33 of 33 in OntologyReleasePanel.test.tsx, and ESLint, Prettier and the i18n check are clean.

CI. Every check at this head passes except maven-collate-ci. That job fails with HTTP 422 (No ref found for: harshach/ontology-studio/02-definition-status). 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.

  • TaskResourceIT and the task ITs listed on PR1, which this head carries.
  • PR1's review-list ITs IndependentOntologyApprovalIT, IndependentOntologyPublicationIT and IndependentOntologyReleaseIT, and WorkflowDefinitionResourceIT in the global-state lane.
  • Every merge-queue IT, with the cache-tests and postgres-opensearch lanes. main brings 184 Java files, the 2.1.0 migrations and schema changes, so the planner selects the full suite.
  • The container-backed classes OntologyEntityDAOTest and OntologyReleaseComparisonStorageTest.
  • Changed-class coverage, which needs the ITs above.
  • The plan's live and performance lanes for this PR.

AI mode. main's Ontology Studio AI-mode restyle #36433 now gates new screens on AI mode. PR3 adds no UI control. Its UI changes are generated types and the merge's gray badge for a deprecated change. The AI-mode case "shows a deprecated working change with its badge in AI mode" renders that change in AI mode. AI mode lacks none of PR3's controls.

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 #35988

Native ontology classes could not say that they are abstract, where their definition comes from, or that they are deprecated and which definition replaces them. This PR adds abstract, definitionSource, deprecated and replacedBy to concepts, and deprecated and replacedBy to properties. It projects them as om:abstract, dcterms:source, owl:deprecated and dcterms:isReplacedBy and reads them back on import. Release and working diffs classify a member whose deprecated turned true as DEPRECATED. GET /api/v1/ontologies/{id}/working/diff?groupBy=concept serves rows grouped by concept (change type, parent labels, property count, member changes), paged by concept under the same revision binding (a stale cursor returns 412). A property with a single enumeration value is refused with An enumeration needs at least two allowed values. Adds a decision record for the new fields.

Also in this PR: a MySQL deadlock fix. OntologyReferenceIndex.replace no longer deletes the reference rows of a definition that does not exist yet. Deleting a missing key range takes a gap lock, and two concurrent creates then deadlocked on their inserts and returned 500 after the retries ran out.

Left out: the changeSummary deprecated count (PR2 is not in the base) and any UI.

Deviations from the plan:

  • Grouped diff keeps concept-less rows (ontology root, orphans), so the grouped view is a lossless partition of the plain diff.
  • A change set advances the working revision once per applied operation, not once. That is how OntologyWorkingState behaves on main, so the IT asserts it.

What could break: the enumeration rule applies only when a one-value list differs from the stored value, so stored definitions stay editable. replacedBy is validated as a same-kind, same-ontology reference, so deleting a replacement is refused.

Type of change:

  • New feature

Tests:

  • Unit: mvn test -pl openmetadata-service -Dtest='Ontology*Test,NativeOntology*Test,RdfOntologyContractTest,OwlProfileGuardTest': 595 run, 0 failures. Line coverage from unit tests alone: projection 98%, importer 98%, validator 95%, OntologyConceptChanges 100%, comparison 69%, property repository 71%; the resource and mappers are covered by the ITs.
  • IT: IndependentOntologyClassModelIT and NativeOntologyMemoryIT (new cases: class change set with two parents, an equivalent class, a disjoint class and three properties; rollback when the last operation fails), plus the affected ontology ITs, on -Pmysql-elasticsearch and -Ppostgres-opensearch: 739 run, 0 failures, 96 skipped on each.
  • Before the deadlock fix, NativeOntologyMemoryIT failed on MySQL in 3 of 3 solo runs; after it, 3 of 3 pass.
  • Not run: the full java-affected-tests plan (about 400 ITs) and a perf probe.

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.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Adds abstraction, source, deprecation, and replacement fields to native ontology definitions.

  • Concepts and properties carry class details through API storage and RDF exports.
  • Newly deprecated definitions appear as a separate kind of release change.
  • Working diffs can show changed members together under their concept.
  • Data-property enumerations must contain at least two allowed values.
  • Concurrent ontology creation no longer deletes an empty reference range.

No actionable issue was established. No previous review threads were supplied. The full PR diff was reviewed because the previous and current commits have different merge bases with the target. Tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Definition writes or RDF import] --> B[Working definitions]
  B --> C[Reference and structure checks]
  B --> D[Release capture]
  D --> E[RDF export]
  B --> F[Compare with active release]
  F --> G[Flat member changes]
  F --> H[Concept groups]
  G --> I[Revision-bound paging]
  H --> I
Loading

Reviews (8) · Last reviewed commit: "Merge definition status into class model" · Reviewed by Greptile


Summary by Gitar

  • Release summaries:
    • OntologyReleaseChangeSummary now includes a deprecated count, separate from added, changed and removed
  • Release panel:
    • OntologyReleasePanel shows DEPRECATED changes with a gray badge

This will update automatically on new commits.

harshach and others added 4 commits October 22, 2026 08:07
First unit of #35983. The enum carries the Any or All reviewer rule that
later commits put on the ontology, freeze into the review target, and
turn into the review task's approval threshold.
Adds the fields to the concept and property schemas, the create
requests, the release payload allowlist, and the RDF catalog vocabulary.
Adds the DEPRECATED change type, the REPLACED_BY reference role, and the
concept-grouped rows of the working diff. Regenerates the TypeScript
types.
@harshach
harshach requested a review from a team as a code owner October 22, 2026 15:18
@harshach harshach added safe to test Add this label to run secure Github workflows on PRs backend labels Oct 22, 2026
@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!

@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: 80%
80.18% (132533/165284) 66.8% (46974/70314) 69.84% (26621/38116)

Concepts and properties now carry deprecation and replacement, and
concepts carry abstract and a definition source:

- A replacement must name another definition of the same kind in the
  same ontology. It is indexed as a REPLACED_BY reference, so deleting
  a replacement target is refused like any other dangling reference.
- An enumeration needs at least two allowed values. One-value
  enumerations stored before this rule stay editable until their values
  change.
- Release projection writes om:abstract, dct:source, owl:deprecated,
  and dct:isReplacedBy, and native import reads them back.
- Release and working diffs classify a member whose deprecated flag
  turned true as DEPRECATED.
- GET /ontologies/{id}/working/diff?groupBy=concept returns the working
  changes grouped by the concept they define, with parent labels and a
  property count, paged by group under its own revision-bound cursor.
…sion

IndependentOntologyClassModelIT covers the field round trips, the
enumeration minimum and its legacy carve-out, replacedBy integrity, the
DEPRECATED diff row, and grouped diff paging with the 412 cursor rule.
NativeOntologyMemoryIT adds a class-create change set and its rollback.
Existing ITs that stored one-value enumerations now use two values.
Adds the fields to the concept and property schemas, the create
requests, the release payload allowlist, and the RDF catalog vocabulary.
Adds the DEPRECATED change type, the REPLACED_BY reference role, and the
concept-grouped rows of the working diff. Regenerates the TypeScript
types.
Concepts and properties now carry deprecation and replacement, and
concepts carry abstract and a definition source:

- A replacement must name another definition of the same kind in the
  same ontology. It is indexed as a REPLACED_BY reference, so deleting
  a replacement target is refused like any other dangling reference.
- An enumeration needs at least two allowed values. One-value
  enumerations stored before this rule stay editable until their values
  change.
- Release projection writes om:abstract, dct:source, owl:deprecated,
  and dct:isReplacedBy, and native import reads them back.
- Release and working diffs classify a member whose deprecated flag
  turned true as DEPRECATED.
- GET /ontologies/{id}/working/diff?groupBy=concept returns the working
  changes grouped by the concept they define, with parent labels and a
  property count, paged by group under its own revision-bound cursor.
…sion

IndependentOntologyClassModelIT covers the field round trips, the
enumeration minimum and its legacy carve-out, replacedBy integrity, the
DEPRECATED diff row, and grouped diff paging with the 412 cursor rule.
NativeOntologyMemoryIT adds a class-create change set and its rollback.
Existing ITs that stored one-value enumerations now use two values.
An ontology carries an approvalRule, AnyReviewer by default or
AllReviewers. prepareReview freezes the rule into the task's review
target and leaves the requester's and the author's own user entries out
of the assignees. The rule reaches the workflow as the start variable
approvalMode=allAssignees, which CreateTask turns into the task's
approvalThreshold, so the shared counters stay unchanged.

Each counted vote is recorded on the task in reviewVotes with its
comment; the deciding vote is recorded in the decision transaction with
any voter whose record was lost. Reviewers and the approval rule are
locked with 409 while a release of the ontology is in review.

GET /v1/ontologyReleases/{id}/review and
GET /v1/ontologies/reviews?view=assigned|created|pending read a review
from the task's recorded votes.

Amends ADR:2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions
as v13.
Only an ontology review reconciles the deciding vote, so recording
counted votes on any other multi-approval task would always leave its
last vote out and add version bumps to glossary approvals. The waiting
branch now records a vote only for an ontology review.

OntologyReleaseReviewReaderTest reads reviews through the reader with
literal tasks and votes. OntologyReleaseRepository.page and offset are
static so the cursor math has a test with literal rows.
…RDF ontology

The release inherits its reviewers from the ontology, and the entity
updater drops inherited references from a reviewer list, so the task's
REVIEWS rows vanished on the workflow's first stage update.
OntologyReview.eligibleReviewers now returns plain copies.

A counted vote whose record loses every optimistic-locking retry answers
200 with a warning, because the vote already counted in Flowable and the
decision records it.

openmetadata.ttl declares om:approvalRule, which the ontology projection
writes. The ITs unwrap the SDK's wrapped 409 and fetch the task with its
reviewers.
TaskRepository keeps a task's about out of the stored JSON and clears it
unless the read asks for it. The review list read tasks without about, so
it matched no release and returned no rows in any view.
A steward who reviews glossary approvals and one release review lists
pending reviews, and a requester who created them lists created reviews.
Each gets the one release, and no statement the list runs names a
glossary approval task.
The review list read every open approval task the caller was on,
glossary and data product approvals included, and hydrated each one.
The task filter now also requires a task about an ontology release, and
the list reads the releases of the listed tasks in one query instead of
one query per task.
Surefire runs every service test class in one JVM, and a repository
the test registers stays bound to its database after the class ends.
The fixed list never reads a glossary term, so the test now names the
term's type on its reference instead of registering the repository.
A release can be in review under a new task while the task it was in
review under before is still open. The list must show the release once,
under the current task. No test covered the check in reviewedRelease
that drops the older task, so every test passed without it.
The list loads the releases of all listed tasks in one batched read.
The list test now asserts that exactly one statement reads release rows
and that it covers both releases, so a read per task fails it. Resolving
each task's about reads only the names of its release, so the assertion
does not count that lookup.
Adds a gray badge for deprecated changes to main's AI-mode change list, as StatusBadge.constant.ts colours a deprecated status.
@harshach
harshach requested a review from a team as a code owner October 29, 2026 10:18
Main moved 26 commits before PR1 landed. The merge had no conflicts.
PR1 landed on main as 5f2b733. This branch already holds PR1's final code, so the merge keeps the tree.
PR2's branch brings main through 7843a02 and records PR1's squash merge 5f2b733. The merge had no conflicts.
Base automatically changed from harshach/ontology-studio/02-definition-status to main October 29, 2026 20:03
PR2 landed on main as 8c01d4c, a squash of ae01b93 with the same tree.
This merge records the squash so that main is an ancestor of this branch. The
tree does not change.
@gitar-bot

gitar-bot Bot commented Oct 29, 2026

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

🟡 Medium risk · Adding ontology metadata, deprecation classification, grouped diff paging, and RDF import/export changes could misrepresent persisted definitions or release comparisons.

Adds abstraction, definition source, deprecation and replacement fields to native ontology concepts and properties, carried through storage, RDF import/export, release capture and grouped working diffs. No open issues remain; the DEPRECATED change type now emits from comparison, the new fields export to RDF, and a decision record covers the new contracts.

✅ 3 closed
✅ Bug: DEPRECATED change type is declared but the comparison never emits it

📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyReleaseDiff.json:15
The schema and the generated TypeScript now include DEPRECATED, and the description says such members are classified DEPRECATED. But OntologyReleaseComparison.changeType only ever returns ADDED, REMOVED or CHANGED. Because deprecated is now one of the semantic fields, setting it to true makes the digest differ, so the member is reported as CHANGED. Clients written against the new enum will never see DEPRECATED. The grouped-diff list in the description's "follow in the next pushes" does not cover this. The fix is to pass both snapshots to changeType and return DEPRECATED when before.deprecated is false and after.deprecated is true.

✅ Bug: New semantic fields are sealed into releases but dropped from RDF export

📄 openmetadata-service/src/main/java/org/openmetadata/service/ontology/OntologyReleaseContent.java:33-47 📄 openmetadata-spec/src/main/resources/rdf/ontology/openmetadata.ttl:4169-4175
abstract, definitionSource, deprecated and replacedBy are now part of the sealed release member content. Reviewers approve them, and they affect the digest. However, nothing under service/rdf/ (OntologyReleaseProjection, the concept and property writers, NativeOntologyRdfImporter) reads these fields. An activated release therefore puts no deprecation or abstract marker into Fuseki, and Turtle, RDF/XML and JSON-LD exports drop them without any error. The Accepted release-sealing ADR says "Unsupported members fail export rather than disappearing." The fix is to land the projection in this PR, using owl:deprecated, dct:isReplacedBy, om:abstract and om:definitionSource. RelationshipTypeRdfWriter already uses DCTerms.isReplacedBy. The alternative is to keep these fields out of semanticFields until the projection supports them.

✅ Quality: New cross-component contracts and limits have no decision record

📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyReleaseDiff.json:15 📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyWorkingDiff.json:10 📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyWorkingDiff.json:63-69 📄 openmetadata-spec/src/main/resources/json/schema/entity/data/ontologyProperty.json:105 📄 openmetadata-spec/src/main/resources/json/schema/entity/data/ontologyProperty.json:112-115 📄 openmetadata-spec/src/main/resources/json/schema/type/ontologyReference.json:32 📄 openmetadata-service/src/main/java/org/openmetadata/service/ontology/OntologyReleaseContent.java:33-47
This PR adds contracts that the UI, Python and Java all have to agree on, and none of them is recorded in docs/decisions/. No ontology ADR mentions deprecation, abstract classes, grouped diffs or the minimum size of an enumeration. The records would need to say these things:

  1. DEPRECATED change type. "A release or working-diff member whose deprecated turned true is classified DEPRECATED, not CHANGED." This comes from the description's "classifies a member whose deprecated turned true as DEPRECATED". The record should also say what happens when other fields change in the same step, and what happens when the flag goes back to false.
  2. Grouped working diff. "A property belongs to the group of its first domain in this ontology. A change that belongs to no concept forms its own group. When grouping is requested, data is empty, paging counts groups, and a page holds at most 1000 groups." The 1000 cap was a judgment call.
  3. Enumerations. "An enumeration must have at least two allowed values." This is the description's "refuses an enumeration with a single value".
  4. REPLACED_BY reference role. "replacedBy must name a member of the same ontology."
  5. Release content. "abstract, definitionSource, deprecated and replacedBy join the sealed ontology-release-v1 member content without a new encoding version." The Accepted record ontology-releases-seal-canonical-sql-members defines that content contract and warns against reinterpreting it under a revised contract, so this change needs to be recorded or given a new version.

The fix is to add a record, or amend the release-sealing ADR, so it states these rules.

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

@harshach
harshach merged commit 5575a2d into main Oct 29, 2026
75 checks passed
@harshach
harshach deleted the harshach/ontology-studio/03-class-model branch October 29, 2026 21:40
manerow pushed a commit that referenced this pull request Oct 30, 2026
…ontology classes (#35997)

* WIP: add OntologyApprovalRule schema for release review rules

First unit of #35983. The enum carries the Any or All reviewer rule that
later commits put on the ontology, freeze into the review target, and
turn into the review task's approval threshold.

* WIP: record that ontology definition status is derived from releases

* WIP: add abstract, source, and deprecation fields to native classes

Adds the fields to the concept and property schemas, the create
requests, the release payload allowlist, and the RDF catalog vocabulary.
Adds the DEPRECATED change type, the REPLACED_BY reference role, and the
concept-grouped rows of the working diff. Regenerates the TypeScript
types.

* Update generated TypeScript types and dereferenced schemas

* Validate, project, and diff the class model fields

Concepts and properties now carry deprecation and replacement, and
concepts carry abstract and a definition source:

- A replacement must name another definition of the same kind in the
  same ontology. It is indexed as a REPLACED_BY reference, so deleting
  a replacement target is refused like any other dangling reference.
- An enumeration needs at least two allowed values. One-value
  enumerations stored before this rule stay editable until their values
  change.
- Release projection writes om:abstract, dct:source, owl:deprecated,
  and dct:isReplacedBy, and native import reads them back.
- Release and working diffs classify a member whose deprecated flag
  turned true as DEPRECATED.
- GET /ontologies/{id}/working/diff?groupBy=concept returns the working
  changes grouped by the concept they define, with parent labels and a
  property count, paged by group under its own revision-bound cursor.

* Cover the class model fields in integration tests and record the decision

IndependentOntologyClassModelIT covers the field round trips, the
enumeration minimum and its legacy carve-out, replacedBy integrity, the
DEPRECATED diff row, and grouped diff paging with the 412 cursor rule.
NativeOntologyMemoryIT adds a class-create change set and its rollback.
Existing ITs that stored one-value enumerations now use two values.

* WIP: add abstract, source, and deprecation fields to native classes

Adds the fields to the concept and property schemas, the create
requests, the release payload allowlist, and the RDF catalog vocabulary.
Adds the DEPRECATED change type, the REPLACED_BY reference role, and the
concept-grouped rows of the working diff. Regenerates the TypeScript
types.

* Validate, project, and diff the class model fields

Concepts and properties now carry deprecation and replacement, and
concepts carry abstract and a definition source:

- A replacement must name another definition of the same kind in the
  same ontology. It is indexed as a REPLACED_BY reference, so deleting
  a replacement target is refused like any other dangling reference.
- An enumeration needs at least two allowed values. One-value
  enumerations stored before this rule stay editable until their values
  change.
- Release projection writes om:abstract, dct:source, owl:deprecated,
  and dct:isReplacedBy, and native import reads them back.
- Release and working diffs classify a member whose deprecated flag
  turned true as DEPRECATED.
- GET /ontologies/{id}/working/diff?groupBy=concept returns the working
  changes grouped by the concept they define, with parent labels and a
  property count, paged by group under its own revision-bound cursor.

* Cover the class model fields in integration tests and record the decision

IndependentOntologyClassModelIT covers the field round trips, the
enumeration minimum and its legacy carve-out, replacedBy integrity, the
DEPRECATED diff row, and grouped diff paging with the 412 cursor rule.
NativeOntologyMemoryIT adds a class-create change set and its rollback.
Existing ITs that stored one-value enumerations now use two values.

* Fix class model integration test assertions for wrapped SDK errors and per-operation revisions

* Fixes #35981: Derive concept lifecycle status, ontology publication status and release change summary

* WIP: record that ontology definition status is derived from releases

* Fixes #35981: Derive concept lifecycle status, ontology publication status and release change summary

* WIP: add approvalRule, reviewVotes and the release review read schemas

* Decide ontology release reviews by the ontology's approval rule

An ontology carries an approvalRule, AnyReviewer by default or
AllReviewers. prepareReview freezes the rule into the task's review
target and leaves the requester's and the author's own user entries out
of the assignees. The rule reaches the workflow as the start variable
approvalMode=allAssignees, which CreateTask turns into the task's
approvalThreshold, so the shared counters stay unchanged.

Each counted vote is recorded on the task in reviewVotes with its
comment; the deciding vote is recorded in the decision transaction with
any voter whose record was lost. Reviewers and the approval rule are
locked with 409 while a release of the ontology is in review.

GET /v1/ontologyReleases/{id}/review and
GET /v1/ontologies/reviews?view=assigned|created|pending read a review
from the task's recorded votes.

Amends ADR:2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions
as v13.

* Record votes only for ontology reviews and test the review read model

Only an ontology review reconciles the deciding vote, so recording
counted votes on any other multi-approval task would always leave its
last vote out and add version bumps to glossary approvals. The waiting
branch now records a vote only for an ontology review.

OntologyReleaseReviewReaderTest reads reviews through the reader with
literal tasks and votes. OntologyReleaseRepository.page and offset are
static so the cursor math has a test with literal rows.

* Skip the reference delete for a definition that does not exist yet

* Keep the review task's own reviewers and declare approvalRule in the RDF ontology

The release inherits its reviewers from the ontology, and the entity
updater drops inherited references from a reviewer list, so the task's
REVIEWS rows vanished on the workflow's first stage update.
OntologyReview.eligibleReviewers now returns plain copies.

A counted vote whose record loses every optimistic-locking retry answers
200 with a warning, because the vote already counted in Flowable and the
decision records it.

openmetadata.ttl declares om:approvalRule, which the ontology projection
writes. The ITs unwrap the SDK's wrapped 409 and fetch the task with its
reviewers.

* Fixes #35981: Cover property and ontology edits in the unpublished-changes count, drop restating comments

* Fix review vote durability and authorized pagination

* fix: persist workflow votes with terminal task decisions

* Fixes #35981: Clarify the derived publication status contract

* test: assert ontology review approval rule round trips

* test(ontology): cover property validation and grouped diff cursors

* test(ontology): reject release headers as captured definitions

* Recheck review setup under the lock, list reviews by caller, vote per stage

Starting a review now rechecks the frozen approval rule and the chosen
reviewers against the ontology under the review lock and refuses with
409 when either changed since the request was prepared, so the lock has
no window before the release is In Review.

The review list starts from the caller's own open approval tasks, which
the database narrows to the caller as reviewer, assignee or requester,
instead of scanning every release in review and loading its task.

A reviewer's vote is recorded once per workflow stage, so a task that
moves through several approval stages keeps every stage's vote.

Regenerate the API reference so it lists the two review endpoints.

* Test ontology review votes through TaskWorkflowHandler.resolveTask

A non-final vote leaves the task open and records one vote with its comment.
A repeat voter is recorded once, and a voter keeps one vote in each approval stage.

* Keep release and member ID binds within one parameter budget in definition status queries

The status resolver and the unpublished-change counter chunked only the member IDs and bound every release ID into each chunk. A large page could pass the database bind-parameter limit and fail the list request. Both lists now share one budget and every release and member pair is still queried once.

* Test each ontology review view over stored tasks

List the assigned, pending and created views through listReviews on
MySQL and PostgreSQL, over approval tasks stored the way TaskRepository
stores them: about, the requester and the reviewers live in relationship
rows, not in the task JSON. The test database gains user_entity so the
task's people resolve.

Every view returns no reviews on the current head.

* List ontology reviews with the release each task is about

TaskRepository keeps a task's about out of the stored JSON and clears it
unless the read asks for it. The review list read tasks without about, so
it matched no release and returned no rows in any view.

* Test that the review list never reads the caller's glossary approvals

A steward who reviews glossary approvals and one release review lists
pending reviews, and a requester who created them lists created reviews.
Each gets the one release, and no statement the list runs names a
glossary approval task.

* List only the approval tasks that are about an ontology release

The review list read every open approval task the caller was on,
glossary and data product approvals included, and hydrated each one.
The task filter now also requires a task about an ontology release, and
the list reads the releases of the listed tasks in one query instead of
one query per task.

* Name the tasks in the glossary approval list test

* Keep the review list test from registering a glossary repository

Surefire runs every service test class in one JVM, and a repository
the test registers stays bound to its database after the class ends.
The fixed list never reads a glossary term, so the test now names the
term's type on its reference instead of registering the repository.

* Test that the review list drops a superseded review task

A release can be in review under a new task while the task it was in
review under before is still open. The list must show the release once,
under the current task. No test covered the check in reviewedRelease
that drops the older task, so every test passed without it.

* Test that the review list reads its releases in one statement

The list loads the releases of all listed tasks in one batched read.
The list test now asserts that exactly one statement reads release rows
and that it covers both releases, so a read per task fails it. Resolving
each task's about reads only the names of its release, so the assertion
does not count that lookup.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

Native ontology classes need abstract, source, and deprecation fields

1 participant