Repository navigation
Fixes 38699: Never give an approval back to its requester - #38708
Conversation
An approval node removes the requester (the editor whose change started the run) from its assignees. For workflows not managed by a task workflow, an emptied list was given back to the requester under the default "none" empty-assignee strategy. The task is filed by the requester and TaskAuthorPolicy denies a filer ResolveTask, so the only assignee could not approve it and the run never finished. The requester is now never an assignee. An emptied list goes to the node's empty-assignee strategy: none approves automatically, assignAdmins assigns the other admins, wait opens the task unassigned. Tests: SetApprovalAssigneesImplTest flips the case that locked in the give-back and adds the assignAdmins case; WorkflowDefinitionResourceIT covers owners / reviewers / owners+reviewers x none / assignAdmins / wait, both when the editor is the only approver and when someone else can approve.
|
Local Java test run: PASSED — details
Tests run locally
Broader coverage not executed by this focused run
Impacted, not run locally (1)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=SetApprovalAssigneesImplTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state -Dit.test=WorkflowDefinitionResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false |
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
Guard tests of the amended
The seeded event workflows (Glossary, Metric, AI asset) send a reviewer's own edit to |
Code Review ✅ Approved 🔴 High risk 1 closed / 1 findingsRemoving the requester fallback makes sole-approver edits auto-approve under none, potentially allowing unreviewed entity changes through approval workflows. Removes the requester from approval task assignees so an editor's own change is never routed back to them, with ✅ 1 closed✅ Quality: Contradicts Accepted ADR 2026-10-22 without superseding it
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 |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
…38816) * Fixes #38699: never give an approval back to its requester An approval node removes the requester (the editor whose change started the run) from its assignees. For workflows not managed by a task workflow, an emptied list was given back to the requester under the default "none" empty-assignee strategy. The task is filed by the requester and TaskAuthorPolicy denies a filer ResolveTask, so the only assignee could not approve it and the run never finished. The requester is now never an assignee. An emptied list goes to the node's empty-assignee strategy: none approves automatically, assignAdmins assigns the other admins, wait opens the task unassigned. Tests: SetApprovalAssigneesImplTest flips the case that locked in the give-back and adds the assignAdmins case; WorkflowDefinitionResourceIT covers owners / reviewers / owners+reviewers x none / assignAdmins / wait, both when the editor is the only approver and when someone else can approve. * Correct the self-approval rationale and add the upgrade note * Amend the glossary-proposals record: a sole editor no longer keeps their approval (cherry picked from commit f6b7cf2) Co-authored-by: Ram Narayan Balaji <81347100+yan-3005@users.noreply.github.com>
…) (#38829) Backport of #38708, ported by hand: 2.0 has no "wait" empty-assignee strategy and gave the requester back under every strategy, so the assignAdmins fallback never ran for an event-driven approval. The requester is now never an assignee of an approval their own edit started. An emptied list goes to the node's empty-assignee strategy: none approves automatically, assignAdmins assigns the other admins and, as on main since #35740, keeps the task open when the requester is the only admin instead of approving it.
Describe your changes:
Fixes #38699
An approval node removes the requester (the editor whose change started the run) from its assignees. For workflows not managed by a task workflow, an emptied list was handed back to the requester under the default
noneempty-assignee strategy. That task is filed by the requester, andTaskAuthorPolicy-FilerCannotResolveOwnTaskdenies a filerResolveTask, so the only assignee got403and the run stayedRUNNINGuntil an admin noticed it.The requester is now never an assignee. When removing them leaves nobody, the node's
emptyAssigneeStrategydecides:noneapproves automatically (the documented meaning ofnone, and what change requests already did),assignAdminsassigns the other admins,waitopens the task unassigned.The give-back was introduced together with the workflow-managed self-approval fix in #28269 and kept since. Its reason, "avoid an unassigned task nobody can act on", only ever applied to workflow-managed tasks, which keep their own path. Data access requests and lifecycle playbooks are unaffected: they use
assignAdmins, whose admin pool already excludes the requester.Upgrade note: an existing workflow under
nonestops opening these tasks. An edit by the entity's only approver is approved automatically instead of waiting for an admin. A workflow that wants the old wait sets the node towaitorassignAdmins. Recorded inADR:2026-11-25-an-approval-never-goes-to-its-requester.Type of change:
High-level design:
N/A — small change: one branch removed from
SetApprovalAssigneesImpl, plus tests and a decision record.Tests:
Use cases covered
none: the workflow finishes and no task is opened;assignAdmins: the task goes to admins, never the editor;wait: the task is open with no assignee.Unit tests
SetApprovalAssigneesImplTest:testSelfApprovalPrevention_eventDrivenSoleRequester_keptWhenNoOneElse(it locked in the bug) to..._neverAssignedAndAutoApproved;..._routedToOtherAdmins.mvn ... -Dtest=SetApprovalAssigneesImplTest:Tests run: 34, Failures: 0, Errors: 0.Backend integration tests
WorkflowDefinitionResourceIT:test_editorWhoIsTheOnlyApproverIsNeverAskedToApprove, 9 cases;test_editorIsLeftOffTheApprovalWhenSomeoneElseCanApprove, 9 cases.test_approvalWithOnlyTheRequesterToAskGoesToAdminsgaveTests run: 19, Failures: 0, Errors: 0.nonecase timed out with the instance stillRUNNING;403 TaskAuthorPolicy-FilerCannotResolveOwnTask.2.0.Local Java test run: PASSED
ef5cd7aa01f4(baseorigin/main)--scope full).Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Not applicable — no UI changes.
Manual testing performed
Local server built from this branch (
ef5cd7aa) with MySQL 8.3 and Elasticsearch 9.3, and the UI served by the server.steward(not an admin) and two data contracts,orders_contractandcustomers_contract. Each is owned and reviewed only bysteward.Updated:noneon orders andassignAdminson customers.stewardand edited both contracts' descriptions.Results:
none): the run is "Success — Auto-approved: no one to assign". The edit is applied (v0.2) andstewardgets no task.assignAdmins): TASK-00001 is created by Data Steward and assigned to admin only.stewardis not an assignee.none: auto-approved, no taskassignAdmins: task goes to adminUI screen recording:
Not applicable — backend-only fix.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.7ce953bf9cd: no 🔴. Two 🟡:ef5cd7aa01f: the rationale wrongly said nobody could act on the old task (admins bypass the policy); added the upgrade note.docs/decisions/2026-11-25-an-approval-never-goes-to-its-requester.md.🤖 Generated with Claude Code