Repository navigation
Backport to 2.1: cap the approval threshold at the users able to vote - #37651
Conversation
Self-approval prevention removes the requester from the assignees, so a fixed threshold could exceed the remaining voters and leave the task open forever (e.g. owner + reviewer, threshold 2, reviewer made the change). Backport of #37648 to 2.1.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
The review policy attached to a change request still carried the node threshold, so the only eligible reviewer's approval read as a disagreement.
With the requester removed, a rejection threshold above the remaining voters could never be met either, leaving a rejected task open.
Code Review ✅ Approved 🔴 High risk 1 closed / 1 findingsCapping approval and change-request thresholds to eligible users could let governed changes proceed with fewer independent approvals. Caps the User Approval task threshold at the number of assignees when all assignees are users, so tasks can no longer stay open when the threshold exceeds eligible voters. Also applies the same cap to the change-request ReviewPolicy threshold. Resolved the finding that the cap contradicted the ontology ADR's allAssignees threshold rule. No open issues found. ✅ 1 closed✅ Quality: Cap contradicts the ontology ADR's allAssignees threshold rule
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 |
Describe your changes:
Backport of #37648 to
2.1.A User Approval task could stay open forever when the approval threshold was higher than the number of users left to vote. A customer on 2.0.7 hit this: a data contract with one owner and one reviewer had threshold 2. When the reviewer made the change, self-approval prevention removed them from the assignees. After the owner approved, nobody was left to vote and the task stayed open.
The threshold is now capped at the number of assignees when every assignee is a user. A list holding a team, and an empty list, are not capped. The requester's change is not counted as an approval, because that would be self-approval. Details and rationale are in #37648 and
ADR:2026-11-12-approval-threshold-never-exceeds-eligible-voters.Cherry-pick of both
maincommits, including the follow-up that also caps the change-requestReviewPolicythreshold.The rejection threshold gets the same cap, so the one remaining voter can also reject. A split vote (two voters, thresholds 2/2, one approves and one rejects) can still leave a task open; that predates this change.
Limit: the cap applies when the task is created. Tasks that are already open keep their threshold.
Type of change:
Tests:
CreateTaskTest#approvalThresholdNeverExceedsTheUsersAbleToVote,#changeRequestPolicyNeverRequiresMoreApprovalsThanTheUsersAbleToVotemvn test -pl openmetadata-service -Dtest=CreateTaskTest,UserApprovalTaskTeston this branch: CreateTaskTest 86/86 pass.Checklist:
docs/decisions/2026-11-12-approval-threshold-never-exceeds-eligible-voters.md.🤖 Generated with Claude Code