Repository navigation
Conversation
…val payload schema
…orkflow code can share it
❌ 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 |
|
Local test results for this branch. PR CI runs only the Java unit tests, so here is what I ran on my machine against MySQL and Elasticsearch. RED, the new IT on main (1971feb plus only the test commit)
Unit tests with the fix 196 tests in 9 classes, 0 failures: GREEN, integration tests with the fix
Not run locally: the rest of |
pmbrull
left a comment
There was a problem hiding this comment.
❌ Changes needed · 2 🔴 · 0 🟡
| Blockers | ❌ 2 🔴 |
| Nits | ✅ none |
| Tests | ❌ gaps in history-read failure and incomplete-cycle coverage |
| Cross-repo | ✅ checked the task payload consumer and available Collate callers |
| Trade-off | ❌ reading history is bounded, and the preview needs to surface partial results |
| Auto-approved | ➖ changes needed and a maintainer decision on the superseding ADR |
Thanks for covering edits that happen between approval tasks and for providing main and branch test results.
- 🔴
CreateTask.java:1342— A failed history read can abort task creation. Move the read inside the guarded preview path and test that the task still opens after a history read fails. Existing inline finding - 🔴
ApprovalCycleHistory.java:78— A missing version or the 200-version cap can leave the preview showing only the most recent part of the cycle. Compute the complete diff or show reviewers explicitly that the preview is incomplete. Add coverage for both a missing version and the cap.
The PR adds an ADR that supersedes the accepted approval-preview rule. Confirm the new rule with the original decider. The linked issue also needs a maintainer to add it to Shipping and rerun the metadata check. Metadata check details
What I checked
Traced workflow task creation, the history walk, and the Proposed Changes consumer. The original two issue scenarios already pass on main. The new integration tests cover residual cases involving older or skipped edits. The author reports 196 unit tests and 37 MySQL and Elasticsearch integration tests passed. Backend CI passed. Metadata and Collate Compatibility are red. The Compatibility status did not provide a job log.
claude-verdict {"sha":"5f77e8a900098650061f1f9dcc44661a42d1d579","recommendation":"request_changes","blocking":2,"nits_to_fix":0,"human_decision":true,"tradeoff":"does_not_hold","cross_repo":"checked","tests_ok":false}
…read keeps the task's payload
… glossary approval payload schema
…y walk cannot reach it, and mark a preview that still cannot
… read the whole cycle
…on missing from the history
… read in the approval preview decision
|
@pmbrull thanks for the review. Both blockers are fixed in 9c09aa4 through 2894227, and I replied in each thread with the details. @yan-3005 this PR adds ADR:2026-11-26-an-approval-preview-lists-the-change-since-its-cycle-began, which supersedes your 2026-11-03 record about the preview opening with the edit that started the cycle. Instead of carrying the preview forward and folding in each hop, every task write now rebuilds it from the version history since the cycle's base. Could you take a look and let me know if you're OK with that rule? The record shows your agreement as pending until then. What I ran locally on the new head: 190 unit tests across the 7 preview classes (including the new The linked issue still needs a maintainer to add it to Shipping and rerun the metadata check. Nothing to change in the code for that one. |
VersionDiff delegates list comparisons to MutationPlanner, which filters inherited references. Exercise a historical snapshot with inherited owners, reviewers and domains alongside a real edit.
pmbrull
left a comment
There was a problem hiding this comment.
❌ Changes needed · 2 🔴 · 0 🟡
| Blockers | ❌ 2 🔴 |
| Nits | ✅ none |
| Tests | ❌ gaps in the history-exception fallback and nested field diffs |
| Cross-repo | ✅ checked the task payload, approval UI and notification consumer |
| Trade-off | ❌ the snapshot fallback can hide edits while reporting a complete preview |
| Auto-approved | ➖ changes needed and maintainer agreement on the superseding ADR |
Thanks for fixing task creation when history is unavailable and adding the incomplete-preview warning. Two paths can still present an incomplete preview as complete.
- 🔴
ChangePreviewUtils.java:334— When the history lookup throws, the task opens with the existing payload. A superseded task can supply a stale preview, and a first task can have no preview at all. Set the incomplete flag in this path and show the warning in the task-created notification as well as the task page. Cover a failed fresh read with a carried preview. - 🔴
VersionDiff.java:50— With a missing history hop, a table column’s description or tag can change without changing its name. The snapshot diff emits a whole-list change that the preview reduces to the same column names. Show the nested edit or mark this result incomplete. Add a regression with a missing hop and an edit to a field on an existing column.
The superseding ADR still needs agreement from the original decider. The linked issue needs to go into Shipping, and the Compatibility check is red. Metadata check
What I checked
Read the guarded history lookup, snapshot comparison, task payload, task page and notification template. The new tests cover a missing history row, but the failure test accepts the original payload without a warning and the snapshot tests do not exercise changed values inside a column. Backend, UI checks and generated types pass. The author reports 190 unit tests, 15 MySQL and Elasticsearch integration tests, and 52 task UI tests passed. PostgreSQL and OpenSearch are outstanding.
claude-verdict {"sha":"b489552bc0c4dbaf93952176f6d1bc368a37377b","recommendation":"request_changes","blocking":2,"nits_to_fix":0,"human_decision":true,"tradeoff":"does_not_hold","cross_repo":"checked","tests_ok":false}
|
@Vamsi-klu reviewed at b489552 and ran the tests locally (MySQL + ES). Tests
Still open before merge
Not run: Postgres + OpenSearch lane, full |
|
@Vamsi-klu I ran scenario tests on main and on 7cfe7c1 (MySQL + ES): the seeded glossary workflow, glossary and table workflows with other shapes, and the consolidation cases. Edits merged into one version and edits taken back inside a cycle both preview correctly. Three things still need fixing in this PR. 1. Starting from the last
Repro: a glossary workflow whose reject edge sets status Rejected, with no rollback. Task 2 lists edit 1 again, even though it was already rejected. Bot edits also come out differently depending on the workflow, because the result depends on where an Approved status happens to sit:
2. Bot edits stay out of the preview Bot edits skip governance on purpose ( 3. Rollback (pre-existing on main; fix it here so the preview and reject agree) a. Reject does nothing on entities without reviewers (tables).
b. Rejecting an edit on a term that was already Rejected keeps the edit.
c. Rollback wipes bot edits.
Changes needed Preview:
Rollback:
Tests (ITs, MySQL and Postgres):
|
|
Thanks for running through these workflows, Yan. The preview now starts from the triggering edit’s previous version or the oldest open task it replaces. Rejection uses that same history to restore the previous decision and undo the reviewed changes. Bot-only edits stay in place. If both write the same field, rejection restores an earlier bot value and preserves a later bot write. If a history row is missing, the preview warns about the gap and shows the changes it can still undo. All 209 focused unit tests passed. All 14 integration cases passed on both MySQL and PostgreSQL, including the custom Rejected workflow and the table without reviewers. |
…eview-from-history # Conflicts: # openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowEventConsumer.java
|
@Vamsi-klu thanks for the update. I reran everything on d07beaf. Tests
1. Bots listed in triggeringBots (blocking) #38797 is merged on main and is already in this branch. A workflow can now list bots in Live repro on d07beaf with a glossary workflow that lists a bot created by an admin, rolls back on reject, on an approved term: An edit by a bot that the running workflow lists in 2. A failed history read leaves a 0 to 0 range and reject reverts nothing This is the gitar finding and the code confirms it. 3. Tasks opened before the upgrade (minor)
I have not run the scenario probes or the regression ITs on Postgres. Only |
|
@yan-3005 thank you for the thorough review and for running all those scenarios and live repros. I have addressed all three points in 5194276:
Verified locally:
Ready for another look whenever you have a moment. |
|
I checked the required backend failure on |
|
@Vamsi-klu thanks for the last round. I checked 5194276 and the branch update on top of it. The behaviour matches the decision records, the ITs pass on MySQL and Postgres, and the live checks for listed triggering bots pass as well. A few things are left. Docs
Gitar finding on prior task ranges Please take a look at the open Gitar finding in #38857 (comment) and fix it if you agree it is relevant. From the code it looks real to me. Screenshots If it is feasible, could you add as many screenshots as you can to the PR description, covering the scenarios this PR changes? For example:
It would make the review much easier. |
|
Thanks, @yan-3005. I updated the workflow builder and both decision records so they describe what rejection restores and which listed bot edits it covers. |
Code Review ✅ Approved 🔴 High risk 4 closed / 4 findingsApproval rejection now reconstructs and patches entity fields from version history, so a faulty reviewed-range diff could restore or erase metadata. Approval task previews now list every change since the approval cycle began, recomputed from version history on each task write, with the open-findings list empty. Resolved this session: failed history reads now abort task creation instead of leaving a 0..0 range, comparison fallback no longer reports inherited owners/reviewers as removed, and Flowable read failures for a prior task's range no longer abort task creation. ✅ 4 closed✅ Bug: Failed history read now aborts approval task creation
✅ Bug: Comparison fallback reports inherited owners/reviewers as removed
✅ Bug: Failed history read leaves a 0..0 range, so reject reverts nothing
✅ Bug: Flowable read failure for a prior task's range still aborts task creation
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 |
|
@Vamsi-klu thanks for the updates. The docs and the Flowable fallback look good to me. One gentle reminder on the screenshots. When you get a chance, could you add before and after screenshots to the PR description, with main as the before and this branch as the after? Seeing the same scenario side by side would show that the fix works in the product, not only in the tests. The scenarios from my earlier comment are a good list to cover, especially these:
Thanks again. |
|
Thanks for the reminder, @yan-3005. I ran all five scenarios against live builds of |
|
@Vamsi-klu thank you for the screenshots, and for working through all the rounds on this. I know it has been a lot of back and forth. There is one last case I want to raise, and it only affects the incomplete history path. In scenario 5 the description edit is hidden from task 2 because its history row is missing, which is fine with the warning shown. Reading the reject path, though, When the history is incomplete but the base version row is readable, could reject restore the fields that differ between the base and the current version, as main does? One IT that drops a version row in the middle of a cycle, rejects the task, and checks the edit is reverted would cover it. |
Describe your changes:
Fixes #35456
The Proposed Changes card on an approval task now lists what the entity changed since its approval cycle began, recomputed from the version history every time the workflow writes the task.
The two exact repros in the issue already pass on main. Three changes fixed them on the way: #35972 strips the workflow's own status move from the preview, #37010 previews the edit that opened the cycle, and #32335 writes workflow fields with optimistic locking, so the status write is stored as its own version and no longer folded into the user's version (that folding is what the metric report on 2.0.5 shows). ITs 1 and 2 below pin both repros so they stay fixed.
What was still wrong is the shape of the preview itself. It was a running merge: each new task copied the map stored on the open task it superseded and added one change read off the entity when the task was created. Nothing ever recomputed it, so three things still went wrong on main:
ITs 4 and 5 reproduce 1 and 2 and fail on main. RED run on the unfixed code:
Behavior after this change:
proposedChangesBaseVersionrecords where the cycle began. The opening task uses the earlier of the triggering edit's previous version and the latest approved version found in history. A task that supersedes or reenters uses the earliest triggering or carried base.proposedChangesIncompletemarks failed reads and snapshot fallbacks. The Proposed Changes card and the default task-created notification both warn when the flag is set, even when there are no entries.This supersedes the decision record "An approval preview opens with the edit that started the cycle" and adds a new record, "An approval preview lists the change since its cycle began". The direction still needs agreement from the decider of the record being superseded, who has been working in this same code recently (#38708, and #37901 is still open). The proposal is on the issue; I built the full change anyway so there is something concrete to look at, and I will rework it if the answer is no.
Type of change:
High level design:
New pieces, all in
governance/workflows/utilunless noted:ApprovalCycleHistoryreads the stored versions of the cycle. It starts from a fresh read of the entity and follows each change's recorded previous version, one stored row at a time, and stops at the base. It does not pagelistVersionsWithOffset, which the plan suggested: that query orders rows by their extension name as a string, so once an entity passes version 10.0 a page of "newest" rows starts at 9.9 and a walk that stops at the base would stop too early. Following the recorded previous version is the same link the server already relies on when it consolidates a session (getPreviousVersion). The walk reads up to 200 versions. If a row is missing or the cap prevents reaching the base, it compares the base and current versions when both are available and marks the result incomplete. This keeps the visible edits while warning that nested changes, such as a column's description, can be missing.ApprovalCycle.baseVersiontakes the earliest triggering or carried base. An opening task also considers the approved baseline using the same predicate as rollback.ApprovedBaselineis the approved version predicate moved out ofRollbackEntityImplunchanged, so the preview and rollback agree on what counts as the last approval.RollbackEntityImplnow calls it; its tests pass unchanged.TriggeringChange.baseVersiongives the version the triggering edit was made from.ChangePreviewUtilsgetsfoldChanges,withCyclePreviewandcycleBaseOf.buildProposedChangesPayloadis narrowed to the change request revision, and the old hop logic (pickIncrementalOrFull, the 2 and 4 argument overloads) is gone.preserveProposedChangesbecomespreservePreviewStateand carries the base key too.CreateTaskwires it in: the preview is computed lazily and only for the two approval task types, inside aFreshReadScope, and the prior open approvals are sorted oldest first instead of taking an arbitrary one.Fallbacks for state from before the upgrade:
Why a stored pointer and not a rule derived from the history alone: some workflows never write Approved (the custom table workflows in the ITs end without a status write), and when the requester's own approval write is consolidated the approval transition disappears from the history.
Alternatives I rejected: fixing which hop the running merge picks (still carries stale maps and still misses edits that started no run), recomputing on every task read (every GET and list would walk history, and notifications carry the stored payload), using snapshot diffs for every task (top-level list changes can hide edits within a column), and a migration to rewrite open tasks.
Rollout:
CreateTasknear the prior task lookup, so whichever lands second will need a rebase.ChangePreviewUtils: the 2 and 4 argumentbuildProposedChangesPayloadoverloads, andpreserveProposedChanges(nowpreservePreviewState). A code search across the open source repository found no other callers; I could not search the Collate repository, so someone with access should check it before merge.Tests:
Use cases covered
Unit tests
ApprovalCycleHistoryTest,ApprovalCycleTest,TriggeringChangeTest.ChangePreviewUtilsTest(fold semantics replace the hop tests),CreateTaskLifecycleMoveTest,CreateTaskTest(oldest first priors).RollbackEntityImplTestis unchanged and passes, which covers the predicate move.ChangePreviewUtilsTest56,CreateTaskTest96,ApprovalCycleHistoryTest10,RdfOntologyContractTest10,RollbackEntityImplTest7,ApprovalCycleTest6,TriggeringChangeTest5,CreateTaskLifecycleMoveTest3,CreateTaskPostCommitPersistTest3).ApprovedBaselinehas no test of its own; it is the predicate moved verbatim and is covered byRollbackEntityImplTestand the baseline cases inApprovalCycleHistoryTest.Backend integration tests
ApprovalTaskPreviewITcovers the nine use cases above.Local results at 5f77e8a, MySQL and Elasticsearch, each lane run the way CI runs it:
ApprovalTaskPreviewIT6 of 6 (including the two that fail on main),GlossaryTermInheritedReviewerApprovalIT7,GlossaryTermMoveApprovalIT5, and the five approval methods ofMetricResourceIT.ChangeRequestApplyIT11, and threeWorkflowDefinitionResourceITmethods: the two existing preview tests (test_approvalPreviewShowsTheChainOfEditsNotTheWorkflowsStatusWrite,test_approvalPreviewShowsTheNetOfEditsTakenBackWithinTheCycle) andtest_tagAnotherChangePublishedLeavesTheRequestAndTheRestStaysUnderReview, which covers the change request preview refresh.Not run locally: the rest of
WorkflowDefinitionResourceITandMetricResourceIT, and the nightly suites the planner lists as impacted but not local.Review follow-up at
7cfe7c130acApprovalTaskPreviewITcases passed against MySQL and Elasticsearch. The new workflow regression checks that the opening preview includes the bot's edit and that rejection restores the approved term. The local retry gave Elasticsearch a longer startup window and limited its JVM to four processors.Ingestion integration tests
Playwright (UI) tests
TaskTabNewJest tests, including a task with only the incomplete flag.Manual testing performed
Ran all five approval and rollback scenarios end to end against live MySQL, Elasticsearch, compiled UI, and local SMTP builds for both
main(df1fdcdc27e) and this branch (28f17d3fe48). Results are captured side by side below.UI screen recording:
Side-by-side screenshots captured against live builds of
main(df1fdcdc27e, Before) and this branch (28f17d3fe48, After) running the same five scenarios end to end against MySQL, Elasticsearch, the compiled UI, and local SMTP delivery.1. Second approval cycle on a glossary term with a stale prior preview
BusinessGlossary.CustomerLTVis approved with"Original definition", updated to"Accepted definition"and approved in cycle 1, then updated to"Edited definition"in cycle 2. After seeding the open task with the stale cycle 1 preview (Original -> Accepted definition) and adding synonymCLV,maincarries the stale description diff forward into the superseding task, while this branch recomputes from version history (Accepted -> Edited definitionplusCLV).mainatdf1fdcdc27e)28f17d3fe48)2. Bot edit outside review (
ingestion-bot), preview and entity after rejectBusinessGlossary.MonthlyActiveUsersis approved with"Original definition".ingestion-bot(not intriggeringBots) updates the description to"Ingested from warehouse pipeline"outside review. A human then adds synonymMAU, opening an approval task, and the reviewer rejects it. Both previews show only the reviewed synonymMAU, while on rejectmainrevertsingestion-bot's description back to"Original definition"and this branch reverts onlyMAUand keeps"Ingested from warehouse pipeline".Task preview:
mainatdf1fdcdc27e)28f17d3fe48)Entity after reject:
mainatdf1fdcdc27e)28f17d3fe48)3. Bot listed in
triggeringBots(catalog-sync-bot), preview and entity after rejectA workflow with
triggeringBots: ["catalog-sync-bot"]governsBusinessGlossary.NetRetentionRate.catalog-sync-botedits the description to"Synced by catalog-sync-bot", opening an approval task, and unlistedingestion-botadds synonymNRRwhile the task is open. The task preview showscatalog-sync-bot's description change (and excludesNRR). On reject,mainreverts the description and also removes unlistedingestion-bot's synonymNRR, while this branch revertscatalog-sync-bot's description and keepsNRR.Task preview:
mainatdf1fdcdc27e)28f17d3fe48)Entity after reject:
mainatdf1fdcdc27e)28f17d3fe48)4. Table workflow with rollback (no entity reviewers)
A table approval workflow with
rollbackEntityTaskand an explicit reviewer governsanalytics_postgres.warehouse.public.customer_orders(which has no entity reviewers). Cycle 1 approves"Approved table description". Cycle 2 edits the description to"Unreviewed draft description"and the reviewer rejects it. Onmain, the table remainsApprovedwith"Unreviewed draft description"left in place; on this branch, rollback restores"Approved table description".mainatdf1fdcdc27e)28f17d3fe48)5. Incomplete history warning on the task card and task-created notification
BusinessGlossary.GrossMarginis approved with"Original definition", edited to"Edited definition"(opening task 1), and its intermediate version row (glossaryTerm.version.0.4) is removed fromentity_extensionbefore adding synonymGM(opening task 2 and dispatching the task-created email notification). Onmain, neither the Proposed Changes card nor the email notification warns about missing history; on this branch, both display the incomplete-history warning above the remaining changes.Task card:
mainatdf1fdcdc27e)28f17d3fe48)Task-created email notification:
mainatdf1fdcdc27e)28f17d3fe48)Checklist:
Fixes #35456: <short explanation>Fixes #35456above.REVIEW.mdand fixed every finding.docs/decisions/and marks the record it supersedes.