Assign review to a team

An example of assigning a review to a team when touching a specific folder.

apiVersion: reviewpad.com/v0.0.4

rules:
  changesToConfigurations:
    kind: patch
    description: Changes code in configuration folder
    spec: $hasFilePattern("src/config/**")

protectionGates:
  - name: ask
    description: Ask devops team
    patchRules:
      - rule: changesToConfigurations
    actions:
      # Assign the review to the whole devops team
      - $assignReviewer($team("devops"))

An example of assigning a review to a specific number of elements on a team.

apiVersion: reviewpad.com/v0.0.4

rules:
  changesToConfigurations:
    kind: patch
    description: Changes code in configuration folder
    spec: $hasFilePattern("src/config/**")

protectionGates:
  - name: ask
    description: Ask devops team
    patchRules:
      - rule: changesToConfigurations
    actions:
      # Assign the review to 3 random selected reviewers from the devops team
      - $assignReviewer($team("devops"), 3)

An example of assigning a review to a team and a specific element.

apiVersion: reviewpad.com/v0.0.4

rules:
  changesToConfigurations:
    kind: patch
    description: Changes code in configuration folder
    spec: $hasFilePattern("src/config/**")

protectionGates:
  - name: ask
    description: Ask devops team
    patchRules:
      - rule: changesToConfigurations
    actions:
      # Assign the review to john
      - $assignReviewer(["john"])
      # Assign the review to the whole devops team
      - $assignReviewer($team("devops"))

Did this page help you?