|
| 1 | +# This file is used to configure Reviewpad. |
| 2 | +# The configuration is a proposal to help you get started. |
| 3 | +# You can use it as a starting point and customize it to your needs. |
| 4 | +# For more details see https://docs.reviewpad.com/guides/syntax. |
| 5 | + |
| 6 | +# Define the list of labels to be used by Reviewpad. |
| 7 | +# For more details see https://docs.reviewpad.com/guides/syntax#label. |
| 8 | +labels: |
| 9 | + small: |
| 10 | + description: Pull request is small |
| 11 | + color: "#76dbbe" |
| 12 | + medium: |
| 13 | + description: Pull request is medium |
| 14 | + color: "#2986cc" |
| 15 | + large: |
| 16 | + description: Pull request is large |
| 17 | + color: "#c90076" |
| 18 | + |
| 19 | +# Define the list of workflows to be run by Reviewpad. |
| 20 | +# A workflow is a list of actions that will be executed based on the defined rules. |
| 21 | +# For more details see https://docs.reviewpad.com/guides/syntax#workflow. |
| 22 | +workflows: |
| 23 | + # This workflow calls Reviewpad AI agent to summarize the pull request. |
| 24 | + - name: summarize |
| 25 | + description: Summarize the pull request |
| 26 | + run: |
| 27 | + # Summarize the pull request on pull request synchronization. |
| 28 | + - if: ($eventType() == "synchronize" || $eventType() == "opened") && $state() == "open" |
| 29 | + then: $summarize() |
| 30 | + |
| 31 | + # This workflow assigns a random current developer as a reviewer |
| 32 | + - name: reviewer-assignment |
| 33 | + description: Assign a random reviewer to pull requests |
| 34 | + run: |
| 35 | + # Automatically assign reviewer when the pull request is ready for review; |
| 36 | + - if: $isDraft() == false |
| 37 | + then: $assignReviewer($team("developers-current"), 1, "reviewpad") |
| 38 | + |
| 39 | + # This workflow labels pull requests based on the total number of lines changed. |
| 40 | + # This helps pick pull requests based on their size and to incentivize small pull requests. |
| 41 | + - name: size-labeling |
| 42 | + description: Label pull request based on the number of lines changed |
| 43 | + run: |
| 44 | + - if: $size() < 100 |
| 45 | + then: $addLabel("small") |
| 46 | + else: $removeLabel("small") |
| 47 | + - if: $size() >= 100 && $size() < 300 |
| 48 | + then: $addLabel("medium") |
| 49 | + else: $removeLabel("medium") |
| 50 | + - if: $size() >= 300 |
| 51 | + then: $addLabel("large") |
| 52 | + else: $removeLabel("large") |
| 53 | + |
| 54 | + # This workflow signals pull requests waiting for reviews. |
| 55 | + # This helps guarantee that pull requests are reviewed and approved by at least one person. |
| 56 | + - name: check-approvals |
| 57 | + description: Check that pull requests have the required number of approvals |
| 58 | + run: |
| 59 | + # Label pull requests with `waiting-for-review` if there are no approvals; |
| 60 | + - if: $isDraft() == false && $approvalsCount() < 1 |
| 61 | + then: $addLabel("waiting-for-review") |
| 62 | + |
0 commit comments