Skip to content

Fixes #35983: Decide ontology release reviews by an Any or All reviewer rule - #35990

Merged
harshach merged 22 commits into
mainfrom
harshach/ontology-studio/01-review-rule
Oct 29, 2026
Merged

harshach merged 22 commits into
mainfrom
harshach/ontology-studio/01-review-rule

Conversation

@harshach

@harshach harshach commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

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 of main ca9b8c04a93 into that commit. The merge had no conflict and needed no adaptation. PR1's patch-id stays 37a63b547b5 over 55 files, so the verdict carries to this head. The reviews declared two minor issues that do not block. The regenerated docs/generated/api-reference.md lists the event-subscription capabilities endpoint without its /capabilities suffix, because the generator reads only literal @Path strings. The superseded-task case in OntologyReleaseReviewListTest does not assert the CREATED view.

Test evidence at this head. The gates ran on the staged tree, which is the commit's tree 97e9551a74a. Package and spotless:check passed. 315 unit tests in 23 classes passed, PR1's own and every test that names TaskRepository or TaskResource. OntologyReleaseReviewListTest passed 6 of 6 on local MySQL and PostgreSQL. OntologyEntityDAOTest and OntologyReleaseDAOTest stop 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-ci included.

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 first. main Fixes #36393: Sort the task list newest or oldest first, and merge a user's tasks in that order #36439 and PR1 both change TaskRepository.java and TaskResource.java, so then run TaskChangeEventIT, TaskPermissionsIT, WorkflowTaskAssigneesIT, LifecycleMetadataTasksIT, DataAccessRequestValidationIT, FeedAccessAuthzIT, ChangeSummaryResourceIT, DomainIsolationIT, GlossaryTermAutomationDraftIT, ContextMemoryConflictReviewIT, IndependentOntologyReviewRuleIT and IndependentOntologyReviewRecoveryIT.
  • 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.
  • OntologyReleaseReviewListTest under Testcontainers on mysql:8.0 and postgres:15, and the container-backed classes OntologyEntityDAOTest and OntologyReleaseDAOTest.
  • 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. 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) and AllReviewers. With two user reviewers under AllReviewers, the first approval keeps the release In 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}/review and GET /v1/ontologies/reviews?view=assigned|created|pending.

Type of change:

  • New feature

High-level design:

The existing RequestApproval workflow remains responsible for decisions. OntologyApprovalWorkflow passes approvalMode=allAssignees; CreateTask raises 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 named reviewVotes because votes already 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 approvalRule to AnyReviewer, and reviewVotes is 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

  • Any/all rules with users and a team; requester exclusion; mixed team/user rejection; reviewer/rule lock and unlock.
  • Both original comments and the final rejection reason; repeated voters; protected vote history; pending/created views and denied release access.
  • A review beyond 1,000 newer rows; invalid and maximum cursors; keyset ties on both database engines.
  • A deterministic delayed task-write race, durable votes after workflow-engine restart, and the existing generic threshold-two workflow.
  • One final task event for generic and ontology approvals and rejections, with the original durable timestamp and comment in the event, current task and task version; earlier stage votes remain after a later decision.

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 full WorkflowDefinitionResourceIT runs 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, and AllReviewers rules. 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. At a49d4a746db, 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 4df6f6c9eae artifact 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 at a49d4a746db is 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 trunk 92748648bf2 and 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-pr1 stack 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:

  • Linked issue describes the problem and desired behavior.
  • Added behavior tests for the new logic and endpoints.
  • Schema compatibility and migration requirements are described above.
  • Durable decisions are documented in the amended ADR.
  • Impact-map ownership checked; existing globs own the changed files.
  • Final checks and self-proof are complete.
  • Final diff reviewed against REVIEW.md.

RetriggerView in GreptileConfidence Score: 5/5

No additional merge-blocking issues were established beyond the existing review threads.

Summary

Adds AnyReviewer and AllReviewers rules for ontology release reviews.

  • Ontology reviews can wait for every reviewer entry to approve.
  • Approval tasks retain each counted vote with its decision details.
  • Reviewers can see a release review and their open reviews.

No new findings were accepted. The supplied previous threads have no Comment numbers, so previousFindings is 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]
Loading

Reviews (13) · Last reviewed commit: "Merge main into ontology review rule" · Reviewed by Greptile

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.
@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

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

@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.14% (132404/165197) 66.74% (46890/70257) 69.79% (26589/38098)

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.
@harshach
harshach requested a review from a team as a code owner October 23, 2026 01:12
@harshach
harshach requested a review from TeddyCr October 23, 2026 01:12
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.
Comment thread docs/generated/api-reference.md Resolved
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.
@gitar-bot

gitar-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown
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

📄 openmetadata-spec/src/main/resources/json/schema/type/ontologyApprovalRule.json:5 📄 openmetadata-spec/src/main/resources/json/schema/type/ontologyApprovalRule.json:8 📄 openmetadata-spec/src/main/resources/json/schema/type/ontologyApprovalRule.json:17
This schema adds a cross-component contract: the enum values AnyReviewer/AllReviewers, which Java, Pydantic and the committed TS types will all share. It also picks AnyReviewer as the default, which is a judgment call. No record in docs/decisions/ covers either one. The accepted ADR 2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions.md (lines 20-21) says the opposite: "Runtime assignments, vote thresholds and approval steps remain in Flowable; no ontology vote table or decision endpoint is added." The PR description goes further, with an ontology-owned threshold frozen into the task, per-vote records on the task, and two new read endpoints. The amendment needs to state roughly this: "An ontology's approvalRule sets a release review's approval threshold: AnyReviewer (the default) decides on the first approval; AllReviewers waits for every reviewer entry, where a team counts once and any member covers it. The rule is frozen into the review task when the review is requested, and reviewers and the rule cannot be changed (409) while a release is in review." It also needs to revise the line-20 sentence about thresholds staying in Flowable. Add that amendment in this PR together with the schema, rather than in a later push, because the repo squash-merges and the description never reaches git log.

✅ Quality: Persisted reviewVotes and review read API contradict the review ADR

📄 openmetadata-spec/src/main/resources/json/schema/entity/tasks/task.json:191-205 📄 openmetadata-spec/src/main/resources/json/schema/entity/tasks/task.json:507-513 📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyReleaseReview.json:1-15 📄 openmetadata-spec/src/main/resources/json/schema/api/data/ontologyReleaseReviewList.json:1-15
This commit adds a second decision that the open approval-rule finding does not cover. task.reviewVotes/taskReviewVote stores every counted vote on the task entity, and OntologyReleaseReview/OntologyReleaseReviewList define a per-caller review read contract with callerCanVote and callerCompletesRule. The accepted record 2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions.md says the opposite: "Runtime assignments, vote thresholds and approval steps remain in Flowable; no ontology vote table or decision endpoint is added", and the only persisted decision artifact it allows is the receipt written in the Flowable transaction. Two things are now undecided: whether reviewVotes or Flowable is authoritative when they disagree, for example after the PROCESS_FAILED recovery path or a retried engine command, and whether the new endpoints break the 'no decision endpoint' rule.

The amended record should say something like: "Each counted vote is mirrored into the server-managed task.reviewVotes (one per voter, including the deciding vote) in the same transaction as the decision receipt; Flowable remains authoritative and reviewVotes is a read projection. Two read-only endpoints serve OntologyReleaseReview per assignee; they never decide a review." This comes from the PR description's "Each counted vote is recorded on the task … and two read endpoints serve the per-assignee review state." The record also needs to say who writes reviewVotes and when, so that clients cannot set it through create or patch.

✅ Performance: Review list loads up to 1000 tasks per request and drops the rest

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/OntologyReleaseRepository.java:41 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/OntologyReleaseRepository.java:235-249 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/OntologyReleaseRepository.java:269-280 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/OntologyReleaseDAO.java:49-52 📄 openmetadata-service/src/main/java/org/openmetadata/service/ontology/OntologyReleaseReviewReader.java:59-61
Every call to GET /v1/ontologies/reviews reads up to OPEN_REVIEW_SCAN_LIMIT = 1000 IN_REVIEW releases from every ontology. For each release, reader() does a separate tasks.get(...) with relationship hydration plus a SubjectContext.getSubjectContext(caller) lookup, and only then filters by caller and pages in memory. That is up to about 1000 task loads per page request. listAllByStatus also filters on entityStatus with no ontologyId, so the only index (ontologyId, entityStatus) can't be used. Beyond 1000 open reviews, older ones silently disappear from every view, and total is wrong. The 1000 cap is a judgment call, and the v13 ADR amendment doesn't mention it. Either push the assignee/creator filter into SQL (task relationships) and page there, or record the cap and its truncation behaviour in the decision record. At minimum, resolve the caller's SubjectContext once per request and load the tasks in bulk.

Closed: Bug: Review list cursors are raw numbers but decoded as Base64

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/OntologyReleaseRepository.java:252-266
listReviews returns after/before as plain String.valueOf(to) (for example "25"), but offset() runs RestUtil.decodeCursor, which Base64-URL-decodes its input. Decoding "25" gives the single byte 0xDB. That is not valid UTF-8, so Integer.parseInt throws NumberFormatException and the request fails with 400 "The review list cursor is invalid". As a result, any client that follows paging.after (the IT's listed() helper does) can never load a second page. Wrap both cursors with RestUtil.encodeCursor, as OntologyReleaseComparison already does.

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 5f2b733 into main Oct 29, 2026
76 checks passed
@harshach
harshach deleted the harshach/ontology-studio/01-review-rule branch October 29, 2026 18:58
manerow pushed a commit that referenced this pull request Oct 30, 2026
…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>
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.

Decide ontology release reviews by an Any or All reviewer rule through the existing approval workflow

1 participant