From 94fdc388220399d22ee2ada76b7aed847d8c0eea Mon Sep 17 00:00:00 2001 From: Blake Friedman Date: Thu, 24 Oct 2024 20:07:20 -0700 Subject: [PATCH] fix: mitigate DangerJS transpilation bug (#47192) Summary: Danger seems to have a bug where it's not transpiling the import of rnx-kit/rn-changelog-generator. This mitigates the issue to get our project back on track. This can be replicated locally by: ```bash DEBUG="*" DANGER_GITHUB_API_TOKEN=$GITHUB_TOKEN yarn danger pr https://github.com/facebook/react-native/pull/47182 ``` You can see it running correctly here when switching to the branch with the fix. **I'm a little concerned that this is still failing on the PR**. Thoughts? {F1946190275} Changelog: [internal] Pull Request resolved: https://github.com/facebook/react-native/pull/47192 Reviewed By: cortinico Differential Revision: D64924466 Pulled By: blakef fbshipit-source-id: 68df0521620809effe3a78ce842e043382ad64a6 --- packages/react-native-bots/dangerfile.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native-bots/dangerfile.js b/packages/react-native-bots/dangerfile.js index a3666548ea2fe5..2f7a7165e28cdb 100644 --- a/packages/react-native-bots/dangerfile.js +++ b/packages/react-native-bots/dangerfile.js @@ -8,9 +8,6 @@ */ 'use strict'; - -const {validate: validateChangelog} = - require('@rnx-kit/rn-changelog-generator').default; const {danger, fail, /*message,*/ warn} = require('danger'); const includes = require('lodash.includes'); @@ -60,7 +57,9 @@ if (!includesTestPlan && !isFromPhabricator) { // Check if there is a changelog and validate it if (!isFromPhabricator) { - const status = validateChangelog(danger.github.pr.body); + const status = require('@rnx-kit/rn-changelog-generator').default.validate( + danger.github.pr.body, + ); const changelogInstructions = 'See Changelog format'; if (status === 'missing') {