webpack/open-bot.yaml

626 lines
16 KiB
YAML
Raw Normal View History

bot: "webpack-bot"
rules:
2018-10-24 16:52:20 +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
- filters:
open: true
pull_request:
mergeable: true
2021-01-15 23:26:12 +08:00
check_1:
name: "webpack.webpack"
2018-10-24 16:52:20 +08:00
status_2:
context: "continuous-integration/appveyor/pr"
2017-04-06 06:08:59 +08:00
ensure_1:
2021-01-15 23:26:12 +08:00
value: "{{check_1.conclusion}}"
2018-10-24 16:52:20 +08:00
equals: "success"
2017-04-06 06:08:59 +08:00
ensure_2:
value: "{{status_2.state}}"
2018-10-24 16:52:20 +08:00
equals: "success"
actions:
label:
add: "PR: CI-ok"
remove: "PR: CI-not-ok"
comment:
identifier: "ci-result"
message: |-
Thank you for your pull request! The most important CI builds succeeded, well review the pull request soon.
- filters:
open: true
pull_request:
mergeable: true
2021-01-15 23:26:12 +08:00
check_1:
name: "webpack.webpack"
2018-10-24 16:52:20 +08:00
status_2:
context: "continuous-integration/appveyor/pr"
any:
2018-10-24 16:52:20 +08:00
ensure_1:
2021-01-15 23:26:12 +08:00
value: "{{check_1.conclusion}}"
2018-10-24 16:52:20 +08:00
equals: "failure"
ensure_2:
value: "{{status_2.state}}"
2018-10-24 16:52:20 +08:00
equals: "failure"
not:
any:
ensure_3:
2021-01-15 23:26:12 +08:00
value: "{{check_1.conclusion}}"
2018-10-24 16:52:20 +08:00
equals: "pending"
ensure_4:
value: "{{status_2.state}}"
equals: "pending"
actions:
label:
add: "PR: CI-not-ok"
remove: "PR: CI-ok"
set:
id: report_ci
value: yep
# Report a general error message
- filters:
ensure:
value: "{{report_ci}}"
equals: yep
commit: true
2021-01-15 23:26:12 +08:00
check_1:
name: "webpack.webpack"
2018-10-24 16:52:20 +08:00
status_2:
context: "continuous-integration/appveyor/pr"
actions:
comment:
identifier: "ci-result"
message: |-
@{{commit.author.login}} The most important CI builds failed. This way your PR can't be merged.
2021-01-15 23:26:12 +08:00
Please take a look at the CI results from azure ({{{check_1.output.summary}}}) and [appveyor]({{status_2.target_url}}) ({{status_2.state}}) and fix these issues.
2018-10-24 16:52:20 +08:00
# Add tests-needed label depending on codecov status
# comment to point the user writing test cases
# comment in case of success
- filters:
open: true
pull_request:
mergeable: true
status:
context: "codecov/patch/integration"
ensure:
value: "{{status.state}}"
equals: "success"
label: "PR: tests-needed"
actions:
label:
remove: "PR: tests-needed"
comment:
identifier: "tests-result"
message: |-
The minimum test ratio has been reached. Thanks!
- filters:
open: true
pull_request:
mergeable: true
status:
context: "codecov/patch/integration"
ensure:
value: "{{status.state}}"
equals: "failure"
actions:
label:
add: "PR: tests-needed"
- filters:
open: true
pull_request:
mergeable: true
status:
context: "codecov/patch/integration"
ensure:
value: "{{status.state}}"
equals: "failure"
age:
value: "{{status.created_at}}"
minimum: 1h
permission: "read|none"
actions:
comment:
identifier: "tests-result"
message: |-
It looks like this Pull Request doesn't include [enough test cases]({{status.target_url}}) (based on Code Coverage analysis of the PR diff).
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).
@{{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.
# add conflict label to pull requests with conflict
# on conflict all result labels are removed
- filters:
open: true
pull_request:
mergeable: false
actions:
label:
add: "PR: conflict"
remove:
- "PR: tests-needed"
- "PR: CI-ok"
- "PR: CI-not-ok"
- filters:
open: true
pull_request:
mergeable: true
actions:
label:
remove: "PR: conflict"
# 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
ensure:
value: "{{review.state}}"
equals: APPROVED
permission:
user: "{{review.user.login}}"
actions:
label:
add: "PR: reviewed-approved"
remove:
- "PR: review-outdated"
- "PR: unreviewed"
- "PR: reviewed"
- filters:
open: true
in_order:
commit: true
review:
state: APPROVED|CHANGES_REQUESTED
permission:
user: "{{review.user.login}}"
ensure:
value: "{{review.state}}"
equals: CHANGES_REQUESTED
actions:
label:
add: "PR: reviewed-changes-requested"
remove:
- "PR: review-outdated"
- "PR: unreviewed"
- "PR: reviewed"
- filters:
open: true
in_order:
review:
state: APPROVED|CHANGES_REQUESTED
commit: true
permission:
user: "{{review.user.login}}"
not:
label: "review-outdated"
ensure:
value: "{{commit.author.login}}"
notEquals: "{{review.user.login}}"
actions:
label:
add: "PR: review-outdated"
remove:
- "PR: reviewed-approved"
- "PR: reviewed-changes-requested"
- "PR: unreviewed"
- "PR: reviewed"
comment:
identifier: "review-outdated"
message: |-
@{{commit.author.login}} Thanks for your update.
I labeled the Pull Request so reviewers will review it again.
@{{review.user.login}} Please review the new changes.
- filters:
open: true
commit: true
not:
review:
state: APPROVED|CHANGES_REQUESTED
actions:
label: "PR: unreviewed"
2019-12-28 04:42:24 +08:00
# add non-master, webpack-4 and next label to pull request to other branch
2018-10-24 16:52:20 +08:00
- filters:
pull_request:
base_ref: "^master$"
actions:
label:
2019-12-28 04:42:24 +08:00
remove:
- "PR: next"
- "PR: webpack-4"
- "PR: non-master"
2018-10-24 16:52:20 +08:00
- filters:
pull_request:
base_ref: "^next$"
actions:
label:
add: "PR: next"
2019-12-28 04:42:24 +08:00
remove:
- "PR: webpack-4"
- "PR: non-master"
2019-12-28 04:42:24 +08:00
- filters:
pull_request:
base_ref: "^webpack-4$"
actions:
label:
add: "PR: webpack-4"
remove:
- "PR: next"
- "PR: non-master"
2018-10-24 16:52:20 +08:00
- filters:
pull_request:
2019-12-28 04:42:24 +08:00
base_ref: "^(?!master$)(?!webpack-4$)(?!next$)"
2018-10-24 16:52:20 +08:00
actions:
label:
add: "PR: non-master"
2019-12-28 04:42:24 +08:00
remove:
- "PR: next"
- "PR: webpack-4"
2018-10-24 16:52:20 +08:00
# add non-master label to pull request to other branch
- filters:
open: true
age:
minimum: 1d
maximum: 1w
pull_request:
head_ref: "^master$"
permission: "read|none"
actions:
comment:
identifier: "head-master"
edit: true
message: |-
Hi @{{pull_request.user.login}}.
2018-10-24 16:52:20 +08:00
Just a little hint from a friendly bot about the best practice when submitting pull requests:
> 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.*
2019-05-14 22:29:30 +08:00
# skip CLA for dependabot
- filters:
open: true
pull_request:
2019-05-25 15:39:28 +08:00
author: "^dependabot(-preview)?\\[bot\\]$"
2019-05-14 22:29:30 +08:00
status:
context: "licence/cla"
state: "pending"
actions:
status:
context: "licence/cla"
description: "Contributor License Agreement is not needed for this user."
state: "success"
2019-05-20 20:46:31 +08:00
2019-05-15 04:04:15 +08:00
# merge dependabot PRs automatically
- filters:
open: true
pull_request:
2019-05-25 15:39:28 +08:00
author: "^dependabot(-preview)?\\[bot\\]$"
2019-05-15 04:04:15 +08:00
mergeable_state: clean
merged: false
label: "PR: CI-ok"
actions:
merge: true
2019-05-14 22:29:30 +08:00
2018-10-24 16:52:20 +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"
# Move issue task
- filters:
open: true
2018-11-02 18:04:02 +08:00
comment: "\\s*@webpack-bot\\s+move\\s+(?:to\\s+)?([a-z0-9_\\-\\.]+/[a-z0-9_\\-\\.]+)\\s*([\\s\\S]*)$"
2018-10-24 16:52:20 +08:00
not:
comment_1:
matching: "moved\\-by\\-bot"
author: "."
permission:
user: "{{comment.actor.login}}"
actions:
new_issue:
target: "{{{comment_match.[1]}}}"
body: |-
{{{issue.body}}}
---
This issue was moved from {{owner}}/{{repo}}#{{issue.number}} by @{{comment.actor.login}}. Original issue was by @{{issue.user.login}}.
{{{comment_match.[2]}}}
comment:
identifier: moved-by-bot
message: |-
I've moved it to {{comment_match.[1]}}.
close: true
# 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-10-25 02:10:30 +08:00
last_action_age: 13w # three months
2018-10-24 16:52:20 +08:00
actions:
comment:
identifier: inactive-warning
2018-10-24 16:52:20 +08:00
message: |-
2018-10-25 02:10:30 +08:00
**This issue had no activity for at least three months.**
2018-10-24 16:52:20 +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-10-25 02:10:30 +08:00
maximum: 13w # three months
2018-10-24 16:52:20 +08:00
actions:
label:
remove:
- inactive
- filters:
open: true
label: inactive
last_action_age:
minimum: 15d
includeBotActions: true
actions:
close: true
comment:
identifier: inactive-close
2018-10-24 16:52:20 +08:00
message: |-
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.
# 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:*
2019-06-24 20:53:54 +08:00
* [ ] <!-- document --> This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
* [ ] <!-- webpack-4-backport --> This needs to be backported to webpack 4 (issue will be created when merged)
2018-10-24 16:52:20 +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 -->
2018-10-24 16:52:20 +08:00
*A pull request by @{{pull_request.user.login}} was merged and maintainers requested a documentation change.*
2018-10-24 16:52:20 +08:00
See pull request: {{{pull_request.html_url}}}
2018-10-24 16:52:20 +08:00
---
2018-10-24 16:52:20 +08:00
{{{pull_request.body}}}
comment:
identifier: admin-action-document-executed
message: |-
I've created an issue to document this in webpack/webpack.js.org.
# When a pull request need to be backported, create an issue in webpack/webpack when merged
- filters:
pull_request:
merged: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] <!-- webpack-4-backport -->"
not:
comment_1:
author: webpack-bot
matching: admin-action-webpack-4-backport-executed
actions:
new_issue:
target: webpack/webpack
title: "Backport to webpack 4: {{{pull_request.title}}}"
body: |-
{{{pull_request.html_url}}} needs to be backported to webpack 4.
2019-11-15 17:20:45 +08:00
Send a PR.
2019-11-15 17:20:45 +08:00
cc @{{pull_request.user.login}}
comment:
identifier: admin-action-webpack-4-backport-executed
message: |-
I've created an issue to backport this.
# Ask for tags on new issues
- filters:
open: true
issue: true
age:
maximum: 1w
any:
not_1:
any:
label_1: webpack-4
label_2: webpack-5
not_2:
any:
label_1: bug
label_2: critical-bug
label_3: enhancement
label_4: documentation
label_5: performance
label_6: dependencies
label_7: question
not:
comment:
author: webpack-bot
matching: admin-actions
actions:
comment:
identifier: admin-actions
edit: true
message: |-
*For maintainers only:*
* [ ] webpack-4
* [ ] webpack-5
* [ ] bug
* [ ] critical-bug
* [ ] enhancement
* [ ] documentation
* [ ] performance
* [ ] dependencies
* [ ] question
# Apply selected tags
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] webpack-4"
actions:
label: webpack-4
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] webpack-5"
actions:
label: webpack-5
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] bug"
actions:
label: bug
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] critical-bug"
actions:
label: critical-bug
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] enhancement"
actions:
label: enhancement
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] performance"
actions:
label: performance
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] dependencies"
actions:
label: dependencies
- filters:
open: true
issue: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] question"
actions:
label: question
# Remove question about tags again
- filters:
open: true
issue: true
any_1:
label_1: webpack-4
label_2: webpack-5
any_2:
label_1: bug
label_2: critical-bug
label_3: enhancement
label_4: documentation
label_5: performance
label_6: dependencies
label_7: question
comment:
author: webpack-bot
matching: admin-actions
actions:
schedule: 30s
- filters:
open: true
issue: true
any_1:
label_1: webpack-4
label_2: webpack-5
any_2:
label_1: bug
label_2: critical-bug
label_3: enhancement
label_4: documentation
label_5: performance
label_6: dependencies
label_7: question
comment:
author: webpack-bot
matching: admin-actions
last_action_age:
minimum: 30s
includeBotActions: true
actions:
comment:
identifier: admin-actions
message: ""
2018-10-24 16:52:20 +08:00
# Check open issues and pull requests every day
- filters:
open: true
actions:
schedule: 1d