Skip to content

Commit 01c920e

Browse files
authored
Merge branch 'main' into antonis/fix-e2e-flakiness-combined
2 parents bb24132 + 9d49612 commit 01c920e

11 files changed

Lines changed: 528 additions & 90 deletions

.github/file-filters.yml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,62 @@ high_risk_code: &high_risk_code
1616
- 'scripts/sentry-xcode.sh'
1717
- 'scripts/sentry-xcode-debug-files.sh'
1818
- 'sentry.gradle'
19-
19+
20+
# --- Platform-specific filters for CI optimization ---
21+
# Used by detect-changes.yml to skip platform-irrelevant CI jobs.
22+
23+
# Changes to the SDK's iOS native code only (packages/core).
24+
# Does NOT include sample apps — sample changes have their own filters below.
25+
ios_native:
26+
- 'packages/core/ios/**'
27+
- 'packages/core/RNSentryCocoaTester/**'
28+
- 'packages/core/RNSentry.podspec'
29+
30+
# Changes to the SDK's Android native code only (packages/core).
31+
# Does NOT include sample apps — sample changes have their own filters below.
32+
android_native:
33+
- 'packages/core/android/**'
34+
- 'packages/core/RNSentryAndroidTester/**'
35+
- 'packages/core/sentry.gradle'
36+
37+
# Changes to JS/TS source code (affects ALL platforms)
38+
js_source:
39+
- 'packages/core/src/**'
40+
- 'packages/core/plugin/**'
41+
- 'packages/core/scripts/**'
42+
- 'packages/core/package.json'
43+
- 'packages/core/tsconfig.json'
44+
- 'yarn.lock'
45+
- 'package.json'
46+
- '.yarnrc.yml'
47+
48+
# Changes to JS/TS test files only
49+
js_test:
50+
- 'packages/core/test/**'
51+
52+
# Changes to the React Native sample app.
53+
# Triggers: sample-application.yml, buildandtest.yml (job_bundle).
54+
# Does NOT trigger: native-tests.yml, e2e-v2.yml, sample-application-expo.yml.
55+
sample_react_native:
56+
- 'samples/react-native/**'
57+
- 'samples/react-native-macos/**'
58+
59+
# Changes to the Expo sample app.
60+
# Triggers: sample-application-expo.yml only.
61+
# Does NOT trigger: native-tests.yml, e2e-v2.yml, sample-application.yml.
62+
sample_expo:
63+
- 'samples/expo/**'
64+
65+
# Changes to E2E test infrastructure
66+
e2e_tests:
67+
- 'dev-packages/e2e-tests/**'
68+
69+
# Changes to performance test infrastructure
70+
perf_tests:
71+
- 'performance-tests/**'
72+
73+
# CI workflow or infrastructure changes (should trigger everything)
74+
ci:
75+
- '.github/workflows/**'
76+
- '.github/actions/**'
77+
- '.github/file-filters.yml'

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ permissions:
1414

1515
jobs:
1616
changelog-preview:
17-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@013a7b2113c2cac0ff32d5180cfeaefc7c9ce5b6 # V2
17+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@f4889d04564e47311038ecb6b910fef6b6cf1363 # V2
1818
secrets: inherit

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL
47-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # pin@v4.32.6
47+
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # pin@v4.34.1
4848
with:
4949
languages: ${{ matrix.language }}
5050
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,7 +55,7 @@ jobs:
5555
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5656
# If this step fails, then you should remove it and run the build manually (see below)
5757
- name: Autobuild
58-
uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # pin@v4.32.6
58+
uses: github/codeql-action/autobuild@38697555549f1db7851b81482ff19f1fa5c4fedc # pin@v4.34.1
5959

6060
# ℹ️ Command-line programs to run using the OS shell.
6161
# 📚 https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
@@ -66,4 +66,4 @@ jobs:
6666
# make bootstrap
6767
# make release
6868
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # pin@v4.32.6
69+
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # pin@v4.34.1
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
name: Detect Changes
2+
on:
3+
workflow_call:
4+
inputs:
5+
# Pass the caller's event name and ref so we can detect push-to-main/release.
6+
# Inside a reusable workflow github.event_name is always 'workflow_call',
7+
# so the caller must forward the real values explicitly.
8+
caller_event_name:
9+
description: 'The triggering event name from the caller (github.event_name)'
10+
required: true
11+
type: string
12+
caller_ref:
13+
description: 'The triggering ref from the caller (github.ref)'
14+
required: true
15+
type: string
16+
outputs:
17+
# Raw filter outputs — exposed for fine-grained use by callers
18+
ios_native:
19+
description: 'Whether SDK iOS native files changed'
20+
value: ${{ jobs.changes.outputs.ios_native }}
21+
android_native:
22+
description: 'Whether SDK Android native files changed'
23+
value: ${{ jobs.changes.outputs.android_native }}
24+
js_source:
25+
description: 'Whether JS/TS source files changed'
26+
value: ${{ jobs.changes.outputs.js_source }}
27+
js_test:
28+
description: 'Whether JS/TS test files changed'
29+
value: ${{ jobs.changes.outputs.js_test }}
30+
sample_react_native:
31+
description: 'Whether the React Native sample app changed'
32+
value: ${{ jobs.changes.outputs.sample_react_native }}
33+
sample_expo:
34+
description: 'Whether the Expo sample app changed'
35+
value: ${{ jobs.changes.outputs.sample_expo }}
36+
e2e_tests:
37+
description: 'Whether E2E test infrastructure changed'
38+
value: ${{ jobs.changes.outputs.e2e_tests }}
39+
perf_tests:
40+
description: 'Whether performance test infrastructure changed'
41+
value: ${{ jobs.changes.outputs.perf_tests }}
42+
ci:
43+
description: 'Whether CI workflow/action files changed'
44+
value: ${{ jobs.changes.outputs.ci }}
45+
# Convenience outputs consumed by individual workflows
46+
needs_ios:
47+
description: 'Whether iOS jobs should run (native tests, E2E, sample builds)'
48+
value: ${{ jobs.changes.outputs.needs_ios }}
49+
needs_android:
50+
description: 'Whether Android jobs should run (native tests, E2E, sample builds)'
51+
value: ${{ jobs.changes.outputs.needs_android }}
52+
needs_sample_react_native:
53+
description: 'Whether the React Native sample app workflow should run'
54+
value: ${{ jobs.changes.outputs.needs_sample_react_native }}
55+
needs_sample_expo:
56+
description: 'Whether the Expo sample app workflow should run'
57+
value: ${{ jobs.changes.outputs.needs_sample_expo }}
58+
needs_web:
59+
description: 'Whether web jobs should run (sample builds)'
60+
value: ${{ jobs.changes.outputs.needs_web }}
61+
62+
jobs:
63+
changes:
64+
name: Detect file changes
65+
runs-on: ubuntu-latest
66+
outputs:
67+
ios_native: ${{ steps.filter.outputs.ios_native }}
68+
android_native: ${{ steps.filter.outputs.android_native }}
69+
js_source: ${{ steps.filter.outputs.js_source }}
70+
js_test: ${{ steps.filter.outputs.js_test }}
71+
sample_react_native: ${{ steps.filter.outputs.sample_react_native }}
72+
sample_expo: ${{ steps.filter.outputs.sample_expo }}
73+
e2e_tests: ${{ steps.filter.outputs.e2e_tests }}
74+
perf_tests: ${{ steps.filter.outputs.perf_tests }}
75+
ci: ${{ steps.filter.outputs.ci }}
76+
needs_ios: ${{ steps.evaluate.outputs.needs_ios }}
77+
needs_android: ${{ steps.evaluate.outputs.needs_android }}
78+
needs_sample_react_native: ${{ steps.evaluate.outputs.needs_sample_react_native }}
79+
needs_sample_expo: ${{ steps.evaluate.outputs.needs_sample_expo }}
80+
needs_web: ${{ steps.evaluate.outputs.needs_web }}
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Detect changed paths
85+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
86+
id: filter
87+
with:
88+
filters: .github/file-filters.yml
89+
90+
- name: Evaluate what needs to run
91+
id: evaluate
92+
env:
93+
IOS_NATIVE: ${{ steps.filter.outputs.ios_native }}
94+
ANDROID_NATIVE: ${{ steps.filter.outputs.android_native }}
95+
JS_SOURCE: ${{ steps.filter.outputs.js_source }}
96+
SAMPLE_RN: ${{ steps.filter.outputs.sample_react_native }}
97+
SAMPLE_EXPO: ${{ steps.filter.outputs.sample_expo }}
98+
CI_CHANGED: ${{ steps.filter.outputs.ci }}
99+
E2E_TESTS: ${{ steps.filter.outputs.e2e_tests }}
100+
IS_MAIN_OR_RELEASE: ${{ inputs.caller_event_name == 'push' && (inputs.caller_ref == 'refs/heads/main' || startsWith(inputs.caller_ref, 'refs/heads/release/')) }}
101+
run: |
102+
echo "--- Change Detection Summary ---"
103+
echo "ios_native=$IOS_NATIVE"
104+
echo "android_native=$ANDROID_NATIVE"
105+
echo "js_source=$JS_SOURCE"
106+
echo "sample_react_native=$SAMPLE_RN"
107+
echo "sample_expo=$SAMPLE_EXPO"
108+
echo "ci=$CI_CHANGED"
109+
echo "e2e_tests=$E2E_TESTS"
110+
echo "is_main_or_release=$IS_MAIN_OR_RELEASE"
111+
112+
# iOS/Android native test suites and E2E builds run when:
113+
# - The SDK's own native code changed (packages/core/ios or android)
114+
# - JS source changed (may affect native bridges)
115+
# - CI config changed (need to validate workflows themselves)
116+
# - E2E test infra changed (they test both platforms end-to-end)
117+
# - Push to main or release branch (always run everything)
118+
# Sample app changes do NOT trigger the full native test suite —
119+
# they only trigger their own sample-application workflows.
120+
# Performance test changes do NOT trigger native tests either —
121+
# they only trigger the metrics job in e2e-v2.yml.
122+
if [[ "$IOS_NATIVE" == "true" \
123+
|| "$JS_SOURCE" == "true" \
124+
|| "$CI_CHANGED" == "true" \
125+
|| "$E2E_TESTS" == "true" \
126+
|| "$IS_MAIN_OR_RELEASE" == "true" ]]; then
127+
echo "needs_ios=true" >> "$GITHUB_OUTPUT"
128+
echo "=> needs_ios=true"
129+
else
130+
echo "needs_ios=false" >> "$GITHUB_OUTPUT"
131+
echo "=> needs_ios=false"
132+
fi
133+
134+
if [[ "$ANDROID_NATIVE" == "true" \
135+
|| "$JS_SOURCE" == "true" \
136+
|| "$CI_CHANGED" == "true" \
137+
|| "$E2E_TESTS" == "true" \
138+
|| "$IS_MAIN_OR_RELEASE" == "true" ]]; then
139+
echo "needs_android=true" >> "$GITHUB_OUTPUT"
140+
echo "=> needs_android=true"
141+
else
142+
echo "needs_android=false" >> "$GITHUB_OUTPUT"
143+
echo "=> needs_android=false"
144+
fi
145+
146+
# React Native sample workflow runs when the RN sample itself changed,
147+
# or when anything that the sample depends on changed (SDK source, CI).
148+
if [[ "$SAMPLE_RN" == "true" \
149+
|| "$JS_SOURCE" == "true" \
150+
|| "$IOS_NATIVE" == "true" \
151+
|| "$ANDROID_NATIVE" == "true" \
152+
|| "$CI_CHANGED" == "true" \
153+
|| "$IS_MAIN_OR_RELEASE" == "true" ]]; then
154+
echo "needs_sample_react_native=true" >> "$GITHUB_OUTPUT"
155+
echo "=> needs_sample_react_native=true"
156+
else
157+
echo "needs_sample_react_native=false" >> "$GITHUB_OUTPUT"
158+
echo "=> needs_sample_react_native=false"
159+
fi
160+
161+
# Expo sample workflow runs when the Expo sample itself changed,
162+
# or when anything that the sample depends on changed (SDK source, CI).
163+
if [[ "$SAMPLE_EXPO" == "true" \
164+
|| "$JS_SOURCE" == "true" \
165+
|| "$IOS_NATIVE" == "true" \
166+
|| "$ANDROID_NATIVE" == "true" \
167+
|| "$CI_CHANGED" == "true" \
168+
|| "$IS_MAIN_OR_RELEASE" == "true" ]]; then
169+
echo "needs_sample_expo=true" >> "$GITHUB_OUTPUT"
170+
echo "=> needs_sample_expo=true"
171+
else
172+
echo "needs_sample_expo=false" >> "$GITHUB_OUTPUT"
173+
echo "=> needs_sample_expo=false"
174+
fi
175+
176+
# Web builds run when:
177+
# - JS source changed (the web bundle depends on it)
178+
# - CI config changed (need to validate workflows themselves)
179+
# - Push to main or release branch (always run everything)
180+
if [[ "$JS_SOURCE" == "true" \
181+
|| "$CI_CHANGED" == "true" \
182+
|| "$IS_MAIN_OR_RELEASE" == "true" ]]; then
183+
echo "needs_web=true" >> "$GITHUB_OUTPUT"
184+
echo "=> needs_web=true"
185+
else
186+
echo "needs_web=false" >> "$GITHUB_OUTPUT"
187+
echo "=> needs_web=false"
188+
fi

0 commit comments

Comments
 (0)