Skip to content

Fix JS API change false positives for out-of-sync branches (#56871)#56871

Closed
huntie wants to merge 1 commit into
facebook:mainfrom
huntie:export-D105572432
Closed

Fix JS API change false positives for out-of-sync branches (#56871)#56871
huntie wants to merge 1 commit into
facebook:mainfrom
huntie:export-D105572432

Conversation

@huntie
Copy link
Copy Markdown
Member

@huntie huntie commented May 18, 2026

Summary:

diff-js-api-changes was posting false positive "JavaScript API change detected" warnings on PRs that never modified ReactNativeApi.d.ts.

This happened because the action ran git merge-base against limited local history (git fetch --depth=500), which couldn't find the common ancestor for branches that were far behind main — including (often) pick requests to release branches. The fallback wrote an empty "before" snapshot, causing the entire API surface to appear newly added.

{F1989977284}

Changes

  • Query the GitHub API first — if the PR doesn't touch ReactNativeApi.d.ts, skip the diff entirely.
  • When the snapshot is touched, use the GitHub compare API to resolve the merge base instead of relying on local git history.
  • Limit the check to PRs targeting main or *-stable branches.

Changelog: [Internal]

Differential Revision: D105572432

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 18, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 18, 2026

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105572432.

@meta-codesync meta-codesync Bot changed the title Fix false positives in diff-js-api-changes for unsynced branches Fix false positives in diff-js-api-changes for unsynced branches (#56871) May 18, 2026
huntie added a commit to huntie/react-native that referenced this pull request May 18, 2026
…ebook#56871)

Summary:

`diff-js-api-changes` was posting false positive "JavaScript API change detected" warnings on PRs that never modified `ReactNativeApi.d.ts`.

This happened because the action ran `git merge-base` against limited local history (`git fetch --depth=500`), which couldn't find the common ancestor for branches that were far behind main — including (often) pick requests to release branches. The fallback wrote an empty "before" snapshot, causing the entire API surface to appear newly added.

{F1989977284}

#### Changes

- Query the GitHub API first — if the PR doesn't touch `ReactNativeApi.d.ts`, skip the diff entirely.
- When the snapshot is touched, use the GitHub compare API to resolve the merge base instead of relying on local git history.
- Limit the check to PRs targeting `main` or `*-stable` branches.

Changelog: [Internal]

Differential Revision: D105572432
@huntie huntie force-pushed the export-D105572432 branch from a55e0e6 to 875e81d Compare May 18, 2026 15:17
…ebook#56871)

Summary:

`diff-js-api-changes` was posting false positive "JavaScript API change detected" warnings on PRs that never modified `ReactNativeApi.d.ts`.

This happened because the action ran `git merge-base` against limited local history (`git fetch --depth=500`), which couldn't find the common ancestor for branches that were far behind main — including (often) pick requests to release branches. The fallback wrote an empty "before" snapshot, causing the entire API surface to appear newly added.

{F1989977284}

#### Changes

- Query the GitHub API first — if the PR doesn't touch `ReactNativeApi.d.ts`, skip the diff entirely.
- When the snapshot is touched, use the GitHub compare API to resolve the merge base instead of relying on local git history.
- Limit the check to PRs targeting `main` or `*-stable` branches.

Changelog: [Internal]

Differential Revision: D105572432
@huntie huntie force-pushed the export-D105572432 branch from 875e81d to 4f94ae5 Compare May 18, 2026 17:52
@huntie huntie changed the title Fix false positives in diff-js-api-changes for unsynced branches (#56871) Fix JS API change false positives for out-of-sync branches (#56871) May 20, 2026
@github-actions
Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@meta-codesync meta-codesync Bot closed this in 88a6ace May 20, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label May 20, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 20, 2026

This pull request has been merged in 88a6ace.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @huntie in 88a6ace

When will my fix make it into a release? | How to file a pick request?

@huntie huntie deleted the export-D105572432 branch May 20, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants