Repository navigation
Conversation
…scriptive edit (#38329) * Change request preview reports the ops of an edit no workflow gates POST /v1/changeRequests/preview returned ops only when an approval workflow would hold the edit. It now also returns them for an edit no workflow holds, computed by MutationPlanner from the same prepared entity, so a client can show what a PATCH of descriptive metadata (description, display name, tags, owners, domains, columns and similar) would change before sending it. An ungated edit to any other field still gets no ops. requiresApproval and workflowDefinitionId are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Share the edit preparation between the gated and ungated preview Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Preview a changed description as the PATCH saves it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Leave derived tags out of an ungated preview's ops Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Return an ungated preview's ops only for descriptive fields An ungated preview now returns no ops when preparing the patch changes a field outside the descriptive set, and refuses a glossary term that is not Approved, as the save does. New tests cover a caller without the edit and tag, owner and column-description previews matching what PATCH saves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Preview a term that is not Approved as the save now holds it Main now holds such a term as pending instead of refusing it, so the preview no longer calls the check the save dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit b74209e) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
❌ 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 |
| // The updater cleans a changed description before saving it; preview the text that is saved. | ||
| if (!Objects.equals(updated.getDescription(), original.getDescription())) { | ||
| updated.setDescription( | ||
| org.openmetadata.service.util.DescriptionSanitizer.sanitize(updated.getDescription())); |
There was a problem hiding this comment.
💡 Quality: Fully-qualified class names used instead of imports
previewPatchOps calls org.openmetadata.service.util.DescriptionSanitizer.sanitize(...) by its full name, and the new IT code does the same with new java.util.ArrayList<>() and new java.util.TreeSet<>(). The repository's Java rules say to import the class rather than spell out its full name. Spotless won't catch this, so it has to be fixed by hand: import DescriptionSanitizer in EntityRepository and ArrayList/TreeSet in ChangeRequestResourceIT.
Add import org.openmetadata.service.util.DescriptionSanitizer; and use the simple name, and do the same for ArrayList/TreeSet in the IT.:
updated.setDescription(DescriptionSanitizer.sanitize(updated.getDescription()));
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 🟡 Medium risk 0 closed / 1 findingsUngated previews now return descriptive mutation ops, changing the change-request API; mismatched planning could show users a diff unlike the saved edit. Backports the fix for change request previews returning ops for ungated descriptive edits to 💡 Quality: Fully-qualified class names used instead of imports📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java:5370 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ChangeRequestResourceIT.java:294 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ChangeRequestResourceIT.java:428
Add `import org.openmetadata.service.util.DescriptionSanitizer;` and use the simple name, and do the same for ArrayList/TreeSet in the IT.🤖 Prompt for agentsVerificationRules 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 |
Backport of #38329 to
2.1.b74209e18700f2a758b5b767748d50dbdf1e0026git cherry-pick -x, applied cleanly. No conflicts.Cherry-pick for the next 2.1 release: the change is not in 2.1.1.
The change touches
ApprovalGate,ChangeRequestService,EntityRepository.previewPatchOps,ChangeRequestResourceITand an ADR underdocs/decisions. Onmainit was adjusted for #38239 (glossary terms that are not Approved are held as pending).2.1already has that handling (backport #38511), so the picked change applies as is and no 2.1-specific glossary adjustment was needed.Checks
mvn spotless:applyonopenmetadata-service: no changes.mvn package -pl openmetadata-service -am -Dtest='ApprovalGatePreviewOpsTest,ChangeRequestServiceTest,MutationPlannerTest': 71 tests, 0 failures, 0 errors.ChangeRequestResourceIT: not run locally. It needs the Docker services, and the local test stack was left untouched.Merge order (ships together)
🤖 Generated with Claude Code