From e509007f5714301ebcbb2adf249cafcf7d466606 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Mon, 5 Dec 2022 02:38:42 -0800 Subject: [PATCH] fix(internal, dangerfile): fix changelog entries for dangerfiles and PR template (#35541) Summary: A few days back leotm pointed out how the dangerfile was disaligned with the docs around the valid changelog entries for categories and types here: https://github.com/facebook/react-native/pull/35443#issuecomment-1327449113 I dug a bit deeper into the whole thing and went to the source of truth, which is the changelog generator, in particular here: https://github.com/microsoft/rnx-kit/blob/main/incubator/rn-changelog-generator/src/utils/getChangeDimensions.ts So I've updated the dangerfile to respect the options listed there. Also did a parallel PR on the website side: https://github.com/facebook/react-native-website/pull/3447 So now all comms will be aligned. ## Changelog [INTERNAL] [FIXED] - fix changelog entries for dangerfiles and PR template Pull Request resolved: https://github.com/facebook/react-native/pull/35541 Test Plan: N/A Reviewed By: sammy-SC Differential Revision: D41686913 Pulled By: cortinico fbshipit-source-id: 2297b4a3209188bda4a609b60860de35c5e7e6df --- .github/PULL_REQUEST_TEMPLATE.md | 10 +++++++--- packages/react-native-bots/dangerfile.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4b81ca2408c..13ec420394e 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,12 +6,16 @@ ## Changelog - -[CATEGORY] [TYPE] - Message - ## Test Plan diff --git a/packages/react-native-bots/dangerfile.js b/packages/react-native-bots/dangerfile.js index f5bc31129a6..e01abdb5bb4 100644 --- a/packages/react-native-bots/dangerfile.js +++ b/packages/react-native-bots/dangerfile.js @@ -59,7 +59,7 @@ if (!includesTestPlan && !isFromPhabricator) { // Regex looks for given categories, types, a file/framework/component, and a message - broken into 4 capture groups const changelogRegex = - /\[\s?(ANDROID|GENERAL|IOS|JS|JAVASCRIPT|INTERNAL)\s?\]\s?\[\s?(ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY)\s?\]\s*?-?\s*?(.*)/gi; + /\[\s?(ANDROID|GENERAL|IOS|INTERNAL)\s?\]\s?\[\s?(BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY)\s?\]\s*?-?\s*?(.*)/gi; const internalChangelogRegex = /\[\s?(INTERNAL)\s?\].*/gi; const includesChangelog = danger.github.pr.body &&