fix(ios): Skip source maps upload on Debug builds#6405
Conversation
The source-maps upload phase (sentry-xcode.sh) ran sentry-cli for every configuration, including Debug. Since sentry-cli v3 hard-fails without an org/auth token, local Debug builds without Sentry credentials fail with "An organization ID or slug is required" — whereas 7.x warned and continued. Add a *Debug* configuration guard, matching the native debug files upload (sentry-xcode-debug-files.sh) and the Android Gradle plugin. Debug builds now skip the upload and run the React Native bundling step directly. Fixes #6399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
@cursor review |
|
@sentry review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 39d7067. Configure here.
| if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then | ||
| echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping sourcemaps upload" | ||
| /bin/sh -c "$REACT_NATIVE_XCODE" | ||
| elif echo "$CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug" |
There was a problem hiding this comment.
Looking good! But, what about using ENABLE_TESTABILITY instead of CONFIGURATION?
There was a problem hiding this comment.
Good question @lucas-zimerman 👍 I used configuration mainly to align with sentry-xcode-debug-files.sh. I'll need to check and possibly refactor both places. Wdyt of following up on this separately?
📲 Install BuildsAndroid
|
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3b6e9f9+dirty | 3851.90 ms | 1233.33 ms | -2618.57 ms |
| 71abba0+dirty | 3821.93 ms | 1202.81 ms | -2619.12 ms |
| 57e0069+dirty | 3842.29 ms | 1212.12 ms | -2630.17 ms |
| 7a89652+dirty | 3861.46 ms | 1229.61 ms | -2631.85 ms |
| 0b1b5e3+dirty | 3823.96 ms | 1220.12 ms | -2603.84 ms |
| 3ce5254+dirty | 1219.93 ms | 1221.90 ms | 1.96 ms |
| 5a23c47+dirty | 3855.46 ms | 1221.95 ms | -2633.50 ms |
| 44c8b3f+dirty | 3823.85 ms | 1207.66 ms | -2616.19 ms |
| 4953e94+dirty | 1212.06 ms | 1214.83 ms | 2.77 ms |
| 04207c4+dirty | 1191.27 ms | 1189.78 ms | -1.48 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3b6e9f9+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 71abba0+dirty | 5.15 MiB | 6.67 MiB | 1.52 MiB |
| 57e0069+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
| 7a89652+dirty | 5.15 MiB | 6.70 MiB | 1.55 MiB |
| 0b1b5e3+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 3ce5254+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 5a23c47+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| 44c8b3f+dirty | 5.15 MiB | 6.66 MiB | 1.51 MiB |
| 4953e94+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 04207c4+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 57e0069+dirty | 3842.23 ms | 1210.00 ms | -2632.23 ms |
| 5125c43+dirty | 3827.94 ms | 1208.79 ms | -2619.15 ms |
| 580fb5c+dirty | 3835.45 ms | 1218.61 ms | -2616.84 ms |
| 7887847+dirty | 3844.89 ms | 1221.67 ms | -2623.22 ms |
| a5d243c+dirty | 3827.92 ms | 1220.10 ms | -2607.81 ms |
| f170ec3+dirty | 3844.74 ms | 1222.67 ms | -2622.07 ms |
| 68672fc+dirty | 3832.22 ms | 1228.29 ms | -2603.93 ms |
| ae37560+dirty | 3840.10 ms | 1217.89 ms | -2622.21 ms |
| e763471+dirty | 3826.10 ms | 1221.52 ms | -2604.58 ms |
| 2c735cc+dirty | 1223.33 ms | 1224.38 ms | 1.04 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 57e0069+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
| 5125c43+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 580fb5c+dirty | 4.98 MiB | 6.46 MiB | 1.48 MiB |
| 7887847+dirty | 4.98 MiB | 6.46 MiB | 1.48 MiB |
| a5d243c+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| f170ec3+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| 68672fc+dirty | 5.15 MiB | 6.71 MiB | 1.55 MiB |
| ae37560+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| e763471+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 2c735cc+dirty | 3.38 MiB | 4.74 MiB | 1.35 MiB |
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb93136+dirty | 500.37 ms | 532.58 ms | 32.21 ms |
| ae37560+dirty | 428.96 ms | 456.86 ms | 27.90 ms |
| 5c1e987+dirty | 444.71 ms | 475.13 ms | 30.42 ms |
| 5b7e8a7+dirty | 601.58 ms | 634.98 ms | 33.40 ms |
| c823bb5+dirty | 468.26 ms | 516.16 ms | 47.90 ms |
| 5a23c47+dirty | 406.83 ms | 451.47 ms | 44.64 ms |
| e763471+dirty | 538.31 ms | 574.44 ms | 36.13 ms |
| 7887847+dirty | 420.47 ms | 460.55 ms | 40.08 ms |
| acd838e+dirty | 492.90 ms | 551.42 ms | 58.52 ms |
| 6177334+dirty | 404.80 ms | 456.74 ms | 51.94 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb93136+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| ae37560+dirty | 48.30 MiB | 53.60 MiB | 5.29 MiB |
| 5c1e987+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 5b7e8a7+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| c823bb5+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 5a23c47+dirty | 49.74 MiB | 54.82 MiB | 5.07 MiB |
| e763471+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| 7887847+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| acd838e+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| 6177334+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
📢 Type of change
📜 Description
The iOS source-maps upload build phase (
sentry-xcode.sh) ransentry-cli react-native xcodefor every configuration, includingDebug. This adds a*Debug*configuration guard so Debug builds skip the upload and run the React Native bundling step directly.The guard mirrors the two upload paths that already skip Debug:
sentry-xcode-debug-files.sh(grep -iq "debug")sentry.gradle.kts(if (vName.contains("debug", ...)) return)so all three upload paths now share one convention: no upload on Debug.
💡 Motivation and Context
Fixes #6399.
Since SDK 8 bumped the bundled
sentry-clifrom v2 to v3,sentry-cli react-native xcodehard-fails when no org/auth token is configured:On 7.x (sentry-cli v2) this warned and continued. Because the source-maps script had no Debug guard, every local Debug build without Sentry credentials now fails until the developer discovers
SENTRY_DISABLE_AUTO_UPLOAD=true. Skipping upload on Debug restores a working local inner loop while keeping v3's strictness on Release/CI paths (where a silent upload skip would be a real footgun).💚 How did you test it?
sentry-xcode-scripts.test.ts: Debug skip (asserts a failingsentry-cliis not invoked and noerror:is emitted) and case-insensitivedebug.yarn jest test/scripts/sentry-xcode-scripts.test.ts— 38/38 pass.0(bundles, skips upload); Release still exits1(hard-fails on missing org).📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Minor behavior note: anyone who was relying on iOS source-map upload during Debug builds will no longer get it automatically (Release builds and manual
sentry-clistill work). This matches Android, which already skips Debug.🤖 Generated with Claude Code