From 290774fd8098e6e2b0d9a874306be886ff9f9934 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 20 Apr 2023 10:11:43 -0700 Subject: [PATCH] Do not run OSS changelog validator on diffs exported from Phabricator (#36994) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36994 We already run changelog validation internally which has specific exemptions for codemods and dirsynced directories. Do not run twice, now that we need to export diffs. An alternative solution would be to port the logic to the OSS changelog generator and stop running the internal one, but that would increase latency, and we have made fixes to the internal once as recent as two weeks ago in D44746795. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D45135111 fbshipit-source-id: e23c2613b183f75a148d1b38b31c259acc9c9fc5 --- packages/react-native-bots/dangerfile.js | 28 +++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/react-native-bots/dangerfile.js b/packages/react-native-bots/dangerfile.js index c14203e4c458d4..0a14b4d0fc2bb0 100644 --- a/packages/react-native-bots/dangerfile.js +++ b/packages/react-native-bots/dangerfile.js @@ -60,19 +60,21 @@ if (!includesTestPlan && !isFromPhabricator) { } // Check if there is a changelog and validate it -const status = validateChangelog(danger.github.pr.body); -const changelogInstructions = - 'See Changelog format'; -if (status === 'missing') { - // Provides advice if a changelog is missing - const title = ':clipboard: Missing Changelog'; - const idea = - 'Please add a Changelog to your PR description. ' + changelogInstructions; - fail(`${title} - ${idea}`); -} else if (status === 'invalid') { - const title = ':clipboard: Verify Changelog Format'; - const idea = changelogInstructions; - fail(`${title} - ${idea}`); +if (!isFromPhabricator) { + const status = validateChangelog(danger.github.pr.body); + const changelogInstructions = + 'See Changelog format'; + if (status === 'missing') { + // Provides advice if a changelog is missing + const title = ':clipboard: Missing Changelog'; + const idea = + 'Please add a Changelog to your PR description. ' + changelogInstructions; + fail(`${title} - ${idea}`); + } else if (status === 'invalid') { + const title = ':clipboard: Verify Changelog Format'; + const idea = changelogInstructions; + fail(`${title} - ${idea}`); + } } // Warns if the PR is opened against stable, as commits need to be cherry picked and tagged by a release maintainer.