Skip to content

Fixes #36556: Record the asset's change event when an approved task changes it - #36682

Merged
manerow merged 2 commits into
mainfrom
fix/36556-task-apply-change-events
Nov 2, 2026
Merged

manerow merged 2 commits into
mainfrom
fix/36556-task-apply-change-events

Conversation

@manerow

@manerow manerow commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Fixes #36556

Problem

When an approved task changes its asset, the change is saved and the asset's version goes up, but no change event is recorded for the asset. The write runs inside the task's own request, whose response is the task, so the response filter that records events for direct edits never sees it. Alerts on the asset and the audit log both miss the change.

Approved tag and tier updates already record it. Approved description updates (including column descriptions), owner updates, domain updates and AI suggestions did not.

What changes

  • TaskWorkflowHandler has one step, saveChange, that patches the asset and records its change event, the way the tag path already did. The event is built by ChangeEventHandler.entityChangeEvent, the same builder the response filter uses for a direct edit. Every asset write of the task form's actions now goes through it, so a new kind of task cannot forget its event.
  • FieldPathUtils no longer writes to the database: the handler sets the description in memory with setFieldDescription and saves it through the same step. The removed updateFieldDescription had no other callers.
  • A write that changes nothing, or that is held for approval, records no event, as before.
  • The rule is recorded in docs/decisions/2026-10-30-an-approved-tasks-change-is-the-entitys-own-change-event.md, so it outlives this description.

So an approved description, owner, domain or suggestion change now reaches asset alerts, the audit log, and anything else built from change events, attributed to the user who approved it. Entity-event workflows run after an approval exactly as they would after a direct edit by that user; approved tag updates already behaved this way.

Tests

  • TaskWorkflowHandlerTest: one change event with the approver as its user; none when the patch changed nothing; no write for an unchanged entity.
  • FieldPathUtilsTest now covers setFieldDescription, with the same cases.
  • TaskResourceIT: the apply tests for description, column description, owners, domains and the suggestion endpoint each assert exactly one change event on the asset, by the approver. A new case covers an asset that is not a table (a topic), the description test checks the audit log has exactly one entry by the approver, and the column tag test now asserts exactly one event. Before this change the six new assertions fail and the tag one passes.
  • Checked by hand on a local Collate: approving a description suggestion records the table change, fires a table alert and adds an audit log entry, on a fresh install and after upgrading from 2.0.5 and 1.13.6.

@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend labels Oct 30, 2026
@manerow manerow self-assigned this Oct 30, 2026
@manerow
manerow requested a review from a team as a code owner October 30, 2026 11:13
@manerow
manerow requested a review from TeddyCr October 30, 2026 11:13
@gitar-bot

gitar-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🟡 Medium risk · Routing approved-task metadata writes through a shared save-and-event path could trigger alerts, audit entries, and governance workflows for previously unrecorded changes.

Approved tasks that change an asset now record that asset's change event, so description, column description, owner, domain and AI suggestion updates reach alerts and the audit log, attributed to the approver. The rule is documented in a decision record, addressing the finding that it previously existed only in the PR description. No open issues found.

✅ 1 closed
✅ Quality: Approved-task change-event rule exists only in the PR description

📄 openmetadata-service/src/main/java/org/openmetadata/service/tasks/TaskWorkflowHandler.java:1032-1046
This PR sets a rule that alerts, the audit log and entity-event governance workflows all depend on, but the rule is written only in the PR description, and the repository squash-merges, so the description never reaches the tree. From the description: "Every asset write an approved task makes now goes through it, so a new kind of task cannot forget its event" and "Entity-event workflows run after an approval exactly as they would after a direct edit by that user." None of the existing task or approval records in docs/decisions/ say this. The javadoc on saveChange explains how the write works, but not the rule that every write must go through it or that workflows triggered by entityUpdated will now fire after approved description, owner, domain and suggestion tasks.

The record would say: "Every entity write an approved task makes goes through TaskWorkflowHandler.saveChange and records exactly one change event for the changed entity, attributed to the approver and carrying the task's ChangeSource. A no-op patch records none. Entity-event workflows and alerts treat it as a direct edit by that user."

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

@manerow
manerow added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit d77e1fe Nov 2, 2026
72 checks passed
@manerow
manerow deleted the fix/36556-task-apply-change-events branch November 2, 2026 16:58
manerow added a commit that referenced this pull request Nov 3, 2026
…hanges it (backport 2.0 #36682) (#36694)

* Fixes #36556: Record the asset's change event when an approved task changes it

* Check exactly one audit entry by the approver for an approved description
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.

Approving a task records no change event on its asset for description, owner, domain and AI suggestion tasks

2 participants