Repository navigation
Fixes #35981: Derive ontology definition and publication status from releases - #35994
Conversation
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.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…tatus and release change summary
…tatus and release change summary
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.
…anges count, drop restating comments
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.
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.
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.
Code Review ✅ Approved 4 closed / 4 findings🟡 Medium risk · Deriving ontology approval and publication status from release membership could mislabel concepts or unpublished changes, misleading users about what is approved or live. Derives concept ✅ 4 closed✅ Edge Case: "Matches its member" is undefined, so status can contradict the diff
✅ Edge Case: unpublishedChanges counts a paged working diff, so it caps at a page
✅ Quality: publicationStatus shape is stated only in the PR description
✅ Performance: Review list does a full scan with per-release task reads on every page
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|
…releases (#35994) * 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 * Update generated TypeScript types and dereferenced schemas * 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. * 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 * 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>



Fixes #35981
Concept lifecycle status and ontology publication status are derived from captured releases. The API returns those read-only fields and records a release change summary without adding another stored lifecycle.
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 PR1 #35990. Its child is PR3 #35997. PR9, PR11, PR13, PR14 and PR16 are not published yet.
Current assessment for
d63d5123479, recorded 2026-10-29.Verdict. PASS. The independent review of the review-bot round passed at
20e50e5e265with no findings. This head merges PR1964b3b79a7d, which carries the merge ofmainca9b8c04a93. The merge had no conflict. PR2's patch-id staysbf0177fe84bover 43 files, so the verdict carries to this head. No minor issue is declared.Test evidence at this head. The gates ran on the staged tree, which is the commit's tree
dc3130b8843. Package andspotlesspassed, and 299 unit tests in 21 classes passed.OntologyConceptStatusStorageTestandOntologyDerivedStatusStorageTeststop on the missing Docker socket. TypeScript reports 0 errors against a core-components build of the merged tree. The i18n check, the Java impact map and the Playwright map 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/01-review-rule). 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 ismain, passes it.Still owed. Docker is down on the build machine, so none of these has run. Run each IT on
-Pmysql-elasticsearchand then-Ppostgres-opensearch, and confirm aTests run:line.TaskResourceITand the task ITs listed on PR1, which this head carries.IndependentOntologyApprovalIT,IndependentOntologyPublicationITandIndependentOntologyReleaseIT, andWorkflowDefinitionResourceITin the global-state lane.mainbrings 184 Java files, the 2.1.0 migrations and schema changes, so the planner selects the full suite.OntologyConceptStatusStorageTestandOntologyDerivedStatusStorageTest.AI mode.
main's Ontology Studio AI-mode restyle #36433 now gates new screens on AI mode. PR2 changes only generated TypeScript types in the UI, so AI mode lacks none of its 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 #35981
This PR adds a decision record,
docs/decisions/2026-10-21-ontology-definition-status-is-derived-from-releases.md. It states that definition status is computed from releases and never stored, so it adds no second lifecycle next to the release review (ADR:2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions).Ontology Studio needs a status pill per concept and a publication summary per ontology. Without a server-side source, the UI would invent a lifecycle that can disagree with the releases that hold the concepts.
What changed:
GET/list /v1/ontologyConcepts?fields=lifecycleStatusreturnsDraft,InRevieworApproved. A concept isApprovedwhen it matches its member in the active or the latest approved release,InReviewwhen it matches its member in the release under review, andDraftotherwise.GET/list /v1/ontologies?fields=publicationStatusreturns the active release (revision, semantic version, activation time), the latest release and its stage (Draft,InReview,ChangesRequested,Approved,Published), andunpublishedChanges, the row count of the ontology's working diff.changeSummary(added,changed,removed) against the release that was active at capture. Older releases have none.ViewBasic, so a basic viewer can list concepts with the pill. They expose membership and a count, never member content.Deviation from the plan: a concept matches a member by governed content, with an equal entity version as a shortcut, not by version equality alone. Owner edits and an edit that is reverted move the version without changing content, and the working diff does not list them. Version equality alone would show
DraftwhileunpublishedChangessays 0. A moved version costs one payload read for those pairs. The ADR records this. The change summary type isOntologyReleaseChangeSummarybecauseChangeSummaryalready exists intype/change.Query cost: a concept page runs the release-role query, one member-version query and at most one member-payload query, whatever its size. An ontology page runs a constant number of queries (state, roles, four working-version queries, member versions, and payload reads only for definitions whose version moved).
Leaves out: properties and axioms have no
lifecycleStatus. No UI. No migration, since every statement uses an existing index.Type of change:
High-level design:
OntologyDefinitionStatusResolverholds the status table and the batched page read.OntologyPublicationStatusResolverholds the stage table.OntologyReleaseRolesfinds the active, latest, latest approved and in-review release per ontology in one window-function query that runs on MySQL 8 and PostgreSQL.OntologyUnpublishedChangescounts working-diff rows from(id, version)pairs and digests content only where versions differ, through the sameOntologyReleaseComparison.sameContentthe diffs use. Activation time comes from the ACTIVATED event whoseactivationRevisionequals the state's, becausefindActivationreturns the earliest event and is wrong after a rollback.Tests:
Use cases covered
Approved(payload fallback). An edit to an approved concept turns only that conceptDraft.unpublishedChangesequals the rows of the working diff, andchangeSummaryequals the release diff against its base.lifecycleStatusis never stored or versioned, and a PATCH that sets it returns 400.Unit tests
mvn test -pl openmetadata-service -Dtest='OntologyDefinitionStatusResolverTest,OntologyDerivedStatusStorageTest,OntologyConceptStatusStorageTest,RdfOntologyContractTest,OntologyReleaseCaptureTest': 53 tests, the storage tests on real MySQL 8 and PostgreSQL 15 containers. All passed before the rebase. After the rebase I re-ranOntologyDefinitionStatusResolverTest(21 passed).Backend integration tests
IndependentOntologyStatusIT, 7 tests, passed on-Pmysql-elasticsearchand on-Ppostgres-opensearch.Ran with the lane
parallel: IndependentOntologyStatusIT, IndependentOntologyReleaseIT, IndependentOntologyWorkingDiffIT, IndependentOntologyActivationIT, OntologyConceptResourceIT, OntologyResourceIT.plan_local_java_tests.py --check-branchreports the impact map complete. The full*Ontology*ITarea was not run.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording:
Not applicable. This is backend-only work with no UI change.
Summary by Gitar
lifecycleStatuson concepts andpublicationStatuson ontologies, computed from releaseschangeSummarywith added, changed and removed countsunpublishedChangescounts working diff rows using batched membership and content readslistReviewsendpoint andOntologyReleaseReviewReaderto list open release reviews per callerTaskReviewVotesand the workflow handlerOntologyApprovalRule(AnyReviewer or AllReviewers) frozen into review tasksThis will update automatically on new commits.


Confidence Score: 5/5
The reviewed changes appear safe to merge; the previous large-page query failure is fixed.Summary
This PR derives concept and ontology statuses from captured releases and stores change counts when a release is captured.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Requested status fields] --> B[Read release roles] B --> C[Read member versions in bounded chunks] C --> D{Versions match?} D -->|Yes| E[Use release membership] D -->|No| F[Read payloads in bounded chunks] F --> G[Compare governed content] E --> H[Return derived status] G --> HReviews (7) · Last reviewed commit: "Keep release and member ID binds within ..." · Reviewed by Greptile