-
-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Open bot to the webpack-cli #224
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
eae5720
Added open-bot.yml configuration file for open bot, plus two npm scripts
ematipico e27679b
Added open-bot.yml configuration file for open bot, plus two npm scripts
ematipico 2349bfb
Updated open-bot configuration
ematipico bee6084
Added new dist command
ematipico 09026c8
Update travis configuration, runnable from the bot
ematipico 1ad3cbb
Updated job from 'unit' to 'integration'
ematipico 9102222
Moved to yarn and updated the matrix
ematipico e26ceec
Removed 'prepublish'
ematipico 32e37be
Fixed typo inside the configuration
ematipico File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,344 @@ | ||
bot: "webpack-bot" | ||
rules: | ||
|
||
# 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 | ||
status_1: | ||
context: "continuous-integration/travis-ci/pr" | ||
ensure_1: | ||
value: "{{status_1.state}}" | ||
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, we’ll review the pull request soon. | ||
- filters: | ||
open: true | ||
pull_request: | ||
mergeable: true | ||
status_1: | ||
context: "continuous-integration/travis-ci/pr" | ||
any: | ||
ensure_1: | ||
value: "{{status_1.state}}" | ||
equals: "failure" | ||
actions: | ||
label: | ||
add: "PR: CI-not-ok" | ||
remove: "PR: CI-ok" | ||
set: | ||
id: report_ci | ||
value: yep | ||
|
||
|
||
|
||
# Report specific error message if jest tests fails | ||
- filters: | ||
ensure: | ||
value: "{{report_ci}}" | ||
equals: yep | ||
commit: true | ||
status: | ||
context: "continuous-integration/travis-ci/pr" | ||
travis_job: | ||
state: "failed" | ||
allow_failure: false | ||
config: | ||
env: JOB_PART=integration | ||
fetch: travis_job.log | ||
string_cleanup: | ||
id: logResult | ||
value: "{{{fetch}}}" | ||
remove: | ||
- "^[\\s\\S]+?npm run travis:\\$JOB_PART\n*" | ||
- "npm ERR!.*\n" | ||
- "\n*=============================================================================\n[\\s\\S]*" | ||
actions: | ||
comment: | ||
identifier: "ci-result" | ||
message: |- | ||
@{{commit.author.login}} Please review the following output log for errors: | ||
|
||
``` text | ||
{{{logResult}}} | ||
``` | ||
|
||
See [complete report here]({{status.target_url}}). | ||
set: | ||
id: report_ci | ||
value: nope | ||
|
||
|
||
|
||
# Report specific error message if linting fails | ||
- filters: | ||
ensure: | ||
value: "{{report_ci}}" | ||
equals: yep | ||
commit: true | ||
status: | ||
context: "continuous-integration/travis-ci/pr" | ||
travis_job: | ||
state: "failed" | ||
config: | ||
env: JOB_PART=lint | ||
fetch: travis_job.log | ||
string_cleanup: | ||
id: logResult | ||
value: "{{{fetch}}}" | ||
remove: | ||
- "^[\\s\\S]+?npm run travis:\\$JOB_PART\n*" | ||
- "npm ERR!.*\n" | ||
- "\n*The command \"npm run travis:\\$JOB_PART\" exited [\\s\\S]*" | ||
actions: | ||
comment: | ||
identifier: "ci-result" | ||
message: |- | ||
@{{commit.author.login}} The tests look fine, but there are code style issue in your Pull Request. Please review the following: | ||
|
||
``` text | ||
{{{logResult}}} | ||
``` | ||
|
||
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" | ||
actions: | ||
comment: | ||
identifier: "ci-result" | ||
message: |- | ||
@{{commit.author.login}} The most important CI builds failed. This way your PR can't be merged. | ||
|
||
Please take a look at the CI results from [travis]({{status_1.target_url}}) ({{status_1.state}}) and fix these issues. | ||
|
||
|
||
# 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 | ||
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 | ||
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 | ||
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" | ||
|
||
|
||
|
||
# add small label to small pull requests | ||
- filters: | ||
open: true | ||
pull_request: | ||
additions: "<= 10" | ||
deletions: "<= 10" | ||
changed_files: "<= 2" | ||
actions: | ||
label: "PR: small" | ||
|
||
|
||
|
||
# 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}}. | ||
|
||
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.* | ||
|
||
|
||
# Move issue task | ||
- filters: | ||
open: true | ||
comment: "\\s*@webpack-bot\\s+move\\s+(?:to\\s+)?([a-z0-9_\\-\\.]+/[a-z0-9_\\-\\.]+)\\s*([\\s\\S]*)$" | ||
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}}. Orginal 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" | ||
last_action_age: 26w # half a year | ||
actions: | ||
comment: | ||
identifer: inactive-warning | ||
message: |- | ||
**This issue had no activity for at least half a year.** | ||
|
||
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: | ||
maximum: 26w # half a year | ||
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. | ||
|
||
|
||
# Check issues every week | ||
- filters: | ||
open: true | ||
actions: | ||
schedule: 1d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 is a "in development" version number. Only even version numbers are node.js version you need to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The the versions will be stable, 8 and 6? As far as I understood webpack 4 won't support
v4
anymore.Also, are the labels required for webpack-bot? I don't see it doing anything on new PRs.