Fix JS API change false positives for out-of-sync branches (#56871)#56871
Closed
huntie wants to merge 1 commit into
Closed
Fix JS API change false positives for out-of-sync branches (#56871)#56871huntie wants to merge 1 commit into
huntie wants to merge 1 commit into
Conversation
|
@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D105572432. |
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
…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
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
|
This pull request has been merged in 88a6ace. |
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
diff-js-api-changeswas posting false positive "JavaScript API change detected" warnings on PRs that never modifiedReactNativeApi.d.ts.This happened because the action ran
git merge-baseagainst 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
ReactNativeApi.d.ts, skip the diff entirely.mainor*-stablebranches.Changelog: [Internal]
Differential Revision: D105572432