mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-14 12:11:47 +08:00
Flag large pull requests, add large-pr command
Summary: We sometimes get large PRs that sit for a long time without being reviewed. In some cases, the PR touches too many files or lines, and the author would benefit from splitting the PR into smaller easier-to-review PRs. In this PR, we automatically flag such PRs using the existing Danger PR automation functionality. This PR achieves the objective by doing the following: * Add facebook-open-source-bot to `IssueCommands.txt`, allowing it to add labels and close issues/PRs via facebook-github-bot commands. * Adds a `large-pr` command to facebook-github-bot. This command will add a short blurb, apply a new "Large PR" label, and close the PR. * Updates the Dangerfile to check for PRs that touch over 600 lines and/or files. In such cases it will warn and then issue the large-pr command. Additional changes: * Tag core contributor PRs with the "Core Team" label. This is a slight change in policy, in that the label used to be applied after the fact (after the PR was escalated for review). It's more convenient to monitor labels, so we'll start checking for PRs tagged as such and ensure they get escalated as needed. cc skevy Thanks to TheSavior for suggesting this change. Testing against PR #10084 which touches over 600 lines: ``` $ cd danger $ DANGER_GITHUB_API_TOKEN="e622517d9f1136ea8900""07c6373666312cdfaa69" npm run danger pr https://github.com/facebook/react-native/pull/10084 > @ danger /Users/hramos/git/react-native/danger > node ./node_modules/.bin/danger "pr" "https://github.com/facebook/react-native/pull/10084" { fails: [], warnings: [ { message: "📋 Test Plan - <i>This PR appears to be missing a Test Plan.</i>" }, { message: "❗ Big PR - <i>This PR is extremely unlikely to get reviewed because it touches 613 lines.</i>" } ], messages: [], markdowns: ["facebook-github-bot label Needs more information", "facebook-github-bot large-pr"] } ``` Result: successfully flagged as being a large PR. Closes https://github.com/facebook/react-native/pull/15519 Differential Revision: D5647085 Pulled By: hramos fbshipit-source-id: dfa0f6580b9373085eba856de257a8d2452efbdc
This commit is contained in:
committed by
Facebook Github Bot
parent
381f738107
commit
2c076cdbdf
@@ -312,4 +312,12 @@ Additionally, the following commands can be used on a pull request:
|
||||
Flag the PR for merging. If used by a core contributor, the bot will attempt to import the pull request. In general, core contributors are those who have consistently submitted high quality contributions to the project. Access control for this command is configured internally in Facebook, outside of the IssueCommands.txt file mentioned above.
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="botAction">
|
||||
<h4 class="botCommand">
|
||||
<span class="botMentionName">@facebook-github-bot</span> large-pr
|
||||
</h4>
|
||||
<div><p>
|
||||
Flag PRs that change too many files at once. These PRs are extremely unlikely to be reviewed. The bot will leave a helpful message indicating next steps such as splitting the PR. The bot will <strong>close</strong> the PR after adding the "Large PR" label.
|
||||
</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user