Skip to content

Commit

Permalink
Do not run OSS changelog validator on diffs exported from Phabricator (
Browse files Browse the repository at this point in the history
…#36994)

Summary:
Pull Request resolved: #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
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Apr 20, 2023
1 parent 8e046cb commit 290774f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions packages/react-native-bots/dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a target="_blank" href="https://reactnative.dev/contributing/changelogs-in-pull-requests">Changelog format</a>';
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} - <i>${idea}</i>`);
} else if (status === 'invalid') {
const title = ':clipboard: Verify Changelog Format';
const idea = changelogInstructions;
fail(`${title} - <i>${idea}</i>`);
if (!isFromPhabricator) {
const status = validateChangelog(danger.github.pr.body);
const changelogInstructions =
'See <a target="_blank" href="https://reactnative.dev/contributing/changelogs-in-pull-requests">Changelog format</a>';
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} - <i>${idea}</i>`);
} else if (status === 'invalid') {
const title = ':clipboard: Verify Changelog Format';
const idea = changelogInstructions;
fail(`${title} - <i>${idea}</i>`);
}
}

// Warns if the PR is opened against stable, as commits need to be cherry picked and tagged by a release maintainer.
Expand Down

0 comments on commit 290774f

Please sign in to comment.