Repository navigation
Fixes #35983: Decide ontology release reviews by an Any or All reviewer rule - #35990
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! |
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
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.
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.
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.
Code Review ✅ Approved 4 closed / 4 findings🔴 High risk · Changing ontology release approval rules and vote persistence could finalize releases without required approvals or lose reviewer decision history. Adds AnyReviewer and AllReviewers rules for ontology release reviews, with each counted vote retained on the approval task and reviewer/rule settings locked while a release is in review. Approved: the approval-rule contract conflict with the ontology review ADR, the persisted reviewVotes and review read API mismatch, and the review list loading only up to 1000 tasks per request have been resolved, and no open findings remain. ✅ 4 closed✅ Quality: Approval-rule contract conflicts with the ontology review ADR
✅ Quality: Persisted reviewVotes and review read API contradict the review ADR
✅ Performance: Review list loads up to 1000 tasks per request and drops the rest
Closed: Bug: Review list cursors are raw numbers but decoded as Base64
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 |
|
|
…er rule (#35990) * 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. * Update generated TypeScript types and dereferenced schemas * 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. * Fix review vote durability and authorized pagination * fix: persist workflow votes with terminal task decisions * 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. * 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 #35983
Ontology release reviews use an AnyReviewer or AllReviewers rule and retain each counted vote. Reviewer membership and the rule stay locked while a release is in review. Shared task resolution records a terminal decision with its lifecycle event.
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
main. Its child is PR2 #35994. PR9, PR11, PR13, PR14 and PR16 are not published yet.Current assessment for
964b3b79a7d, recorded 2026-10-29.Verdict. PASS. The last independent review passed fix-forward 2 at
64f21ccb66e, after the review-bot round and fix-forward 1. This head is the merge ofmainca9b8c04a93into that commit. The merge had no conflict and needed no adaptation. PR1's patch-id stays37a63b547b5over 55 files, so the verdict carries to this head. The reviews declared two minor issues that do not block. The regenerateddocs/generated/api-reference.mdlists the event-subscription capabilities endpoint without its/capabilitiessuffix, because the generator reads only literal@Pathstrings. The superseded-task case inOntologyReleaseReviewListTestdoes not assert theCREATEDview.Test evidence at this head. The gates ran on the staged tree, which is the commit's tree
97e9551a74a. Package andspotless:checkpassed. 315 unit tests in 23 classes passed, PR1's own and every test that namesTaskRepositoryorTaskResource.OntologyReleaseReviewListTestpassed 6 of 6 on local MySQL and PostgreSQL.OntologyEntityDAOTestandOntologyReleaseDAOTeststop on the missing Docker socket. TypeScript 7.0.2 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,
maven-collate-ciincluded.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.TaskResourceITfirst.mainFixes #36393: Sort the task list newest or oldest first, and merge a user's tasks in that order #36439 and PR1 both changeTaskRepository.javaandTaskResource.java, so then runTaskChangeEventIT,TaskPermissionsIT,WorkflowTaskAssigneesIT,LifecycleMetadataTasksIT,DataAccessRequestValidationIT,FeedAccessAuthzIT,ChangeSummaryResourceIT,DomainIsolationIT,GlossaryTermAutomationDraftIT,ContextMemoryConflictReviewIT,IndependentOntologyReviewRuleITandIndependentOntologyReviewRecoveryIT.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.OntologyReleaseReviewListTestunder Testcontainers onmysql:8.0andpostgres:15, and the container-backed classesOntologyEntityDAOTestandOntologyReleaseDAOTest.AI mode.
main's Ontology Studio AI-mode restyle #36433 now gates new screens on AI mode. PR1 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 #35983
Ontology release reviews now support
AnyReviewer(the default) andAllReviewers. With two user reviewers underAllReviewers, the first approval keeps the releaseIn Review; the second approves it. A team is one assignee entry, covered by any eligible member. Each counted vote retains its voter, covered entry, decision, original comment, and timestamp. This also updates shared task resolution to commit terminal votes with its single lifecycle event and amends ADR:2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions.Reviewers and the approval rule are locked with HTTP 409 while a release is in review. Cancel the review, change the configuration, and submit a new review to replace them. Two read endpoints expose the frozen rule, assignee statuses and votes, final reason, and caller voting permissions:
GET /v1/ontologyReleases/{id}/reviewandGET /v1/ontologies/reviews?view=assigned|created|pending.Type of change:
High-level design:
The existing RequestApproval workflow remains responsible for decisions.
OntologyApprovalWorkflowpassesapprovalMode=allAssignees;CreateTaskraises the existing node threshold to the assignee-entry count. Other workflows retain their thresholds. The existing restriction to one team or several users remains; requester and author user entries cannot contribute votes.The shared multi-approval handler stores typed vote details in the same Flowable command that counts a vote. Waiting and nonterminal task updates project that durable record into
reviewVotes. Terminal generic decisions merge the counted votes into the existing lifecycle write; terminal ontology decisions consume the same record during reconciliation and recovery. Earlier stage votes remain intact. This preserves earlier comments when the final vote overtakes a delayed task-row write. The field is namedreviewVotesbecausevotesalready represents entity ratings. Client PATCH cannot modify it. No vote table or decision endpoint is added.Both read endpoints use the same review builder. List scans use bounded keyset pages and follow them to completion, then apply release VIEW authorization and the selected view before counting or returning rows. The reviewer/rule lock uses the existing ontology state lock.
The decision record records these choices. No migration is required: generated models default absent
approvalRuletoAnyReviewer, andreviewVotesis optional. Java and TypeScript models were regenerated. Issues #35992 (repeat team-member vote returns 200) and #35993 (candidate-link removal) remain separate.Tests:
Use cases covered
Unit tests
At
4df6f6c9eae, the native Java 21 run passes 1,036 tests in 59 fixture-free classes, with no failures, errors or skips. This includes the earlier focused 118 cases; all integration-test sources also compile. Four remaining fixture-backed classes in the 63-class affected selection await the coordinated local fixture window. Fresh whole-class JaCoCo data is below the required 90% on shared repositories, resources and workflow classes; the instrumented native integration selection exercises those real paths. The coverage gate remains open and no waiver is claimed.Backend integration tests
Final native results pending for MySQL/Elasticsearch and PostgreSQL/OpenSearch. The instrumented parallel selection covers task events, resource operations, permissions, comments, assignee fallback and metadata lifecycle; ontology approvals, recovery, publication, review rules, releases, activation, CRUD, references, working and frozen diffs, exports; and
ConceptContextIT. The fullWorkflowDefinitionResourceITruns in the separate global-state lane. These are existing observable API scenarios, plus the new task-event regressions.The impact planner selects the full merge-queue suite because the new shared type schema is owned by the core area. At
4df6f6c9eae, all three complete profiles pass: MySQL/Elasticsearch, PostgreSQL/OpenSearch, and PostgreSQL/Elasticsearch/Redis. Each executes all nine task-event cases, twelve review-rule cases, eleven review-recovery cases, and 120 workflow-definition cases without failure or skip. The following commit,a49d4a746db, changes only the Python model test described below; its production source is identical. Fresh exact-head full profiles are running: MySQL/Elasticsearch, PostgreSQL/OpenSearch, and PostgreSQL/Elasticsearch/Redis.Ingestion integration tests
No ingestion implementation changes. Current Python CI exposed a stale review-target payload expectation after the schema added the default approval rule. The focused correction retains the exact payload and required history-coordinate assertions, and covers omitted,
AnyReviewer, andAllReviewersrules. All 23 ontology model tests pass with freshly generated Python models in an isolated native Python 3.12 environment; Ruff checks and commit hooks pass. Ata49d4a746db, Python 3.11 and 3.12 unit/static CI jobs pass; Python 3.10 is still running in run 40025407984.Playwright (UI) tests
Not applicable; only generated TypeScript types changed, with no UI behavior changes.
Manual testing performed
The rebuilt
4df6f6c9eaeartifact reports the exact revision, its service JAR hash matches the build, all four private services use the isolated network, and health is 200. The only subsequent change ata49d4a746dbis a Python test, so the artifact still represents the current production source. Fresh generic description-update and ontology approval comparisons each record one task update event on pinned trunk92748648bf2and on the artifact. Additional generic and ontology rejection comparisons also pass with one event. The artifact's event, current task and historical task version carry the same vote and original comment.All ten ontology API scenarios pass, including ten concurrent-vote races with two votes, both original comments, one approved release event and one final task state. A returned list cursor also loads the distinct second page. The private
om-pr1stack retains its database data.The required five performance trials of fifty fresh reviews remain pending. No acceptance latency claim is made while the shared host is heavily loaded.
UI screen recording:
Not applicable; backend and schema change.
Checklist:
REVIEW.md.

Confidence Score: 5/5
No additional merge-blocking issues were established beyond the existing review threads.Summary
Adds
AnyReviewerandAllReviewersrules for ontology release reviews.No new findings were accepted. The supplied previous threads have no Comment numbers, so
previousFindingsis empty; those threads remain separate review context. The previous-review merge bases differed, so this review used the full PR diff.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Request release review] --> B[Freeze rule and eligible reviewers] B --> C[Lock ontology and recheck settings] C --> D[Start approval workflow] D --> E[Count and save reviewer vote] E --> F{Rule satisfied or rejection?} F -->|No| G[Keep review open] G --> E F -->|Yes| H[Save final task decision and votes] H --> I[Update release and record event]Reviews (13) · Last reviewed commit: "Merge main into ontology review rule" · Reviewed by Greptile