Test: trivial change to reproduce false positive bot issue#54815
Draft
emily8rown wants to merge 1 commit intofacebook:mainfrom
Draft
Test: trivial change to reproduce false positive bot issue#54815emily8rown wants to merge 1 commit intofacebook:mainfrom
emily8rown wants to merge 1 commit intofacebook:mainfrom
Conversation
Collaborator
|
This was referenced Dec 8, 2025
meta-codesync bot
pushed a commit
that referenced
this pull request
Dec 10, 2025
…54819) Summary: Updates the `diff-js-api-breaking-changes` action to compare the PR's changes against the merge base (where the branch diverged from main) instead of the current tip of main. ### Problem The previous implementation compared the current state of `main` to the PR head. This could produce false positive results when main had new commits to reactNativeApi.d.ts reporting breaking changes from main as if they were introduced by the PR. ### Solution - Calculate the merge base between the PR head and `origin/main` - Compare the API snapshot at the merge base to the snapshot at the PR head ## Changelog: [GENERAL] [FIXED] - Updates the `diff-js-api-breaking-changes` action to compare the PR's changes against the merge base (where the branch diverged from main) instead of the current tip of main. Pull Request resolved: #54819 Test Plan: (outputs shown for #54815) Tested locally on branch that previously got false positive: Mirror old approach: ``` mkdir -p /tmp/api-diff-old git show origin/main:packages/react-native/ReactNativeApi.d.ts > /tmp/api-diff-old/before.d.ts git show HEAD:packages/react-native/ReactNativeApi.d.ts > /tmp/api-diff-old/after.d.ts node ./scripts/js-api/diff-api-snapshot /tmp/api-diff-old/before.d.ts /tmp/api-diff-old/after.d.ts ``` output: ``` { "result": "BREAKING", "changedApis": [ "ActivityIndicatorProps", "Animated", "DrawerLayoutAndroidProps", "FlatList", "FlatListProps", "ImageBackground", "ImageBackgroundProps", "ImageProps", "ImagePropsBase", "KeyDownEvent", "KeyEvent", "KeyUpEvent", "KeyboardAvoidingView", "KeyboardAvoidingViewProps", "ModalProps", "PressableProps", "ProgressBarAndroidProps", "RefreshControl", "RefreshControlProps", "ScrollViewProps", "SectionList", "SectionListProps", "SwitchProps", "TextInputProps", "ViewProps", "VirtualizedListProps", "VirtualizedSectionListProps" ] } ``` Mirror new approach: ``` git fetch origin main MERGE_BASE=$(git merge-base HEAD origin/main) echo "Merge base: $MERGE_BASE" mkdir -p /tmp/api-diff git show $MERGE_BASE:packages/react-native/ReactNativeApi.d.ts > /tmp/api-diff/before.d.ts git show HEAD:packages/react-native/ReactNativeApi.d.ts > /tmp/api-diff/after.d.ts node ./scripts/js-api/diff-api-snapshot /tmp/api-diff/before.d.ts /tmp/api-diff/after.d.ts ``` output: ``` { "result": "NON_BREAKING", "changedApis": [] } ``` Reviewed By: huntie Differential Revision: D88654826 Pulled By: emily8rown fbshipit-source-id: 5dc2e295d7d527899b5cb6a643c4878aeebf7f0b
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.
Not for merging
Summary:
Experiment to reproduce false positive breaking changes bot reactNativeApi.d.ts
Example commit 79b09ce added new api to reactNativeApi
so this branch checked out 630f80c (the commit just before)
Danger bot checks look like we have removed api despite not touching it
Changelog:
[GENERAL] [FIXED] - Message
Test Plan: