Repository navigation
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
mohityadav766
left a comment
There was a problem hiding this comment.
Found a lost-update case in the property patch builders that can delete another editor's additions.
2bd14b7 to
17386aa
Compare
Add the design for glossary term properties. A glossary term declares typed properties and their values in its own JSON. Child terms inherit a property and its value unless the term overrides it. Custom properties and extension do not change. Deleting a property, or turning its inheritance off, removes the values stored for it below the declaring term in the same transaction. A datatype never changes after it is declared. A change to allowed values that would break a stored value, and a move that would leave a value without a property, return 409. Record the decision, and amend ADR:2026-10-17-glossaries-do-not-own-ontology-models to allow term properties as governance metadata, not ontology definitions.
A glossary term declares typed properties (text, number, date, boolean, enum, url) and stores values for them in its own JSON, as propertyDefinitions and propertyValues. Terms below it inherit each property and its value, and can set their own value or an explicit empty one. GET returns the resolved effectiveProperties when fields asks for them, nearest declaring term first. The server checks values against the XSD datatype, keeps names unique across a term's inherited properties, and rejects a datatype change. Deleting a property or turning its inheritance off removes the values below in one set-based statement on MySQL and Postgres. A change to allowed values that would break a stored value, and a move that would leave a value without a property, return 409. A new impact endpoint counts the terms that store a value before such a change. PUT follows the extension rule: an omitted field keeps the stored value, a sent one replaces it, and a bot PUT never removes. Editing needs the new EditGlossaryTermProperties operation, granted by policy rules and implied by EditAll. Approval workflows hold property edits like other term edits. The term page shows a Properties section on the Overview tab with type icons, source badges, overrides and reset. The create form lists the inherited properties, lets the user override them and declare new ones. The terms table gains a Properties column.
- The stale-patch retry takes propertyDefinitions and propertyValues from the fresh copy. The server omits an emptied list, so spreading the fresh copy kept the stale list and the retry failed until the budget ran out. - The header's Add > Property item is gated on the term's deleted state, as the Properties section already was. - The decision record states the client's index-guard protocol and its retry budget of 3. The constant's comment named the server as the rebuilder; the client rebuilds.
Glossaries declare properties that apply to every term in them, and term definitions keep the inheritable switch. Definitions inherit; values do not, so each term shows only its own values. Four generic operations (CreateProperty, EditProperty, DeleteProperty, EditPropertyValues) replace EditGlossaryTermProperties. Adds markdown and entityReference datatypes and required properties enforced on every write. Domain-scoped tiers, provenance and a Settings-based setup are deferred.
…roperty operations
… change A same-session edit replays the term update towards the pre-session version and back. The property purge and required checks ran on every replay, so the replay against the old version removed values below the term, and a child edited twice in a session was checked against a version that predates a newly required property. Only the first pass now checks and purges. The impact endpoint for a term now counts the owning term, which a required value or a deletion also reaches.
A glossary edited twice in one session no longer wipes the term values of a property the first edit added: the glossary updater runs the property checks and purge on the first pass only, as the term updater does, and later passes only record changes, so a property deleted and redeclared in one session is no longer checked against the pre-session version. The property update runs before a rename so it reads the terms under the old name. A patch operation counts as a definition edit by where it writes, so a copy out of a definition into another field needs that field's operation. Reference values are filtered for the term list and search, loaded in one batch per page, and createMany needs CreateProperty for declared definitions. A PUT returning what the caller was shown restores hidden ids in stored order before authorization, a whole-document replace patch keeps them, and a single-valued value the caller sets replaces a hidden one. Empty value lists are not stored, change sets leave properties alone, and deleting a property from the UI no longer sends a value removal.
…ues out of responses A patch of a glossary or term is authorized for its properties by what it changes in them. The repository applies the patch to the stored entity and requires CreateProperty, EditProperty and DeleteProperty for the definitions that differ by name, and EditPropertyValues when the values differ, on top of the operations of the other locations the patch names. propertyDefinitions and propertyValues are registered as fields authorized by change, so their locations map to no operation of their own and a patch that also edits another field needs both sets. REST, MCP and bulk edits share the check, and a glossary or term created with definitions needs CreateProperty in the repository as well. A patch runs on the term as its author was shown it: without the reference values the author may not view, the change descriptions and the effective properties. The repository stores the difference between the stored term and the result, with the ids the author was not shown back where they are stored. An index, a test and a copy then mean what the author saw, a value that is not a list is a 400, and returning the shown values changes nothing. This replaces the rewriting of each patch operation. Change descriptions and stored versions name only the reference values the caller may view, on get, list, search, PATCH and PUT responses, the version endpoints and the MCP entity tools. A term that deletes its own property records the value it loses.
…, edit and export as before A term with no definitions, values or properties in scope now reads with no effectiveProperties instead of an empty list, so a client that never uses properties sees the same shape as before the feature.
…umn and the response fixes
…t operations in the trim test
…es column and the Data Steward role end to end
…ary that show no properties
…rule the shipped role has
…ame import creates
…nel text and fill an inherited property
…lues, derive the properties column
… its delete test The delete response now passes through the view filter, which reads the resource's entity class. The static Entity mock returned null for it.
…hout properties The UI wrote the first definition or value as the whole propertyDefinitions list or propertyValues map. JSON Patch add replaces an existing member, so a second editor working from the same empty copy erased the first editor's property or value, and no test operation caught it. The server now patches an absent property container as empty, and the UI always appends a definition or sets a single value key.
…ole document A patch at the root, or with no string path, writes the custom property values too, so it now also needs ViewCustomFields (ADR:2026-12-03-custom-property-values-need-view-custom-fields). Locations that only resemble a property field still need EditAll alone.
The rebase onto main kept default-value and reset-to-inherited-value in de-de.json after the branch had removed them from en-us; yarn i18n removes them.
17386aa to
232f8af
Compare
…anize-imports does
…ld term label The term page's Add menu names the item "Child term" with a description line since the property UI, not "Glossary Term".
Code Review ✅ Approved 🔴 High risk 3 closed / 3 findingsGlossary property deletion and inheritance changes purge descendant values, risking stored-data integrity by erasing metadata across a term subtree. Adds typed properties to glossary terms, with values inherited by descendant terms and a dedicated ✅ 3 closed✅ Bug: Stale-patch retry keeps old fields when fresh copy omits them
✅ Quality: Client retry budget and index-guard protocol are not recorded
✅ Quality: Header permission flags ignore
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
Describe your changes:
Fixes #37818
A glossary term can now declare typed properties (text, number, date, boolean, enum, url) and store values for them in its own JSON. Terms below it inherit each property and its value, and can set their own value or an explicit empty one. Custom properties and
extensiondo not change: they extend the glossaryTerm type for every term, while these properties belong to one term and its subtree.The branch has two commits:
docs(glossary): design glossary term propertiesadds the design doc, the decision record ADR:2026-11-12-glossary-terms-declare-their-own-properties-and-values, and a v2 amendment of ADR:2026-10-17-glossaries-do-not-own-ontology-models. Term properties are governance metadata, not ontology definitions, so the retiredattributesfields stay retired.feat(glossary): add properties to glossary termsadds the schema, the server rules, the permission, the UI and the tests.Type of change:
High-level design:
Design doc:
docs/plans/2026-11-12-glossary-term-properties.md(8 diagrams, backward compatibility and the delete and move cases).Model.
glossaryTermgainspropertyDefinitions(at most 50 per term),propertyValues(Map<String, List<String>>of lexical strings, where[]means "no value here") andeffectiveProperties, which is computed on read and never stored. It is returned only whenfieldsnames it. A term's effective properties are its own definitions, then the inheritable definitions of its ancestors, nearest first. Each carriesdeclaredBy,inherited,valuesandvaluesFrom. A page of terms loads all their ancestors in one query.Rules (in the pure classes under
service/glossary/):multiValued, returns 409 and names up to 20 terms.fqnHashprefix (MySQLJSON_REMOVE, Postgres#-), soft-deleted terms included, with no version bump on the descendants.moveAsyncor CSV that would leave a value without its property returns 409 before anything changes.GET /v1/glossaryTerms/{id}/propertyDefinitions/{name}/impactcounts the terms that store a value, with a sample of 20, so the UI can warn before a delete.PUT follows the
extensionrule: an omitted field keeps the stored value, a sent value replaces it, and a bot PUT merges and never removes. The schemas use"default": nullso an omitted field stays null in Java.Permissions. A new
EditGlossaryTermPropertiesoperation covers both fields throughmapEntityFieldOperation. It is granted by policy rules, implied byEditAll, and an explicit deny beatsEditAll. No default role gets it, so no migration. Approval workflows hold property edits, because both fields are inworkflowTriggerFields.json.Not projected. The search index and the glossary RDF projection leave the three fields out, per ADR:2026-10-17.
UI. The Overview tab gets a Properties section above Synonyms: type icon, value, a source badge ("Defined here", "↳ declaring term", "Overridden here") and actions to edit, reset an override or delete with an impact count. The Add property dialog picks the type from icon cards and locks it after creation. The create-term form lists the inherited properties, lets the user override their values and declare new ones. The terms table gets a Properties column, and the header Add menu gets a Property item.
Backward compatibility. All fields are optional and new. Existing terms, clients and the CSV format are unchanged. A PUT from an older client that omits the fields keeps them.
Alternatives rejected (recorded in the ADR): reusing custom properties or
entity_extension, a separate critical-data-element entity, a glossary-level property set, and custom properties scoped to terms.Tests:
Use cases covered
declaredByandvaluesFrom.[], and the grandchild inherits the override.multiValuedand an invalid move return 409.EditGlossaryTermProperties(allowed, butdisplayName403),EditAll(allowed), an explicit deny overEditAll(403 for properties only), no view access (403 on the impact endpoint).fields=effectivePropertiesruns the same number of SQL statements.Unit tests
GlossaryTermPropertyValuesTest,GlossaryTermPropertyResolverTest,GlossaryTermPropertyRulesTest,GlossaryTermPropertyChangeTest(77 tests withGlossaryModelBoundaryTest, all pass after merging main).GlossaryTermPropertiescomponents, the utils,useGlossaryTermPropertyPatchand the changed glossary components (44 suites, 543 tests pass after merging main).Backend integration tests
GlossaryTermPropertiesIT,GlossaryTermPropertiesAccessIT,GlossaryTermPropertiesApprovalIT(@Isolated), with fixtures inGlossaryTermPropertyFixtures. Impact-map entries added.Before merging main:
GlossaryTermProperties*IT42 tests, 0 failures on-Pmysql-elasticsearchand 42 tests, 0 failures on-Ppostgres-opensearch.After merging main: the backend builds and the 77 unit tests pass. The integration tests were not rerun after the merge, because the local Docker engine is not compatible with Testcontainers. The merge-queue run covers them.
Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Pages/GlossaryTermProperties.spec.ts: add, edit, override, reset and delete on the term page; the create form with an inherited override and a new property; keyboard type selection; a user with onlyEditGlossaryTermPropertiesversus a view-only user.13 passed, chromium, against a local MySQL + Elasticsearch stack built from this branch before the merge of main (an earlier run passed 11/11 twice with
--repeat-each=2).Manual testing performed
UI screen recording:
Pending. This PR stays a draft until the recording is uploaded.
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.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: I updated the migration scripts or explained why it is not needed. No migration: every new field is optional, and the new operation is in no default role.
For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Decision check: ADR:2026-11-12-glossary-terms-declare-their-own-properties-and-values records the model, the limits and the PUT and permission rules.
The issue properly describes why the new feature is needed, what's the goal, and how we are building it.
I have updated the documentation.
I have added tests around the new logic.