Skip to content

[2.0] Fixes #38921: choose what happens when no one else can approve a step - #38986

Merged
yan-3005 merged 1 commit into
2.0from
backport/2.0/pr-38923
Nov 27, 2026
Merged

yan-3005 merged 1 commit into
2.0from
backport/2.0/pr-38923

Conversation

@yan-3005

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #38921

Hand port of #38923 to 2.0. The release bot's cherry-pick conflicted (29 files), because 2.0 has no wait strategy and lacks the lifecycle-gate changes (#34693) that main's later-step fix builds on. The 2.1 backport is #38968, which merged.

What is ported

  • Workflow builder: the approval step gets If no one else can approve: Approve automatically (none, default) or Assign to admins. On a task workflow (noOp trigger), the default reads Go to the asset's owners, because a task workflow never approves on its own. The doubled margin above the select is gone. The form uses the generated EmptyAssigneeStrategy type.
  • Owner fallback (TaskRepository.setDefaultAssigneesFromEntityOwners): a task created with no assignee never falls back to its creator. Under assignAdmins with the requester as the only admin, [2.0] Fixes 38699: Never give an approval back to its requester (#38708) #38829 keeps the task open with no assignee, and this fallback could then assign the requester, who as filer cannot resolve it.
  • ADR: 2026-11-25-an-approval-never-goes-to-its-requester gets a v2 amendment.

Differences from main

  • No wait: 2.0's enum is none and assignAdmins only, so wait is neither offered nor labelled.
  • The later-approval-step fix is not ported. On 2.0 a second approval step in an entity workflow also reuses the first step's task (CreateTask.resolveRequestedTaskId) and copies its assignees. Fixing that needs Support lifecycle workflow configuration, metadata tasks and metric intake forms #34693. The ADR amendment records this: on 2.0 the hints describe an entity workflow's first approval step.
  • Creator vs requester: 2.0 sets a workflow task's creator from the asset's last editor, so in a narrow race the fallback skips that editor rather than the requester. This is noted in the ADR amendment.
  • Tests adapted to 2.0:
    • UserApprovalForm.test.tsx has no wait cases, and its first case checks the stored strategy only. 2.0's form does not keep other unedited settings.
    • WorkflowOssRestrictions.spec.ts keeps its workflow inert by triggering on table Updated with an include field no table has, instead of main's trigger filter. On 2.0 a stored filter disables the start node's add-filter button, which another test in that spec checks.

Type of change:

  • Bug fix

Tests:

All run locally on this branch, on MySQL + Elasticsearch 9.3.0:

  • Backend unit: SetApprovalAssigneesImplTest 17 + TaskRepositoryAssigneesTest 4 (new) = 21 run, 0 failures.
  • WorkflowDefinitionResourceIT (whole class, including the new test_taskWithoutAssigneesNeverFallsBackToItsCreator): 92 run, 0 failures, 0 errors, 9 skipped. The 9 skips were already skipped on 2.0.
  • TaskResourceIT + DataAccessRequestValidationIT: 295 run, 0 failures, 25 skipped.
  • UI Jest: UserApprovalForm.test.tsx 9/9, and the WorkflowDefinitions suites pass. ESLint and Prettier are clean on the changed files. tsc reports no errors in them. yarn i18n is in sync, and the 8 new keys are translated in all 20 locales.
  • Playwright against a 2.0 server built from this branch, with the production UI build: WorkflowOssRestrictions.spec.ts + NoOpWorkflowNodeConfig.spec.ts 28 passed.
  • lint:playwright reports stale suppressions in unrelated 2.0 specs (TestDefinitionPermissions, GlossaryMutualExclusivity). They were already on 2.0, and this PR leaves them untouched.

Checklist:

  • I have read CONTRIBUTING.md.
  • My PR is linked to a GitHub issue via Fixes #38921 above.
  • I have added tests and listed them above.
  • Self-review: a fresh-context review against REVIEW.md found no 🔴. Its two 🟡 caveats, the first-approval-step scope on 2.0 and creator vs requester, are written into the ADR amendment.

🤖 Generated with Claude Code

…a step

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.
@yan-3005
yan-3005 requested review from a team as code owners November 27, 2026 12:13
@yan-3005
yan-3005 requested review from IceS2 and anuj-kumary and removed request for a team November 27, 2026 12:13
@github-actions

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.

@gitar-bot

gitar-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

The workflow option can automatically approve changes when no independent approver exists, potentially bypassing required human sign-off on governed updates.

Adds an "If no one else can approve" setting to approval steps in the workflow builder, with none (approve automatically) and assignAdmins options, and stops task owner fallback from assigning the task creator when no assignee exists. 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 merged commit 33dba4a into 2.0 Nov 27, 2026
67 of 69 checks passed
@yan-3005
yan-3005 deleted the backport/2.0/pr-38923 branch November 27, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant