Stop using GitHub bot commands for now
Summary: Closes https://github.com/facebook/react-native/pull/17929 Differential Revision: D6953331 Pulled By: hramos fbshipit-source-id: d7b50b18a2c2e5826ed2af5f5ef08ed9aa2878bf
This commit is contained in:
parent
488b6825c5
commit
b973fe45bd
|
@ -18,7 +18,6 @@ import { danger, fail, markdown, message, warn } from 'danger';
|
|||
// Fails if the description is too short.
|
||||
if (!danger.github.pr.body || danger.github.pr.body.length < 10) {
|
||||
fail(':grey_question: This pull request needs a description.');
|
||||
markdown('@facebook-github-bot label Needs more information');
|
||||
}
|
||||
|
||||
// Warns if the PR title contains [WIP]
|
||||
|
@ -44,7 +43,6 @@ if (!includesTestPlan) {
|
|||
const title = ':clipboard: Test Plan';
|
||||
const idea = 'This PR appears to be missing a Test Plan.';
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
markdown('@facebook-github-bot label Needs more information');
|
||||
}
|
||||
|
||||
// Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups
|
||||
|
@ -57,32 +55,30 @@ if (!includesReleaseNotes) {
|
|||
const title = ':clipboard: Release Notes';
|
||||
const idea = 'This PR appears to be missing Release Notes.';
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
markdown('@facebook-github-bot label Needs more information');
|
||||
} else if (!correctlyFormattedReleaseNotes) {
|
||||
const title = ':clipboard: Release Notes';
|
||||
const idea = 'This PR may have incorrectly formatted Release Notes.';
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
markdown('@facebook-github-bot label Needs more information');
|
||||
} else if (releaseNotesCaptureGroups) {
|
||||
const category = releaseNotesCaptureGroups[1].toLowerCase();
|
||||
|
||||
// Use Release Notes to Tag PRs appropriately
|
||||
if (category === 'ios' ){
|
||||
markdown('@facebook-github-bot label iOS');
|
||||
}
|
||||
// if (category === 'ios' ){
|
||||
// markdown('@facebook-github-bot label iOS');
|
||||
// }
|
||||
|
||||
if (category === 'android' ){
|
||||
markdown('@facebook-github-bot label Android');
|
||||
}
|
||||
// if (category === 'android' ){
|
||||
// markdown('@facebook-github-bot label Android');
|
||||
// }
|
||||
}
|
||||
|
||||
// Tags PRs that have been submitted by a core contributor.
|
||||
// TODO: Switch to using an actual MAINTAINERS file.
|
||||
const taskforce = fs.readFileSync('./IssueCommands.txt', 'utf8').split('\n')[0].split(':')[1];
|
||||
const isSubmittedByTaskforce = includes(taskforce, danger.github.pr.user.login);
|
||||
if (isSubmittedByTaskforce) {
|
||||
markdown('@facebook-github-bot label Core Team');
|
||||
}
|
||||
// if (isSubmittedByTaskforce) {
|
||||
// markdown('@facebook-github-bot label Core Team');
|
||||
// }
|
||||
|
||||
// Tags big PRs
|
||||
var bigPRThreshold = 600;
|
||||
|
@ -91,14 +87,14 @@ if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
|
|||
const idea = `This PR is extremely unlikely to get reviewed because it touches ${danger.github.pr.additions + danger.github.pr.deletions} lines.`;
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
|
||||
markdown('@facebook-github-bot large-pr');
|
||||
// markdown('@facebook-github-bot large-pr');
|
||||
}
|
||||
if (danger.git.modified_files + danger.git.added_files + danger.git.deleted_files > bigPRThreshold) {
|
||||
const title = ':exclamation: Big PR';
|
||||
const idea = `This PR is extremely unlikely to get reviewed because it touches ${danger.git.modified_files + danger.git.added_files + danger.git.deleted_files} files.`;
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
|
||||
markdown('@facebook-github-bot large-pr');
|
||||
// markdown('@facebook-github-bot large-pr');
|
||||
}
|
||||
|
||||
// Warns if the bots whitelist file is updated.
|
||||
|
|
Loading…
Reference in New Issue