Label based on author groups

Here's an example of a Revy configuration that label pull requests authored by a member of a group of developers.

Suppose that, as Spotify, you consider developers new joiner until they create/merge their 10th PR. Each time a new joiner creates a PR, you want to label it in order to be able to perform a dedicated code review process. Using Revy groups you can easily do such labeling.

apiVersion: reviewpad.com/v0.0.4

labels:
  new-joiner:
    description: prs created by new joiners

groups:
  newJoiners:
    description: Group of devs that have created less than 10 PRs
    kind: developers
    type: filter
    param: dev
    where: $totalCreatedPRs($dev) < 10

rules:
  authoredByNewJoiner:
    kind: patch
    description: Patch authored by new joiner
    spec: $isMemberOf($name(), $group("newJoiners"))

protectionGates:
  - name: critical
    description: Modifications by new joiners require careful review
    patchRules:
      - rule: authoredByNewJoiner
    actions:
      - $addLabel("new-joiner")

Did this page help you?