Skip to content

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

Merged
yan-3005 merged 2 commits into
2.0from
fix/workflow-null-change-is-not-a-create-2.0
Nov 5, 2026
Merged

yan-3005 merged 2 commits into
2.0from
fix/workflow-null-change-is-not-a-create-2.0

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes open-metadata/openmetadata-collate#8236

Backport of #37010 to 2.0. The customer is on 2.0.7.

  1. Approvals fire on updates the workflow's filters never judged. With no stored changeDescription, the trigger filter treated an Updated event as a create and skipped include/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.
    • The consumer records the event type (global_triggeringEventType).
    • A missing change passes only for a Created event, or a run that predates the variable.
    • An update whose own change names only non-trigger fields (followers, votes) starts no run.
  2. Proposed Changes hides the edit that started the approval. The workflow sets In Review before the task exists, so the task previewed that status hop.

main builds the opening preview from the triggering version (#36855). 2.0 has no triggering version, hence the stored change here. 2.0 also keeps showing the workflow's own status change on the card, as it does today.

Type of change:

  • Bug fix

High-level design:

N/A — minimal backport of #37010, with the 2.0 differences listed above.

Tests:

Use cases covered

  • An undone tag edit or a follow on a new table opens no approval. A follow on a table with an open approval keeps that approval. A real target-tag edit still opens one.
  • A workflow that sets In Review before approval, then tags edited, then description edited: the card lists tags, then tags and description.
  • Add a tag, remove an existing tag, remove the added tag: the card shows only the net removal.

Unit tests

  • FilterEntityImplTest, WorkflowEventConsumerTest, ChangePreviewUtilsTest (new cases), plus CreateTask*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.0 13ba2b53a2, OpenMetadata = this branch)

  • Collate Playwright, the "Workflows and Data Access Request E2E" selection (--grep-invert @ingestion Workflow DataAccessRequest RequestDataAccess): 165/165 passed.
  • Collate governance unit tests (io/collate/governance/**): 353/354. The one failure, EnqueuePolicyRequestsDelegateTest.throwsWhenExpirationDateIsNotFutureTimestamp, fails on base 2.0 too.
  • Collate governance ITs:
    • DataAccessRequestIT, DarStatusGroupIT, DataAccessRequestValidationIT and DataAccessRequestPolicyAgentConfigIT pass.
    • SinkWorkflowMigrationIT.removesSupersededPlaintext… fails on base 2.0 too.
    • In the combined run, DataAccessRequestIT.manualRouteRecordsPolicyAgentReasonInPayload hit 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 a DataAccessRequest task, which this change doesn't touch. Run alone, DataAccessRequestIT passed 18/18 twice with 0 deadlocks.

Playwright (UI) tests

  • Not applicable for new specs (no UI changes). Collate workflow Playwright results are above.

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:

🤖 Generated with Claude Code

…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.
@yan-3005
yan-3005 requested a review from a team as a code owner November 4, 2026 13:35
@yan-3005
yan-3005 requested review from pmbrull and removed request for a team November 4, 2026 13:35
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Nov 4, 2026
@gitar-bot

gitar-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@yan-3005
yan-3005 enabled auto-merge (squash) November 5, 2026 08:55
@yan-3005
yan-3005 merged commit 1d0050c into 2.0 Nov 5, 2026
43 of 46 checks passed
@yan-3005
yan-3005 deleted the fix/workflow-null-change-is-not-a-create-2.0 branch November 5, 2026 09:08

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants