Repository navigation
Fixes #38331: Change request preview returns the ops of an ungated descriptive edit - #38329
Conversation
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-for-ungated-edits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
…-for-ungated-edits
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>
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsThe preview endpoint now exposes ops for ungated descriptive edits, changing client-visible behavior and how clients may present proposed metadata updates. Ungated change request previews now return ops for edits touching only descriptive metadata, without storing a change request. The previewOps copy of planStage's preparation was resolved by sharing the edit preparation between gated and ungated previews. No open issues found. ✅ 1 closed✅ Quality: previewOps copies planStage's preparation instead of sharing it
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 |
…scriptive edit (#38329) (#38954) * 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. * Share the edit preparation between the gated and ungated preview * Preview a changed description as the PATCH saves it * Leave derived tags out of an ungated preview's ops * 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. * 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. --------- (cherry picked from commit b74209e) Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Describe your changes:
Fixes #38331
POST /v1/changeRequests/preview/{entityType}/{id}returned ops only when an approval workflow would hold the edit. It now also returns them for an edit no workflow holds, as long as the patch touches descriptive metadata only (description, display name, tags, owners, domains, data products, columns, certification, glossary synonyms/related terms/parent, metric expression/type/granularity/related metrics). A client can then show the user exactly what a PATCH would change, as the change-request diff, before sending it. Collate's AI chat uses it to show a drafted change for approval.ApprovalGate.previewOpsplans the ops withMutationPlannerfrom the same prepared edit a gated preview uses (one shared helper); nothing is stored.EntityRepository.previewPatchOpsprepares the patched entity for the requesting user.ChangeRequestService.previewcalls it only when no workflow gated the edit and every patched field is inDESCRIPTIVE_FIELDS. Any other ungated edit gets no ops, as before.requiresApprovalandworkflowDefinitionIdare unchanged.Type of change:
High-level design:
No new endpoint or schema field: the existing preview response's
opsis filled in one more case. A gated edit still takes its ops from the staged change and does not compute them twice. Clients that readrequiresApprovalsee no difference.Tests:
Use cases covered
Unit tests
ChangeRequestServiceTest(48 tests pass locally).Backend integration tests
openmetadata-integration-tests/for new/changed API endpoints.ChangeRequestResourceIT:anUngatedDescriptionEditIsPreviewedWithItsOpsAndNothingIsSaved: 200, the description op with its old and new value, and neither the glossary nor a change request is saved. It fails onmain.anUngatedEditBeyondDescriptiveMetadataIsPreviewedWithoutOps.ChangeRequestResourceITpasses locally: 12 of 12,postgres-opensearchprofile.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
sample_datatables: each returned the ops, and nothing was saved.Companion PRs (Collate AI chat): open-metadata/ai-platform#2363, open-metadata/openmetadata-collate#8797.
UI screen recording:
Not applicable: backend-only change.
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 schema change.)
For a UI feature or feature task: not applicable, backend only.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff (599fb15) against
REVIEW.md; no 🔴 open. Only a public method is added; nothing Collate calls is renamed.Decision check:
docs/decisions/2026-11-20-a-change-request-preview-shows-an-ungated-edit-of-descriptive-metadata.mdrecords which edits a preview now returns ops for, and that "no ops" means "cannot be shown".I have added tests around the new logic.
🤖 Generated with Claude Code
Fix the description preview mismatch for
ingestion-botbefore merging.Findings
Summary
Adds change ops to previews of ungated descriptive edits.
Both earlier, unnumbered findings are addressed: changed descriptions are cleaned before planning, and derived tags are excluded from both sides.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Preview PATCH] --> B[Prepare and check permissions] B --> C{Workflow holds edit?} C -->|Yes| D[Return staged ops] C -->|No| E{Only descriptive fields?} E -->|No| F[Return no ops] E -->|Yes| G[Prepare again and clean description] G --> H[Exclude derived tags and plan ops] H --> I{All ops descriptive?} I -->|Yes| J[Return ungated ops] I -->|No| FReviews (6) · Last reviewed commit: "Preview a term that is not Approved as t..." · Reviewed by Greptile