Repository navigation
Conversation
✅ 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
…anges count, drop restating comments
This comment has been minimized.
This comment has been minimized.
…ition 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.
Code Review ✅ Approved 4 closed / 4 findings🟡 Medium risk · Deriving ontology approval/publication status and change counts from release membership could misreport which definitions are approved or still unpublished. 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 |
|
|



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
20e50e5e265, recorded 2026-10-28.Verdict. The independent review of the review-bot round passed at
20e50e5e265, this head, with no findings. The ledger records its base as PR1eaf87167807and its stable patch-id asbf0177fe84b. No carry is needed.Test evidence at this head. The reviewer ran 24 tests in
OntologyReleaseMemberQueryTestandOntologyDefinitionStatusResolverTest, with no failures. The storage testsOntologyConceptStatusStorageTestandOntologyDerivedStatusStorageTestneed a database and were not rerun by the reviewer.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.ListFilter.java(area core). Run firstIndependentOntology*IT,Ontology*ResourceIT,TaskResourceIT,TaskChangeEventIT, andWorkflowDefinitionResourceITin the global-state lane.OntologyConceptStatusStorageTestandOntologyDerivedStatusStorageTest.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