Skip to content

Commit 46f4109

Browse files
hramosfacebook-github-bot
authored andcommittedApr 2, 2020
Loosen up restrictions for internal changelogs (facebook#28486)
Summary: Do not nag on PRs that contain internal changelogs (meaning, the change doesn't need to be called out in release notes). ## Changelog [Internal] - This should be acceptable. Pull Request resolved: facebook#28486 Test Plan: See PR. Reviewed By: cpojer Differential Revision: D20817454 Pulled By: hramos fbshipit-source-id: a7082c4db05ec53ad27349db7e5bce2cfffd6930
1 parent 2c3a6ab commit 46f4109

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎bots/dangerfile.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ if (!includesTestPlan) {
5151
}
5252

5353
// Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups
54-
const changelogRegex = /\[\s?(ANDROID|GENERAL|IOS|JS|JAVASCRIPT|INTERNAL)\s?\]\s*?\[\s?(ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY)\s?\]\s*?\-?\s*?(.*)/gi;
54+
const changelogRegex = /\[\s?(ANDROID|GENERAL|IOS|JS|JAVASCRIPT|INTERNAL)\s?\]\s?\[\s?(ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY)\s?\]\s*?-?\s*?(.*)/gi;
55+
const internalChangelogRegex = /\[\s?(INTERNAL)\s?\].*/gi;
5556
const includesChangelog =
5657
danger.github.pr.body &&
5758
(danger.github.pr.body.toLowerCase().includes('## changelog') ||
5859
danger.github.pr.body.toLowerCase().includes('release notes'));
5960
const correctlyFormattedChangelog = changelogRegex.test(danger.github.pr.body);
61+
const containsInternalChangelog = internalChangelogRegex.test(
62+
danger.github.pr.body,
63+
);
6064

6165
// Provides advice if a changelog is missing
6266
const changelogInstructions =
@@ -68,7 +72,7 @@ if (!includesChangelog) {
6872
'To do so, add a "## Changelog" section to your PR description. ' +
6973
changelogInstructions;
7074
message(`${title} - <i>${idea}</i>`);
71-
} else if (!correctlyFormattedChangelog) {
75+
} else if (!correctlyFormattedChangelog && !containsInternalChangelog) {
7276
const title = ':clipboard: Verify Changelog Format';
7377
const idea = changelogInstructions;
7478
message(`${title} - <i>${idea}</i>`);

0 commit comments

Comments
 (0)
Please sign in to comment.