2017-03-30 17:36:27 +08:00
bot : "webpack-bot"
rules :
2017-03-30 20:47:22 +08:00
# Add ci-ok, ci-not-ok labels depending on travis status
# comment to point the user to the results
# comment in case of success
2017-03-30 17:36:27 +08:00
- filters :
open : true
2017-04-06 06:08:59 +08:00
pull_request :
mergeable : true
status_1 :
2017-03-30 17:36:27 +08:00
context : "continuous-integration/travis-ci/pr"
2017-04-06 06:08:59 +08:00
status_2 :
context : "continuous-integration/appveyor/pr"
ensure_1 :
value : "{{status_1.state}}"
equals : "success"
ensure_2 :
value : "{{status_2.state}}"
2017-03-30 18:01:11 +08:00
equals : "success"
2017-03-30 17:36:27 +08:00
actions :
label :
add : "PR: CI-ok"
remove : "PR: CI-not-ok"
comment :
identifier : "ci-result"
message : |-
2017-04-06 00:20:26 +08:00
Thank you for your pull request! The most important CI builds succeeded, we’ ll review the pull request soon.
2017-03-30 17:36:27 +08:00
- filters :
open : true
2017-04-06 06:08:59 +08:00
pull_request :
mergeable : true
status_1 :
2017-03-30 17:36:27 +08:00
context : "continuous-integration/travis-ci/pr"
2017-04-06 06:08:59 +08:00
status_2 :
context : "continuous-integration/appveyor/pr"
any :
ensure_1 :
value : "{{status_1.state}}"
equals : "failure"
ensure_2 :
value : "{{status_2.state}}"
equals : "failure"
2017-08-10 17:45:09 +08:00
not :
any :
ensure_3 :
value : "{{status_1.state}}"
equals : "pending"
ensure_4 :
value : "{{status_2.state}}"
equals : "pending"
2017-03-30 17:36:27 +08:00
actions :
label :
add : "PR: CI-not-ok"
remove : "PR: CI-ok"
2017-04-08 01:20:20 +08:00
set :
id : report_ci
value : yep
2018-05-25 16:43:30 +08:00
# Report specific error message if jest for basic tests fails
2017-04-08 01:20:20 +08:00
- filters :
ensure :
value : "{{report_ci}}"
equals : yep
commit : true
status :
context : "continuous-integration/travis-ci/pr"
travis_job :
state : "failed"
2017-07-26 18:47:10 +08:00
allow_failure : false
2017-04-08 01:20:20 +08:00
config :
2018-05-25 16:43:30 +08:00
env : JOB_PART=basic
2017-04-08 01:20:20 +08:00
fetch : travis_job.log
string_cleanup :
id : logResult
value : "{{{fetch}}}"
remove :
2018-06-04 13:24:12 +08:00
- ".\\[2K.\\[1G|.\\[999D.\\[K"
2018-05-25 16:43:30 +08:00
- "^[\\s\\S]+?\\$ yarn travis:\\$JOB_PART.*\n"
- "\\$ node --max-old-space-size=4096.*\n"
2018-06-04 13:16:15 +08:00
- ".+rimraf coverage"
- "yarn run.+\n"
- "\\(node:\\d+\\) (\\[DEP0005\\]|DeprecationWarning).+\n"
2018-05-25 16:43:30 +08:00
- "\\$ yarn (cover|test):.+\n"
- "Ran all test suites.\n[\\s\\S]*"
2018-06-04 13:16:15 +08:00
- "error Command failed with exit code \\d+.\n"
- "info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n"
- "Force exiting Jest\n\nHave you considered.+"
- "=============================== Coverage summary ===============================[\\s\\S]+?================================================================================"
- " *PASS *test/.*\n"
2018-06-04 13:24:12 +08:00
- "^\\s+\n|\\s+$"
2018-03-14 17:33:19 +08:00
string_cleanup_1 :
2018-03-12 18:40:45 +08:00
id : firstError
value : "{{{logResult}}}"
remove :
2018-06-04 13:16:15 +08:00
- "\n\n( ●| FAIL)[\\s\\S]*"
2018-05-25 16:43:30 +08:00
- "Test Suites:[\\s\\S]*"
- "\\s+$"
2018-03-14 17:33:19 +08:00
string_cleanup_2 :
2018-03-12 18:40:45 +08:00
id : remainingErrors
value : "{{{logResult}}}"
remove :
2018-06-04 13:16:15 +08:00
- "^[\\s\\S]+?(?=\n\n( ●| FAIL)|$)"
2018-05-25 16:43:30 +08:00
- "^\n+"
- "Test Suites:[\\s\\S]*"
- "\\s+$"
string_cleanup_3 :
id : summary
value : "{{{logResult}}}"
remove :
- "^[\\s\\S]+?(?=Test Suites:)"
- "\\s+$"
2017-04-08 01:20:20 +08:00
actions :
comment :
identifier : "ci-result"
message : |-
2018-05-25 16:43:30 +08:00
The basic integration tests failed.
2017-04-08 01:20:20 +08:00
@{{commit.author.login}} Please review the following output log for errors :
2018-05-25 16:43:30 +08:00
2018-03-12 18:40:45 +08:00
```text
{{{firstError}}}
```
2018-05-25 16:43:30 +08:00
{{#if remainingErrors}}
2018-03-09 23:45:42 +08:00
<details>
2018-03-12 18:40:45 +08:00
<summary>Show remaining errors</summary>
2018-03-15 01:13:53 +08:00
```text
2018-03-12 18:40:45 +08:00
{{{remainingErrors}}}
2017-04-08 01:20:20 +08:00
```
2018-03-09 23:45:42 +08:00
</details>
2018-05-25 16:43:30 +08:00
{{/if}}
```text
{{{summary}}}
```
2017-04-08 01:20:20 +08:00
See [complete report here]({{status.target_url}}).
set :
id : report_ci
value : nope
2018-05-25 16:43:30 +08:00
# Report specific error message if jest for integration tests fails
2017-10-19 23:45:22 +08:00
- filters :
ensure :
value : "{{report_ci}}"
equals : yep
commit : true
status :
context : "continuous-integration/travis-ci/pr"
travis_job :
state : "failed"
allow_failure : false
config :
2018-05-25 16:43:30 +08:00
env : JOB_PART=integration
2017-10-19 23:45:22 +08:00
fetch : travis_job.log
string_cleanup :
id : logResult
value : "{{{fetch}}}"
remove :
2018-06-04 13:24:12 +08:00
- ".\\[2K.\\[1G|.\\[999D.\\[K"
2018-05-25 16:43:30 +08:00
- "^[\\s\\S]+?\\$ yarn travis:\\$JOB_PART.*\n"
- "\\$ node --max-old-space-size=4096.*\n"
2018-06-04 13:16:15 +08:00
- ".+rimraf coverage"
- "yarn run.+\n"
- "\\(node:\\d+\\) (\\[DEP0005\\]|DeprecationWarning).+\n"
2018-05-25 16:43:30 +08:00
- "\\$ yarn (cover|test):.+\n"
- "The command \"yarn travis:\\$JOB_PART\" exited[\\s\\S]*"
2018-06-04 13:16:15 +08:00
- "Ran all test suites.+\n"
- "error Command failed with exit code \\d+.\n"
- "info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n"
- "Force exiting Jest\n\nHave you considered.+"
- "=============================== Coverage summary ===============================[\\s\\S]+?================================================================================"
- " *PASS *test/.*\n"
2018-06-04 13:24:12 +08:00
- "^\\s+\n|\\s+$"
2018-05-25 16:43:30 +08:00
string_cleanup_1 :
id : firstError
value : "{{{logResult}}}"
remove :
2018-06-04 13:16:15 +08:00
- "\n\n( ●| FAIL)[\\s\\S]*"
2018-05-25 16:43:30 +08:00
- "Test Suites:[\\s\\S]*"
- "\\s+$"
string_cleanup_2 :
id : remainingErrors
value : "{{{logResult}}}"
remove :
2018-06-04 13:16:15 +08:00
- "^[\\s\\S]+?(?=\n\n( ●| FAIL)|$)"
2018-05-25 16:43:30 +08:00
- "^\n+"
- "Test Suites:[\\s\\S]*"
- "\\s+$"
string_cleanup_3 :
id : summary
value : "{{{logResult}}}"
remove :
- "^[\\s\\S]+?(?=Test Suites:)"
- "\\s+$"
2017-10-19 23:45:22 +08:00
actions :
comment :
identifier : "ci-result"
message : |-
2018-05-25 16:43:30 +08:00
The basic integration tests succeeded, but the full suite failed.
2017-10-19 23:45:22 +08:00
@{{commit.author.login}} Please review the following output log for errors :
2018-05-25 16:43:30 +08:00
```text
{{{firstError}}}
2017-10-19 23:45:22 +08:00
```
2018-05-25 16:43:30 +08:00
{{#if remainingErrors}}
<details>
<summary>Show remaining errors</summary>
2017-10-19 23:45:22 +08:00
2018-05-25 16:43:30 +08:00
```text
{{{remainingErrors}}}
```
</details>
{{/if}}
```text
{{{summary}}}
```
2017-10-19 23:45:22 +08:00
See [complete report here]({{status.target_url}}).
set :
id : report_ci
value : nope
2018-05-25 16:43:30 +08:00
# Report specific error message if jest for unit tests or liniting fails
2017-04-08 01:20:20 +08:00
- filters :
ensure :
value : "{{report_ci}}"
equals : yep
commit : true
status :
context : "continuous-integration/travis-ci/pr"
travis_job :
state : "failed"
2018-05-25 16:43:30 +08:00
allow_failure : false
2017-04-08 01:20:20 +08:00
config :
2018-05-25 16:43:30 +08:00
env : JOB_PART=lint-unit
2017-04-08 01:20:20 +08:00
fetch : travis_job.log
string_cleanup :
id : logResult
value : "{{{fetch}}}"
remove :
2018-06-04 13:24:12 +08:00
- ".\\[2K.\\[1G|.\\[999D.\\[K"
2018-05-25 16:43:30 +08:00
- "^[\\s\\S]+?\\$ yarn travis:\\$JOB_PART.*\n"
- "\\$ node --max-old-space-size=4096.*\n"
2018-06-04 13:16:15 +08:00
- ".+rimraf coverage"
- "yarn run.+\n"
- "\\(node:\\d+\\) (\\[DEP0005\\]|DeprecationWarning).+\n"
2018-05-25 16:43:30 +08:00
- "\\$ yarn (unit|lint).+\n"
- "The command \"yarn travis:\\$JOB_PART\" exited[\\s\\S]*"
2018-06-04 13:16:15 +08:00
- "Ran all test suites.+\n"
- "error Command failed with exit code \\d+.\n"
- "info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n"
- "Force exiting Jest\n\nHave you considered.+"
- "=============================== Coverage summary ===============================[\\s\\S]+?================================================================================"
- " *PASS *test/.*\n"
2018-06-04 13:24:12 +08:00
- "^\\s+\n|\\s+$"
2017-04-08 01:20:20 +08:00
actions :
comment :
identifier : "ci-result"
message : |-
2018-05-25 16:43:30 +08:00
The integration tests look fine, but there are code style issues or unit test failures in the Pull Request.
@{{commit.author.login}} Please review the following output log for errors :
2017-04-08 01:20:20 +08:00
``` text
{{{logResult}}}
```
2018-05-25 16:43:30 +08:00
If the unit tests are outdated, you can choose to delete them and add integration tests instead. That would be great.
2017-04-08 01:20:20 +08:00
See [complete report here]({{status.target_url}}).
set :
id : report_ci
value : nope
# Report a general error message
- filters :
ensure :
value : "{{report_ci}}"
equals : yep
commit : true
status_1 :
context : "continuous-integration/travis-ci/pr"
status_2 :
context : "continuous-integration/appveyor/pr"
actions :
2017-04-01 07:27:32 +08:00
comment :
2017-03-30 17:36:27 +08:00
identifier : "ci-result"
message : |-
2017-04-08 01:20:20 +08:00
@{{commit.author.login}} The most important CI builds failed. This way your PR can't be merged.
2017-04-01 07:27:32 +08:00
2017-04-06 06:08:59 +08:00
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.
2017-04-01 07:27:32 +08:00
2017-04-08 01:20:20 +08:00
2018-02-26 10:26:28 +08:00
# Add tests-needed label depending on codecov status
2017-03-30 21:05:40 +08:00
# comment to point the user writing test cases
# comment in case of success
- filters :
open : true
2017-04-06 06:10:42 +08:00
pull_request :
mergeable : true
2017-03-30 21:05:40 +08:00
status :
2017-10-19 21:40:40 +08:00
context : "codecov/patch/integration"
2017-03-30 21:05:40 +08:00
ensure :
value : "{{status.state}}"
equals : "success"
2017-04-06 06:09:30 +08:00
label : "PR: tests-needed"
2017-03-30 21:05:40 +08:00
actions :
label :
remove : "PR: tests-needed"
comment :
identifier : "tests-result"
message : |-
The minimum test ratio has been reached. Thanks!
2017-04-05 04:20:23 +08:00
- filters :
open : true
2017-04-06 06:10:42 +08:00
pull_request :
mergeable : true
2017-04-05 04:20:23 +08:00
status :
2017-10-19 21:40:40 +08:00
context : "codecov/patch/integration"
2017-04-05 04:20:23 +08:00
ensure :
value : "{{status.state}}"
equals : "failure"
actions :
label :
add : "PR: tests-needed"
2017-03-30 21:05:40 +08:00
- filters :
open : true
2017-04-06 06:10:42 +08:00
pull_request :
mergeable : true
2017-03-30 21:05:40 +08:00
status :
2017-10-19 21:40:40 +08:00
context : "codecov/patch/integration"
2017-03-30 21:05:40 +08:00
ensure :
value : "{{status.state}}"
equals : "failure"
2017-04-05 00:40:59 +08:00
age :
value : "{{status.created_at}}"
minimum : 1h
2017-04-08 01:20:20 +08:00
permission : "read|none"
2017-03-30 21:05:40 +08:00
actions :
2017-04-01 07:27:32 +08:00
comment :
2017-03-30 21:05:40 +08:00
identifier : "tests-result"
message : |-
2017-04-06 06:09:51 +08:00
It looks like this Pull Request doesn't include [enough test cases]({{status.target_url}}) (based on Code Coverage analysis of the PR diff).
2017-04-01 07:27:32 +08:00
2017-04-06 06:09:51 +08:00
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).
2017-04-01 07:27:32 +08:00
2017-04-06 06:09:51 +08:00
@{{issue.user.login}} Please check if this is appliable to your PR and if you can add more test cases.
Read the [test readme](https://github.com/webpack/webpack/blob/master/test/README.md) for details how to write test cases.
2017-03-30 21:05:40 +08:00
2017-04-05 20:25:06 +08:00
# add conflict label to pull requests with conflict
2017-04-06 06:10:42 +08:00
# on conflict all result labels are removed
2017-04-05 20:25:06 +08:00
- filters :
open : true
pull_request :
mergeable : false
actions :
label :
add : "PR: conflict"
2017-04-06 06:10:42 +08:00
remove :
- "PR: tests-needed"
- "PR: CI-ok"
- "PR: CI-not-ok"
2017-04-05 20:25:06 +08:00
- filters :
open : true
pull_request :
mergeable : true
actions :
label :
remove : "PR: conflict"
2017-03-30 20:47:22 +08:00
# add unreviewed, reviewed, review-outdated labels
# comment to ping reviewer
# comment on new PR
- filters :
open : true
in_order :
commit : true
review :
state : APPROVED|CHANGES_REQUESTED
2017-04-01 07:27:32 +08:00
ensure :
value : "{{review.state}}"
equals : APPROVED
2018-02-22 03:25:22 +08:00
permission :
user : "{{review.user.login}}"
2017-03-30 20:47:22 +08:00
actions :
label :
2017-04-01 07:27:32 +08:00
add : "PR: reviewed-approved"
2017-03-30 20:47:22 +08:00
remove :
- "PR: review-outdated"
- "PR: unreviewed"
2017-04-01 07:27:32 +08:00
- "PR: reviewed"
- filters :
open : true
in_order :
commit : true
review :
state : APPROVED|CHANGES_REQUESTED
2018-02-22 03:25:22 +08:00
permission :
user : "{{review.user.login}}"
2017-04-01 07:27:32 +08:00
ensure :
value : "{{review.state}}"
equals : CHANGES_REQUESTED
actions :
label :
add : "PR: reviewed-changes-requested"
remove :
- "PR: review-outdated"
- "PR: unreviewed"
- "PR: reviewed"
2017-03-30 20:47:22 +08:00
- filters :
open : true
in_order :
review :
state : APPROVED|CHANGES_REQUESTED
commit : true
2018-02-22 03:25:22 +08:00
permission :
user : "{{review.user.login}}"
2017-04-04 16:31:54 +08:00
not :
label : "review-outdated"
ensure :
value : "{{commit.author.login}}"
notEquals : "{{review.user.login}}"
2017-03-30 20:47:22 +08:00
actions :
label :
add : "PR: review-outdated"
remove :
2017-04-01 07:27:32 +08:00
- "PR: reviewed-approved"
- "PR: reviewed-changes-requested"
2017-03-30 20:47:22 +08:00
- "PR: unreviewed"
2017-04-01 07:27:32 +08:00
- "PR: reviewed"
2017-03-30 21:13:08 +08:00
comment :
identifier : "review-outdated"
2017-03-30 21:13:53 +08:00
message : |-
2017-04-01 07:27:32 +08:00
@{{commit.author.login}} Thanks for your update.
2017-03-30 21:13:08 +08:00
I labeled the Pull Request so reviewers will review it again.
2017-04-01 07:27:32 +08:00
2017-03-30 21:13:08 +08:00
@{{review.user.login}} Please review the new changes.
2017-03-30 20:47:22 +08:00
- filters :
open : true
commit : true
not :
review :
state : APPROVED|CHANGES_REQUESTED
actions :
label : "PR: unreviewed"
2017-04-01 07:27:32 +08:00
2017-09-11 18:13:17 +08:00
# add non-master and next label to pull request to other branch
- filters :
pull_request :
base_ref : "^master$"
actions :
label :
remove : "PR: non-master"
2017-04-01 07:27:32 +08:00
- filters :
2017-04-06 06:12:17 +08:00
pull_request :
2017-09-11 18:13:17 +08:00
base_ref : "^next$"
2017-04-01 07:27:32 +08:00
actions :
2017-09-11 18:13:17 +08:00
label :
add : "PR: next"
remove : "PR: non-master"
- filters :
pull_request :
base_ref : "^(?!master$)(?!next$)"
actions :
label :
add : "PR: non-master"
remove : "PR: next"
2017-04-01 07:27:32 +08:00
# add non-master label to pull request to other branch
- filters :
2017-04-05 00:40:59 +08:00
open : true
age :
minimum : 1d
maximum : 1w
2017-04-01 07:27:32 +08:00
pull_request :
head_ref : "^master$"
2017-04-08 01:20:20 +08:00
permission : "read|none"
2017-04-01 07:27:32 +08:00
actions :
comment :
identifier : "head-master"
edit : true
message : |-
Hi @{{pull_request.user.login}}.
2017-04-05 00:40:59 +08:00
Just a little hint from a friendly bot about the best practice when submitting pull requests :
2017-04-01 07:27:32 +08:00
> Don't submit pull request from your own `master` branch. It's recommended to create a feature branch for the PR.
*You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR.*
2017-04-08 01:20:20 +08:00
2018-02-19 22:30:38 +08:00
# add "Send a PR" label when somebody with write permission say it
- filters :
open : true
comment : "[Ss]end a [Pp][Rr]"
permission :
user : "{{comment.actor.login}}"
actions :
label : "Send a PR"
2017-04-08 01:20:20 +08:00
# Move issue task
- filters :
open : true
2017-04-08 16:08:30 +08:00
comment : "\\s*@webpack-bot\\s+move\\s+(?:to\\s+)?([a-z0-9_\\-\\.]+/[a-z0-9_\\-\\.]+)\\s*([\\s\\S]*)$"
2017-04-08 01:20:20 +08:00
not :
comment_1 :
2017-04-08 15:11:52 +08:00
matching : "moved\\-by\\-bot"
2017-04-08 01:20:20 +08:00
author : "."
permission :
user : "{{comment.actor.login}}"
actions :
new_issue :
2017-04-08 15:49:44 +08:00
target : "{{{comment_match.[1]}}}"
2017-04-08 01:20:20 +08:00
body : |-
2017-04-08 15:49:44 +08:00
{{{issue.body}}}
2017-04-08 15:12:53 +08:00
2017-04-08 01:20:20 +08:00
---
2018-02-26 10:37:18 +08:00
This issue was moved from {{owner}}/{{repo}}#{{issue.number}} by @{{comment.actor.login}}. Original issue was by @{{issue.user.login}}.
2017-04-08 01:20:20 +08:00
2017-04-08 15:49:44 +08:00
{{{comment_match.[2]}}}
2017-04-08 01:20:20 +08:00
comment :
identifier : moved-by-bot
message : |-
I've moved it to {{comment_match.[1]}}.
close : true
2017-08-10 17:35:25 +08:00
# mark inactive issues with inactive label
# close them when no activity after warning
- filters :
issue : true
open : true
not :
label : inactive
ensure :
value : "{{issue.reactions.[+1]}}"
range : "< 10"
2018-06-27 17:06:02 +08:00
last_action_age : 13w # three months
2017-08-10 17:35:25 +08:00
actions :
comment :
identifer : inactive-warning
message : |-
2018-06-27 17:06:02 +08:00
**This issue had no activity for at least three months.**
2017-08-10 17:35:25 +08:00
It's subject to automatic issue closing if there is no activity in the next 15 days.
label : inactive
- filters :
open : true
label : inactive
last_action_age :
2018-06-27 17:06:02 +08:00
maximum : 13w # three months
2017-08-10 17:35:25 +08:00
actions :
label :
remove :
- inactive
- filters :
open : true
label : inactive
last_action_age :
minimum : 15d
includeBotActions : true
actions :
close : true
comment :
identifer : inactive-close
message : |-
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.
2018-05-15 16:11:57 +08:00
# Add action actions box to each pull request
- filters :
pull_request : true
open : true
not :
comment :
matching : admin-actions
author : webpack-bot
actions :
comment :
identifier : admin-actions
message : |-
*For maintainers only:*
2018-06-07 16:03:32 +08:00
* [ ] <!-- document --> This need to be documented (issue in webpack/webpack.js.org will be filed when merged)
2018-05-15 16:11:57 +08:00
# When a pull request need to be documented, create an issue in webpack/webpack.js.org when merged
- filters :
pull_request :
merged : true
comment :
author : webpack-bot
matching : "\\* \\[x\\] <!-- document -->"
not :
comment_1 :
author : webpack-bot
matching : admin-action-document-executed
actions :
new_issue :
target : webpack/webpack.js.org
title : "Document webpack change: {{{pull_request.title}}}"
body : |-
<!-- documentation request from webpack/webpack -->
*A pull request by @{{pull_request.user.login}} was merged and maintainers requested a documentation change.*
See pull request : {{{pull_request.html_url}}}
---
{{{pull_request.body}}}
comment :
identifier : admin-action-document-executed
message : |-
I've created an issue to document this in webpack/webpack.js.org.
2017-08-10 17:35:25 +08:00
2018-05-25 16:43:30 +08:00
# Check open issues and pull requests every day
2017-08-10 17:35:25 +08:00
- filters :
open : true
actions :
2017-08-11 16:02:49 +08:00
schedule : 1d