pub async fn set_review_policy(
pool: &PgPool,
actor: &Actor,
project_id: Uuid,
input: &ReviewPolicyInput,
) -> AppResult<ReviewPolicyView>Expand description
Sets the review policy of a group.
§Invariants
- Permission: the actor manages the group (403; a group the actor may not know answers “not found”). The role group must be visible to the actor and a different group (400).
- Locks: the group row (
FOR UPDATE). - Data: the minimum is 1 to 50 or empty (all reviewers); required
obsolete_requires_change(Nonekeeps it) makes direct obsolete and supersede in the group a 409;requester_cannot_decideandconcessions_need_review(Nonekeeps them) are the two rules of step 9. reviewers are active users with the editor role or higher, at mostMAX_REQUIRED_REVIEWERS(400). Existing changes already in review keep being evaluated with the policy as it is when they are decided. - Audit:
project.review_policywith the old and the new values. - Notifications / webhooks: none.
- Atomic: one transaction.