Skip to content

Commit 04ae601

Browse files
Merge branch 'main' of https://github.com/getsentry/sentry-react-native into lz/ignore-replay
2 parents 136a998 + d5079ff commit 04ae601

7 files changed

Lines changed: 90 additions & 64 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: 'Platform Check'
2+
description: 'Decides whether to skip a build/test based on detect-changes outputs'
3+
4+
inputs:
5+
platform:
6+
description: 'Target platform (ios, macos, android, web)'
7+
required: true
8+
sample_changed:
9+
description: 'Whether the sample app itself changed (true/false)'
10+
required: true
11+
needs_ios:
12+
description: 'detect-changes needs_ios output'
13+
required: false
14+
default: 'false'
15+
needs_android:
16+
description: 'detect-changes needs_android output'
17+
required: false
18+
default: 'false'
19+
needs_web:
20+
description: 'detect-changes needs_web output'
21+
required: false
22+
default: 'false'
23+
24+
outputs:
25+
skip:
26+
description: 'Whether to skip this platform (true/false)'
27+
value: ${{ steps.check.outputs.skip }}
28+
29+
runs:
30+
using: 'composite'
31+
steps:
32+
- name: Check if platform is needed
33+
id: check
34+
shell: bash
35+
run: |
36+
PLATFORM="${{ inputs.platform }}"
37+
SAMPLE_CHANGED="${{ inputs.sample_changed }}"
38+
39+
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
40+
echo "skip=false" >> "$GITHUB_OUTPUT"
41+
echo "Sample app changed — building/testing $PLATFORM."
42+
exit 0
43+
fi
44+
45+
# macOS uses the iOS change-detection flag
46+
case "$PLATFORM" in
47+
ios|macos) NEEDS="${{ inputs.needs_ios }}" ;;
48+
android) NEEDS="${{ inputs.needs_android }}" ;;
49+
web) NEEDS="${{ inputs.needs_web }}" ;;
50+
*)
51+
echo "::warning::Unknown platform '$PLATFORM' — not skipping."
52+
echo "skip=false" >> "$GITHUB_OUTPUT"
53+
exit 0
54+
;;
55+
esac
56+
57+
if [[ "$NEEDS" != "true" ]]; then
58+
echo "skip=true" >> "$GITHUB_OUTPUT"
59+
echo "Skipping $PLATFORM — no relevant changes detected."
60+
else
61+
echo "skip=false" >> "$GITHUB_OUTPUT"
62+
fi

.github/workflows/sample-application-expo.yml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,17 @@ jobs:
5959
- platform: 'android'
6060
ios-use-frameworks: 'dynamic-frameworks'
6161
steps:
62+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
63+
6264
- name: Check if platform is needed
6365
id: platform-check
64-
run: |
65-
SAMPLE_CHANGED="${{ needs.detect-changes.outputs.sample_expo }}"
66-
67-
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
68-
echo "skip=false" >> "$GITHUB_OUTPUT"
69-
echo "Sample app changed — building ${{ matrix.platform }}."
70-
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
71-
echo "skip=true" >> "$GITHUB_OUTPUT"
72-
echo "Skipping iOS — no relevant changes detected."
73-
elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then
74-
echo "skip=true" >> "$GITHUB_OUTPUT"
75-
echo "Skipping Android — no relevant changes detected."
76-
elif [[ "${{ matrix.platform }}" == "web" && "${{ needs.detect-changes.outputs.needs_web }}" != "true" ]]; then
77-
echo "skip=true" >> "$GITHUB_OUTPUT"
78-
echo "Skipping Web — no relevant changes detected."
79-
fi
80-
81-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
82-
if: ${{ steps.platform-check.outputs.skip != 'true' }}
66+
uses: ./.github/actions/platform-check
67+
with:
68+
platform: ${{ matrix.platform }}
69+
sample_changed: ${{ needs.detect-changes.outputs.sample_expo }}
70+
needs_ios: ${{ needs.detect-changes.outputs.needs_ios }}
71+
needs_android: ${{ needs.detect-changes.outputs.needs_android }}
72+
needs_web: ${{ needs.detect-changes.outputs.needs_web }}
8373

8474
- name: Enable Corepack (NPM)
8575
if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform != 'ios' }}

.github/workflows/sample-application.yml

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -74,32 +74,16 @@ jobs:
7474
- ios-use-frameworks: 'dynamic-frameworks'
7575
platform: 'macos'
7676
steps:
77+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
78+
7779
- name: Check if platform is needed
7880
id: platform-check
79-
run: |
80-
# Sample app changes should always build all platforms (that's the
81-
# whole point of this workflow). The needs_ios/needs_android flags
82-
# only track SDK source & native code — not sample app files.
83-
SAMPLE_CHANGED="${{ needs.detect-changes.outputs.sample_react_native }}"
84-
85-
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
86-
echo "skip=false" >> "$GITHUB_OUTPUT"
87-
echo "Sample app changed — building ${{ matrix.platform }}."
88-
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
89-
echo "skip=true" >> "$GITHUB_OUTPUT"
90-
echo "Skipping iOS — no relevant changes detected."
91-
elif [[ "${{ matrix.platform }}" == "macos" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
92-
echo "skip=true" >> "$GITHUB_OUTPUT"
93-
echo "Skipping macOS — no relevant changes detected."
94-
elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then
95-
echo "skip=true" >> "$GITHUB_OUTPUT"
96-
echo "Skipping Android — no relevant changes detected."
97-
else
98-
echo "skip=false" >> "$GITHUB_OUTPUT"
99-
fi
100-
101-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
102-
if: ${{ steps.platform-check.outputs.skip != 'true' }}
81+
uses: ./.github/actions/platform-check
82+
with:
83+
platform: ${{ matrix.platform }}
84+
sample_changed: ${{ needs.detect-changes.outputs.sample_react_native }}
85+
needs_ios: ${{ needs.detect-changes.outputs.needs_ios }}
86+
needs_android: ${{ needs.detect-changes.outputs.needs_android }}
10387

10488
- name: Enable Corepack (NPM)
10589
if: ${{ steps.platform-check.outputs.skip != 'true' && matrix.platform == 'android' }}
@@ -264,26 +248,16 @@ jobs:
264248
build-type: 'production'
265249

266250
steps:
251+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
252+
267253
- name: Check if platform is needed
268254
id: platform-check
269-
run: |
270-
SAMPLE_CHANGED="${{ needs.detect-changes.outputs.sample_react_native }}"
271-
272-
if [[ "$SAMPLE_CHANGED" == "true" ]]; then
273-
echo "skip=false" >> "$GITHUB_OUTPUT"
274-
echo "Sample app changed — testing ${{ matrix.platform }}."
275-
elif [[ "${{ matrix.platform }}" == "ios" && "${{ needs.detect-changes.outputs.needs_ios }}" != "true" ]]; then
276-
echo "skip=true" >> "$GITHUB_OUTPUT"
277-
echo "Skipping iOS — no relevant changes detected."
278-
elif [[ "${{ matrix.platform }}" == "android" && "${{ needs.detect-changes.outputs.needs_android }}" != "true" ]]; then
279-
echo "skip=true" >> "$GITHUB_OUTPUT"
280-
echo "Skipping Android — no relevant changes detected."
281-
else
282-
echo "skip=false" >> "$GITHUB_OUTPUT"
283-
fi
284-
285-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
286-
if: ${{ steps.platform-check.outputs.skip != 'true' }}
255+
uses: ./.github/actions/platform-check
256+
with:
257+
platform: ${{ matrix.platform }}
258+
sample_changed: ${{ needs.detect-changes.outputs.sample_react_native }}
259+
needs_ios: ${{ needs.detect-changes.outputs.needs_ios }}
260+
needs_android: ${{ needs.detect-changes.outputs.needs_android }}
287261

288262
- name: Install Maestro
289263
if: ${{ steps.platform-check.outputs.skip != 'true' }}

packages/core/src/js/integrations/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export function getDefaultIntegrations(options: ReactNativeClientOptions): Integ
148148
(options._experiments && typeof options._experiments.replaysSessionSampleRate === 'number');
149149

150150
if (!hasReplayOptions && hasExperimentsReplayOptions) {
151-
// Remove in the next major version (v7)
151+
// Remove in the next major version (v9)
152152
options.replaysOnErrorSampleRate = options._experiments?.replaysOnErrorSampleRate;
153153
options.replaysSessionSampleRate = options._experiments?.replaysSessionSampleRate;
154154
}

packages/core/src/js/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export interface BaseReactNativeOptions {
125125

126126
/**
127127
* Set data to the inital scope
128-
* @deprecated Use `Sentry.configureScope(...)`
128+
* @deprecated Use `Sentry.getGlobalScope().setTag(...)`, `Sentry.getGlobalScope().setUser(...)`, etc. instead.
129129
*/
130130
initialScope?: CaptureContext;
131131

scripts/craft-pre-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ yarn install
1717
# --yes - skip all confirmation prompts
1818
yarn lerna version --force-publish --exact --no-git-tag-version --no-push --include-merged-tags --yes "${NEW_VERSION}"
1919
yarn set-version-samples
20-
node scripts/version-bump.js
20+
node scripts/bump-version.js
2121
# Update SDK versions table with the new release
2222
bash scripts/update-sdk-versions-table.sh

0 commit comments

Comments
 (0)