-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreviewpad.yml
135 lines (123 loc) · 4.91 KB
/
reviewpad.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# This file is used to configure Reviewpad.
# The configuration is a proposal to help you get started.
# You can use it as a starting point and customize it to your needs.
# For more details see https://docs.reviewpad.com/guides/syntax.
# Define the version of Reviewpad to be used.
api-version: reviewpad.com/v4.x
mode: verbose # by default "silent"
metrics-on-merge: true # Prints PR Metrics like Coding Time, Pickup Time and Review Time when the PR is merged.
# Define the list of labels to be used by Reviewpad.
# For more details see https://docs.reviewpad.com/guides/syntax#label.
labels:
small:
description: Pull request is small
color: "#76dbbe"
medium:
description: Pull request is medium
color: "#2986cc"
large:
description: Pull request is large
color: "#c90076"
# Define the list of workflows to be run by Reviewpad.
# A workflow is a list of actions that will be executed based on the defined rules.
# For more details see https://docs.reviewpad.com/guides/syntax#workflow.
workflows:
- name: test-check-run-conclusion
description: for testing purpose only, to be deleted when done
always-run: true
if:
- rule: $checkRunConclusion("build-all-variants") == "success"
extra-actions:
- $addLabel("build success")
# This workflow validates best practices for pull request management.
# This helps developers follow best practices.
- name: best-practices
description: Validate best practices for pull request management
always-run: true
if:
- rule: $hasLinearHistory() == false
extra-actions:
- $warn("Please rebase your pull request on the latest changes")
# This workflow labels pull requests based on the total number of lines changed.
# This helps pick pull requests based on their size and to incentivize small pull requests.
- name: size-labeling
description: Label pull request based on the number of lines changed
always-run: true
if:
- rule: $size() < 100
extra-actions:
- $removeLabels(["medium", "large"])
- $addLabel("small")
- rule: $size() >= 100 && $size() < 300
extra-actions:
- $removeLabels(["small", "large"])
- $addLabel("medium")
- rule: $size() >= 300
extra-actions:
- $removeLabels(["small", "medium"])
- $addLabel("large")
# This workflow signals pull requests waiting for reviews.
# This helps guarantee that pull requests are reviewed and approved by at least one person.
#- name: check-approvals
# description: Check that pull requests have the required number of approvals
# always-run: true
# if:
# # Label pull requests with `waiting-for-review` if there are no approvals;
# - rule: $isDraft() == false && $approvalsCount() < 1
# extra-actions:
# - $addLabel("waiting-for-review")
# - rule: $isDraft() == false && $approvalsCount() >= 1
# extra-actions:
# - $removeLabel("waiting-for-review")
- name: change-type-labelling
description: Label pull requests based on the type of changes
always-run: true
if:
# Label pull requests with `docs` if they only modify Markdown or txt files.
- rule: $hasFileExtensions([".md", ".txt"])
extra-actions:
- $addLabel("docs")
# Label pull requests with `pipeline` if they modify GitHub workflows.
- rule: $hasFilePattern(".github/workflows/**")
extra-actions:
- $addLabel("infra")
# Label pull requests with `dependencies` if they only modify any `build.gradle`files.
- rule: $hasFileExtensions(["build.gradle"])
extra-actions:
- $addLabel("dependencies/config")
- name: auto-merge-docs-changes
description: Auto merge PRs only about documentation changes
alwars-run: true
if:
- rule: $hasFileExtensions([".md", ".txt"]) && $checkRunConclusion("build-all-variants") == "success"
then:
- $approve("auto-merge-docs-changes")
- $merge("rebase")
- name: license-validation
description: Validate that licenses are not modified
always-run: true
if:
- rule: $hasFilePattern("**/LICENSE*")
extra-actions:
- $fail("License files cannot be modified")
- name: attention-set
if:
- rule: $isWaitingForReview()
extra-actions:
- $addLabel("waiting-review")
- rule: $isWaitingForReview() == false
extra-actions:
- $removeLabel("waiting-review")
- rule: $hasUnaddressedThreads()
extra-actions:
- $addLabel("requires-author-attention")
- rule: $hasUnaddressedThreads() == false
extra-actions:
- $removeLabel("requires-author-attention")
- name: reviewer-assignment
description: Assign a reviewer to pull requests
always-run: true
if:
- rule: $isDraft() == false
extra-actions:
- $assignReviewer(["michaelheiniger", "qscqlmpa"], 1, "round-robin")