Repository navigation
fix(workflows): stop approvals firing on updates with no change to judge, and show the edit that opened an approval (backport 2.0 #37010) - #37068
Conversation
…dge, and show the edit that opened an approval (backport 2.0 #37010) The trigger filter passed any run whose stored change was missing as if it were a create, skipping include/exclude. An Updated event can leave none: an edit undone within its session reverts the entity to a version without one, and a follow never stores one. The event consumer now records the event type on the trigger signal, a missing change passes the filter only for a Created event or a run that predates the variable, and an update whose own change names only fields no workflow triggers on (a follow, a vote) starts no run. Approval workflows set the entity's status before the approval task exists, so the task previewed that status hop and dropped the edit that started the run. A task that opens an approval cycle now previews the entity's stored change, which holds that edit; a task that supersedes an open approval keeps folding in each edit's own hop.
❌ 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 |
Code Review ✅ Approved🟡 Medium risk · Changing workflow event filtering and approval previews could skip a required approval or misrepresent edits shown to approvers. Stops approval workflows from firing on updates that carry no change description by recording the triggering event type and only passing a missing change for Created events, and makes approval task previews show the user's edit that opened the cycle rather than the workflow's own status write. No issues found. 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 |
Describe your changes:
Fixes open-metadata/openmetadata-collate#8236
Backport of #37010 to
2.0. The customer is on 2.0.7.changeDescription, the trigger filter treated anUpdatedevent as a create and skippedinclude/exclude. That happens after an edit undone within its session (consolidation reverts the entity to a version with no change) and after a follow on a never-edited entity. A Spark run that removes and re-adds tags on each new table opened a tag-gated approval on every one of them.global_triggeringEventType).Createdevent, or a run that predates the variable.followers,votes) starts no run.mainbuilds the opening preview from the triggering version (#36855).2.0has no triggering version, hence the stored change here.2.0also keeps showing the workflow's own status change on the card, as it does today.Type of change:
High-level design:
N/A — minimal backport of #37010, with the 2.0 differences listed above.
Tests:
Use cases covered
Unit tests
FilterEntityImplTest,WorkflowEventConsumerTest,ChangePreviewUtilsTest(new cases), plusCreateTask*Test: 178 run, 0 failures.Backend integration tests
WorkflowDefinitionResourceIT:test_updateThatLeavesNoChangeDescriptionIsJudgedNotTreatedAsCreate,test_approvalPreviewShowsTheChainOfEditsNotTheWorkflowsStatusWrite,test_approvalPreviewShowsTheNetOfEditsTakenBackWithinTheCycle. Run locally (MySQL + Elasticsearch): 3 consecutive runs, 9/9 passed.Collate verification (run locally on Collate
2.013ba2b53a2, OpenMetadata = this branch)--grep-invert @ingestion Workflow DataAccessRequest RequestDataAccess): 165/165 passed.io/collate/governance/**): 353/354. The one failure,EnqueuePolicyRequestsDelegateTest.throwsWhenExpirationDateIsNotFutureTimestamp, fails on base 2.0 too.SinkWorkflowMigrationIT.removesSupersededPlaintext…fails on base 2.0 too.DataAccessRequestIT.manualRouteRecordsPolicyAgentReasonInPayloadhit a 409 from a Flowable/MySQL deadlock. It collided with another test deleting workflow deployments at the same moment; the deadlock count was the same as on base (19 vs 19), and the task is aDataAccessRequesttask, which this change doesn't touch. Run alone,DataAccessRequestITpassed 18/18 twice with 0 deadlocks.Playwright (UI) tests
Manual testing performed
Reproduced the customer's case on a 2.0 environment before the fix (an approval with only
entityStatus, and the first edit missing from the card); the screenshots are in #37010.UI screen recording:
Not applicable — backend-only change.
Checklist:
Fixesabove.REVIEW.md; 2.0 differences called out above.mainwith fix(workflows): stop approvals firing on updates with no change to judge, and show the edit that opened an approval #37010.🤖 Generated with Claude Code