Repository navigation
Fixes #38921: choose what happens when no one else can approve a step - #38923
Conversation
The approval step form saved emptyAssigneeStrategy but showed no control for it, so switching a step to assignAdmins or wait needed an API edit. Add a Select with all three schema values, each with a hint, and a note that the setting also covers an approver who made the change. The form's hand-written 'none' | 'assignAdmins' types become the generated EmptyAssigneeStrategy, so a step saved with wait shows it instead of a blank select. The OSS restrictions spec now picks Assign to admins and asserts the PUT; its workflow skips every real table so other workers' tables never open admin tasks.
Under assignAdmins, when the requester is the only admin, the owner fallback can still route the task to the asset's owners, so "never to the person who made the change" overpromised; "no one is asked to approve their own change" did too, and the none hint's "task stays unassigned" ignored the same fallback. List the default option first, check the saved strategy after reopening the step, and name the trigger filter for what it does (it excludes every table).
A task workflow (noOp trigger) never approves on its own: SetApprovalAssigneesImpl keeps hasAssignees true for workflow-managed tasks, and the owner fallback sends the open task to the asset's owners. Its read-only approval step showed "Approve automatically" for the default; it now shows "Go to the asset's owners" with a matching hint.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
…s own Owner fallback: a task created with no assignee fell back to all the asset's owners, so under assignAdmins with the requester as the only admin it could assign the requester, who as filer cannot resolve it. The fallback now skips the task's creator. Later approval steps: the first step's CreateTask leaves taskEntityId at process scope, and a step read any taskEntityId as a task workflow's, so a second step with nobody to ask opened a task under none instead of approving. A taskEntityId whose task belongs to an entity-event workflow no longer counts. UI: the builder offers Approve automatically and Assign to admins; a step that already stores wait still shows it. The Assign to admins hint names the owner fallback, and the doubled margin above the select is gone. ADR 2026-11-25 gets a v2 amendment.
Code Review ✅ Approved 🔴 High riskExposing automatic approval when no eligible approver exists, including at later steps, could let workflow changes bypass human review. Adds an If no one else can approve select to the approval step with 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 |
…#38923) (#38968) * Fixes #38921: choose what happens when no one else can approve a step The approval step form saved emptyAssigneeStrategy but showed no control for it, so switching a step to assignAdmins or wait needed an API edit. Add a Select with all three schema values, each with a hint, and a note that the setting also covers an approver who made the change. The form's hand-written 'none' | 'assignAdmins' types become the generated EmptyAssigneeStrategy, so a step saved with wait shows it instead of a blank select. The OSS restrictions spec now picks Assign to admins and asserts the PUT; its workflow skips every real table so other workers' tables never open admin tasks. * Word the no-approver hints to match what the backend does Under assignAdmins, when the requester is the only admin, the owner fallback can still route the task to the asset's owners, so "never to the person who made the change" overpromised; "no one is asked to approve their own change" did too, and the none hint's "task stays unassigned" ignored the same fallback. List the default option first, check the saved strategy after reopening the step, and name the trigger filter for what it does (it excludes every table). * Show the task-workflow outcome for none on noOp workflows A task workflow (noOp trigger) never approves on its own: SetApprovalAssigneesImpl keeps hasAssignees true for workflow-managed tasks, and the owner fallback sends the open task to the asset's owners. Its read-only approval step showed "Approve automatically" for the default; it now shows "Go to the asset's owners" with a matching hint. * Never hand a task back to its creator; let a later step approve on its own Owner fallback: a task created with no assignee fell back to all the asset's owners, so under assignAdmins with the requester as the only admin it could assign the requester, who as filer cannot resolve it. The fallback now skips the task's creator. Later approval steps: the first step's CreateTask leaves taskEntityId at process scope, and a step read any taskEntityId as a task workflow's, so a second step with nobody to ask opened a task under none instead of approving. A taskEntityId whose task belongs to an entity-event workflow no longer counts. UI: the builder offers Approve automatically and Assign to admins; a step that already stores wait still shows it. The Assign to admins hint names the owner fallback, and the doubled margin above the select is gone. ADR 2026-11-25 gets a v2 amendment. * Regenerate the Playwright impact map (cherry picked from commit 52d2fd2) Co-authored-by: Ram Narayan Balaji <81347100+yan-3005@users.noreply.github.com>
…a step (#38986) Hand port of #38923 to 2.0. The workflow builder's approval step gets an "If no one else can approve" select for emptyAssigneeStrategy: Approve automatically (none, default) or Assign to admins. On a task workflow (noOp trigger) the default reads "Go to the asset's owners", since a task workflow never approves on its own. The doubled margin above the select is gone. The owner fallback for a task created with no assignee never assigns the task's creator: under assignAdmins with the requester as the only admin, it could hand the requester their own task, which as filer they cannot resolve. Differences from main: 2.0 has no wait strategy, so it is neither offered nor labelled. The later-approval-step fix is not ported: on 2.0 a later step also reuses the earlier step's task in CreateTask, which needs the lifecycle-gate changes (#34693) that 2.0 lacks.
Describe your changes:
Fixes #38921
The approval step in the workflow builder already loaded and saved
emptyAssigneeStrategy, but it had no control for it, so changing it meant editing the workflow definition through the API. This adds a select, If no one else can approve, and fixes two backend paths that could still hand a task to the person whose change started it.noneassignAdminsA note under the select says the setting applies when the step finds no approver, or when its only approver is the person who made the change. That is the case behind #38699 / #38708.
UI
waitis not offered. A task nobody is asked to act on helps no one. A step that already storeswait(set through the API, or an older Collate lifecycle playbook) still shows it as Keep open, unassigned, so its value never goes blank or changes silently.none, which is the backend default (Assignees__1defaults toNONE).'none' | 'assignAdmins'type is now the generatedEmptyAssigneeStrategy(form,WorkflowTypes.interface.ts,WorkflowNodeConfigUtils.ts). A future schema value will fail the TypeScript build until it gets a label.tw:mb-6.Backend
TaskRepository.setDefaultAssigneesFromEntityOwners). A task created with no assignee falls back to the asset's owners unless its step chosewait. UnderassignAdmins, with the requester as the only admin, that fallback could assign the requester, who as filer cannot resolve it. This applies to every task, not only approvals: a filer can never resolve their own task, so assigning them helped no one.SetApprovalAssigneesImpl). The first step'sCreateTaskleavestaskEntityIdat process scope, and anytaskEntityIdmarked the step as a task workflow's. So a second step with nobody to ask opened a task undernoneinstead of approving. Now ataskEntityIdwhose task belongs to an entity-event workflow no longer counts. Task workflows, whose start setstaskWorkflowManagedand their owntaskEntityId, behave as before.No migration. No schema or SQL change, and existing definitions keep their stored value.
ADR:2026-11-25-an-approval-never-goes-to-its-requestergets a v2 amendment for both backend paths.Type of change:
High-level design:
SelectinUserApprovalForm.tsx, on the same pattern asApprovalModeSection. The options map (label and hint key per value), the task-workflow label fornoneand the offered choices live in the siblingUserApprovalForm.constants.ts. Ten i18n keys, translated in all 20 non-English locales.TaskRepository.setDefaultAssigneesFromEntityOwnersdrops the creator from the owner list.SetApprovalAssigneesImpl.isTaskWorkflowSteploads the task behindtaskEntityIdand ignores it when its workflow is entity-event; the same checkresolveCurrentTaskAssigneesandCreateTaskalready make.Tests:
Use cases covered
waitalso lists Keep open, unassigned.Unit tests
yarn test src/components/WorkflowDefinitions src/utils/WorkflowNodeConfigUtils.test.ts src/hooks/useWorkflowMode.test.ts: 235/235 passed.SetApprovalAssigneesImplTest,TaskRepositoryAssigneesTest,UserApprovalTaskTest: 58 run, 0 failures, 0 errors. The 3 new backend tests fail on the code without the fix (checked).Backend integration tests
WorkflowDefinitionResourceIT, which addstest_secondApprovalStepWithNobodyToAskApprovesOnItsOwnandtest_taskWithoutAssigneesNeverFallsBackToItsCreator.WorkflowDefinitionResourceIT(whole class, isolated lane): 178 run, 0 failures, 0 errors.WorkflowTaskAssigneesIT,TaskResourceIT,IndependentOntologyReviewRuleIT,UserHardDeleteWithSoftDeletedTaskIT,DataAccessRequestValidationIT(parallel lane): 339 run, 0 failures, 0 errors, 31 skipped. The skips are inTaskResourceITand predate this change.test_secondApprovalStepWithNobodyToAskApprovesOnItsOwnwith the old task-workflow detection put back: fails. The second step opens a task and the run never ends.Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Features/Workflows/WorkflowOssRestrictions.spec.ts(OSS lane): the edit-mode test picks Assign to admins withchooseSelectOption, asserts the PUT body, then reopens the step and checks the saved value. The spec's trigger now excludes every table, so other workers' tables never open admin tasks while it is deployed.WorkflowOssRestrictions.spec.ts+NoOpWorkflowNodeConfig.spec.ts: 9 passed on the final code.Features/Workflowsfolder: 32 passed, 1 failed. The failure wasChangeRequestReviewLifecycle.spec.ts:363, a timeout under 3 workers, which passed 10/10 alone.UserApprovalWorkflow.spec.ts(the select is visible and defaults to Approve automatically). It passed (4/4) against a Collate build carrying this OSS change, and lands with the submodule bump after this merges.Manual testing performed
localhost:8585, and signed in asadmin.DescriptionUpdateTaskWorkflow. Its read-only approval step showed Go to the asset's owners.UI screen recording:
Screenshots from the local server built from this branch (commit
224c714e578;0a25497c1d6changes only the ADR text and a test comment):Default:

The choices:

Assign to admins selected:

A seeded task workflow (read-only):

Checklist:
I have read CONTRIBUTING.md (the pre-review gate) and the contributor docs.
My PR title is
Fixes <issue-number>: <short explanation>My PR is linked to a GitHub issue via
Fixes #<issue-number>above.I have commented on my code, particularly in hard-to-understand areas.
For JSON Schema changes: not applicable, no schema change.
For a UI feature or feature task: screenshots from a local build of this branch are above; no Docker recording.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
Self-review: I reviewed the final diff against
REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.REVIEW.md. The last, on224c714e578, found one 🔴: the ADR amendment overstated the task-workflow rule. It is fixed in0a25497c1d6by making the ADR state exactly what the code does, along with a 🟡 comment wrap; both are doc and comment changes only.Decision check:
ADR:2026-11-25-an-approval-never-goes-to-its-requesterv2 records the owner-fallback and later-step rules.I have added a test that covers the exact scenario we are fixing.
🤖 Generated with Claude Code