fix(glossary): reject field edits to system-defined relation types via generic settings PUT - #31865
fix(glossary): reject field edits to system-defined relation types via generic settings PUT#31865sonika-shah wants to merge 2 commits into
Conversation
…a generic settings PUT
System-defined glossary relation types are meant to be immutable. The UI
and the dedicated relationTypes/{name} endpoint enforce this, but the
generic PUT /v1/system/settings path only blocked removing them and
duplicate names - it allowed editing their fields (e.g. isTransitive).
Extend validateSystemDefinedRelationTypesPreserved to also reject
modifications to system-defined types (normalized field comparison),
leaving custom relation types fully editable.
❌ 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 |
✅ Playwright Results — workflow succeededValidated commit ✅ 553 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 47m 31s ⏱️ Max setup 4m 5s · max shard execution 15m 35s · max shard-job elapsed before upload 18m 51s · reporting 3s 🌐 215.60 requests/attempt · 2.83 app boots/UI scenario · 17.86% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…pes via settings PUT Also reject settings updates that flag a new or existing custom relation type as isSystemDefined=true. system-defined is a seeded, immutable classification (the dedicated relationTypes endpoint force-sets it to false); only already-seeded names may carry the flag.
Code Review ✅ ApprovedExtends glossary term relation settings validation to block field modifications on system-defined types via the generic PUT endpoint. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes
Fixes #31864.
System-defined glossary relation types (
relatedTo,partOf,hasPart, …;isSystemDefined: true) are a seeded, immutable classification. The UI (edit/delete disabled) and the dedicatedPUT /v1/system/settings/glossaryTermRelationSettings/relationTypes/{name}endpoint (which force-setsisSystemDefined=falseon create and rejects updates) enforce this — but the genericPUT /v1/system/settingspath did not fully. This closes the remaining gaps on that path by extendingGlossaryTermRelationSettingsUtil.validateSystemDefinedRelationTypesPreserved(already invoked viavalidateGlossaryTermRelationSettingsUpdate).Behavior after this change
partOf.isTransitive, color, category)isSystemDefinedt→f) a system-defined typeisSystemDefined: trueisSystemDefined: trueTwo guards are added:
isSystemDefined: truewhose name isn't already a seeded system-defined name is rejected ("Cannot create or promote system-defined relation types: <names>")."Cannot modify system-defined relation types: <names>"); compared on normalized copies so derivedsourceMax/targetMaxdon't false-positive.Type of change
How was this change tested?
TDD (RED→GREEN) unit tests in
GlossaryTermRelationSettingsUtilTest:isSystemDefined:truetypeTests run: 9, Failures: 0, Errors: 0(mvn -pl openmetadata-service -Dtest=GlossaryTermRelationSettingsUtilTest test).Checklist
Greptile Summary
The PR strengthens glossary relation settings validation so generic settings updates cannot modify, create, or promote system-defined relation types.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(glossary): block creating or promoti..." | Re-trigger Greptile