Skip to content

Commit a53ccdd

Browse files
Merge pull request #125 from kube-tarian/reviewpad/configure
feat: reviewpad onboarding
2 parents cf38d3a + 9316c31 commit a53ccdd

File tree

1 file changed

+147
-0
lines changed

1 file changed

+147
-0
lines changed

reviewpad.yml

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
always-run: true
27+
if:
28+
# Summarize the pull request on pull request synchronization.
29+
- rule: ($eventType() == "synchronize" || $eventType() == "opened") && $state() == "open"
30+
extra-actions:
31+
- $summarize()
32+
33+
# This workflow assigns the most relevant reviewer to pull requests.
34+
# This helps guarantee that most pull requests are reviewed by at least one person.
35+
- name: reviewer-assignment
36+
description: Assign the most relevant reviewer to pull requests
37+
always-run: true
38+
if:
39+
# Automatically assign reviewer when the pull request is ready for review;
40+
- rule: $isDraft() == false
41+
extra-actions:
42+
- $assignCodeAuthorReviewers()
43+
44+
# This workflow praises contributors on their pull request contributions.
45+
# This helps contributors feel appreciated.
46+
- name: praise-contributors-on-milestones
47+
description: Praise contributors based on their contributions
48+
always-run: true
49+
if:
50+
# Praise contributors on their first pull request.
51+
- rule: $pullRequestCountBy($author()) == 1
52+
extra-actions:
53+
- $commentOnce($sprintf("Thank you @%s for this first contribution!", [$author()]))
54+
55+
# This workflow validates that pull requests follow the conventional commits specification.
56+
# This helps developers automatically generate changelogs.
57+
# For more details, see https://www.conventionalcommits.org/en/v1.0.0/.
58+
- name: check-conventional-commits
59+
description: Validate that pull requests follow the conventional commits
60+
always-run: true
61+
if:
62+
- rule: $isDraft() == false
63+
then:
64+
# Check commits messages against the conventional commits specification
65+
- $commitLint()
66+
# Check pull request title against the conventional commits specification.
67+
- $titleLint()
68+
69+
# This workflow validates best practices for pull request management.
70+
# This helps developers follow best practices.
71+
- name: best-practices
72+
description: Validate best practices for pull request management
73+
always-run: true
74+
if:
75+
# Warn pull requests that do not have an associated GitHub issue.
76+
- rule: $hasLinkedIssues() == false
77+
extra-actions:
78+
- $warn("Please link an issue to the pull request")
79+
# Warn pull requests if their description is empty.
80+
- rule: $description() == ""
81+
extra-actions:
82+
- $warn("Please provide a description for the pull request")
83+
# Warn pull request do not have a clean linear history.
84+
- rule: $hasLinearHistory() == false
85+
extra-actions:
86+
- $warn("Please rebase your pull request on the latest changes")
87+
88+
# This workflow labels pull requests based on the total number of lines changed.
89+
# This helps pick pull requests based on their size and to incentivize small pull requests.
90+
- name: size-labeling
91+
description: Label pull request based on the number of lines changed
92+
always-run: true
93+
if:
94+
- rule: $size() < 100
95+
extra-actions:
96+
- $removeLabels(["medium", "large"])
97+
- $addLabel("small")
98+
- rule: $size() >= 100 && $size() < 300
99+
extra-actions:
100+
- $removeLabels(["small", "large"])
101+
- $addLabel("medium")
102+
- rule: $size() >= 300
103+
extra-actions:
104+
- $removeLabels(["small", "medium"])
105+
- $addLabel("large")
106+
107+
# This workflow signals pull requests waiting for reviews.
108+
# This helps guarantee that pull requests are reviewed and approved by at least one person.
109+
- name: check-approvals
110+
description: Check that pull requests have the required number of approvals
111+
always-run: true
112+
if:
113+
# Label pull requests with `waiting-for-review` if there are no approvals;
114+
- rule: $isDraft() == false && $approvalsCount() < 1
115+
extra-actions:
116+
- $addLabel("waiting-for-review")
117+
118+
# This workflow labels pull requests based on the pull request change type.
119+
# This helps pick pull requests based on their change type.
120+
- name: change-type-labelling
121+
description: Label pull requests based on the type of changes
122+
always-run: true
123+
if:
124+
# Label pull requests with `docs` if they only modify Markdown or txt files.
125+
- rule: $hasFileExtensions([".md", ".txt"])
126+
extra-actions:
127+
- $addLabel("docs")
128+
# Label pull requests with `infra` if they modify Terraform files.
129+
- rule: $hasFileExtensions([".tf"])
130+
extra-actions:
131+
- $addLabel("infra")
132+
# Label pull requests with `dependencies` if they only modify `package.json` and `package.lock` files.
133+
- rule: $hasFileExtensions(["package.json", "package-lock.json"])
134+
extra-actions:
135+
- $addLabel("dependencies")
136+
137+
138+
# This workflow validates that pull requests do not contain changes to the license.
139+
# This helps avoid unwanted license modifications.
140+
- name: license-validation
141+
description: Validate that licenses are not modified
142+
always-run: true
143+
if:
144+
# Fail Reviewpad check on pull requests that modify any LICENSE;
145+
- rule: $hasFilePattern("**/LICENSE*")
146+
extra-actions:
147+
- $fail("License files cannot be modified")

0 commit comments

Comments
 (0)