Skip to content

Commit 1b75d62

Browse files
authored
Merge pull request webpack#4647 from webpack/bot/fixes
fixes to the bot
2 parents b2a6085 + 9a9f2cd commit 1b75d62

File tree

1 file changed

+50
-69
lines changed

1 file changed

+50
-69
lines changed

open-bot.yaml

Lines changed: 50 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ rules:
66
# comment in case of success
77
- filters:
88
open: true
9-
status:
9+
pull_request:
10+
mergeable: true
11+
status_1:
1012
context: "continuous-integration/travis-ci/pr"
11-
ensure:
12-
value: "{{status.state}}"
13+
status_2:
14+
context: "continuous-integration/appveyor/pr"
15+
ensure_1:
16+
value: "{{status_1.state}}"
17+
equals: "success"
18+
ensure_2:
19+
value: "{{status_2.state}}"
1320
equals: "success"
1421
actions:
1522
label:
@@ -21,11 +28,19 @@ rules:
2128
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.
2229
- filters:
2330
open: true
24-
status:
31+
pull_request:
32+
mergeable: true
33+
status_1:
2534
context: "continuous-integration/travis-ci/pr"
26-
ensure:
27-
value: "{{status.state}}"
28-
equals: "failure"
35+
status_2:
36+
context: "continuous-integration/appveyor/pr"
37+
any:
38+
ensure_1:
39+
value: "{{status_1.state}}"
40+
equals: "failure"
41+
ensure_2:
42+
value: "{{status_2.state}}"
43+
equals: "failure"
2944
actions:
3045
label:
3146
add: "PR: CI-not-ok"
@@ -35,7 +50,7 @@ rules:
3550
message: |-
3651
@{{issue.user.login}} The most important CI builds failed. This way your PR can't be merged.
3752
38-
Please take a look at the [CI results]({{status.target_url}}) and fix these issues.
53+
Please take a look at the CI results from [travis]({{status_1.target_url}}) ({{status_1.state}}) and [appveyor]({{status_2.target_url}}) ({{status_2.state}}) and fix these issues.
3954
4055
4156
@@ -44,29 +59,25 @@ rules:
4459
# comment in case of success
4560
- filters:
4661
open: true
62+
pull_request:
63+
mergeable: true
4764
status:
4865
context: "codecov/patch"
4966
ensure:
5067
value: "{{status.state}}"
5168
equals: "success"
69+
label: "PR: tests-needed"
5270
actions:
5371
label:
5472
remove: "PR: tests-needed"
55-
- filters:
56-
open: true
57-
status:
58-
context: "codecov/patch"
59-
ensure:
60-
value: "{{status.state}}"
61-
equals: "success"
62-
label: "PR: tests-needed"
63-
actions:
6473
comment:
6574
identifier: "tests-result"
6675
message: |-
6776
The minimum test ratio has been reached. Thanks!
6877
- filters:
6978
open: true
79+
pull_request:
80+
mergeable: true
7081
status:
7182
context: "codecov/patch"
7283
ensure:
@@ -77,6 +88,8 @@ rules:
7788
add: "PR: tests-needed"
7889
- filters:
7990
open: true
91+
pull_request:
92+
mergeable: true
8093
status:
8194
context: "codecov/patch"
8295
ensure:
@@ -89,22 +102,29 @@ rules:
89102
comment:
90103
identifier: "tests-result"
91104
message: |-
92-
It looks like this Pull Request doesn't include [enough test cases]({{status.target_url}}).
105+
It looks like this Pull Request doesn't include [enough test cases]({{status.target_url}}) (based on Code Coverage analysis of the PR diff).
106+
107+
A PR need to be covered by tests if you add a new feature (we want to make sure that your feature is working) or if you fix a bug (we want to make sure that we don't run into a regression in future).
93108
94-
@{{issue.user.login}} Please add more test cases.
109+
@{{issue.user.login}} Please check if this is appliable to your PR and if you can add more test cases.
95110
96-
See [test readme](https://github.com/webpack/webpack/blob/master/test/README.md) for details how to write test cases.
111+
Read the [test readme](https://github.com/webpack/webpack/blob/master/test/README.md) for details how to write test cases.
97112
98113
99114
100115
# add conflict label to pull requests with conflict
116+
# on conflict all result labels are removed
101117
- filters:
102118
open: true
103119
pull_request:
104120
mergeable: false
105121
actions:
106122
label:
107123
add: "PR: conflict"
124+
remove:
125+
- "PR: tests-needed"
126+
- "PR: CI-ok"
127+
- "PR: CI-not-ok"
108128
- filters:
109129
open: true
110130
pull_request:
@@ -185,54 +205,27 @@ rules:
185205
state: APPROVED|CHANGES_REQUESTED
186206
actions:
187207
label: "PR: unreviewed"
188-
- filters:
189-
open: true
190-
commit: true
191-
not:
192-
review:
193-
state: APPROVED|CHANGES_REQUESTED
194-
age:
195-
maximum: 1w
196-
actions:
197-
comment:
198-
identifier: "pr-thanks"
199-
message: |-
200-
Thanks for your Pull Request. I labeled the Pull Request, so maintainers will review it.
201208

202209

203210

204-
# add/remove mentioned-sokra label
205-
- filters:
206-
open: true
207-
any:
208-
in_order:
209-
comment_1:
210-
author: "^sokra$"
211-
comment_2: "@sokra"
212-
all:
213-
not:
214-
comment_1:
215-
author: "^sokra$"
216-
comment_2: "@sokra"
217-
actions:
218-
label: "mentioned-sokra"
211+
# add non-master label to pull request to other branch
219212
- filters:
220-
in_order:
221-
comment_1: "@sokra"
222-
comment_2:
223-
author: "^sokra$"
213+
pull_request:
214+
base_ref: "^(?!master)"
224215
actions:
225-
label:
226-
remove: "mentioned-sokra"
216+
label: "PR: non-master"
227217

228218

229219

230-
# add non-master label to pull request to other branch
220+
# add small label to small pull requests
231221
- filters:
222+
open: true
232223
pull_request:
233-
base_ref: "^(?!master)"
224+
additions: "<= 10"
225+
deletions: "<= 10"
226+
changed_files: "<= 2"
234227
actions:
235-
label: "PR: non-master"
228+
label: "PR: small"
236229

237230

238231

@@ -256,15 +249,3 @@ rules:
256249
> Don't submit pull request from your own `master` branch. It's recommended to create a feature branch for the PR.
257250
258251
*You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR.*
259-
260-
261-
262-
# add small label to small pull requests
263-
- filters:
264-
open: true
265-
pull_request:
266-
additions: "<= 10"
267-
deletions: "<= 10"
268-
changed_files: "<= 2"
269-
actions:
270-
label: "PR: small"

0 commit comments

Comments
 (0)