Skip to main content

set_review_policy

Function set_review_policy 

Source
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 (None keeps it) makes direct obsolete and supersede in the group a 409; requester_cannot_decide and concessions_need_review (None keeps them) are the two rules of step 9. reviewers are active users with the editor role or higher, at most MAX_REQUIRED_REVIEWERS (400). Existing changes already in review keep being evaluated with the policy as it is when they are decided.
  • Audit: project.review_policy with the old and the new values.
  • Notifications / webhooks: none.
  • Atomic: one transaction.