Repository navigation
Fixes #36556: Record the asset's change event when an approved task changes it - #36682
Conversation
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
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 |
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
TaskWorkflowHandlerhas one step,saveChange, that patches the asset and records its change event, the way the tag path already did. The event is built byChangeEventHandler.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.FieldPathUtilsno longer writes to the database: the handler sets the description in memory withsetFieldDescriptionand saves it through the same step. The removedupdateFieldDescriptionhad no other callers.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.FieldPathUtilsTestnow coverssetFieldDescription, 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.