Skip to content

fix(ios): Skip source maps upload on Debug builds#6405

Merged
antonis merged 3 commits into
mainfrom
fix/6399-skip-ios-debug-sourcemaps-upload
Jul 7, 2026
Merged

fix(ios): Skip source maps upload on Debug builds#6405
antonis merged 3 commits into
mainfrom
fix/6399-skip-ios-debug-sourcemaps-upload

Conversation

@antonis

@antonis antonis commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

The iOS source-maps upload build phase (sentry-xcode.sh) ran sentry-cli react-native xcode for every configuration, including Debug. 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:

  • Native debug files upload — sentry-xcode-debug-files.sh (grep -iq "debug")
  • Android Gradle plugin — 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-cli from v2 to v3, sentry-cli react-native xcode hard-fails when no org/auth token is configured:

error: An organization ID or slug is required (provide with --org, set SENTRY_ORG, or use an org-scoped auth token)

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?

  • Added two unit tests to sentry-xcode-scripts.test.ts: Debug skip (asserts a failing sentry-cli is not invoked and no error: is emitted) and case-insensitive debug.
  • yarn jest test/scripts/sentry-xcode-scripts.test.ts — 38/38 pass.
  • Manual repro with a v3-style "organization ID required" mock CLI: Debug exits 0 (bundles, skips upload); Release still exits 1 (hard-fails on missing org).

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 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-cli still work). This matches Android, which already skips Debug.

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • fix(ios): Skip source maps upload on Debug builds by antonis in #6405

🤖 This preview updates automatically when you update the PR.

Comment thread CHANGELOG.md Outdated
@antonis

antonis commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@cursor review

@antonis

antonis commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@sentry review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@antonis antonis marked this pull request as ready for review July 6, 2026 10:30
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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! But, what about using ENABLE_TESTABILITY instead of CONFIGURATION?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me!

@antonis antonis requested a review from lucas-zimerman July 6, 2026 15:21
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jul 6, 2026
@sentry

sentry Bot commented Jul 6, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.17.2 (97) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3839.05 ms 1216.65 ms -2622.40 ms
Size 4.98 MiB 6.51 MiB 1.53 MiB

Baseline results on branch: main

Startup times

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

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3844.29 ms 1232.57 ms -2611.73 ms
Size 4.98 MiB 6.51 MiB 1.53 MiB

Baseline results on branch: main

Startup times

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

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 416.98 ms 465.86 ms 48.88 ms
Size 49.74 MiB 55.09 MiB 5.34 MiB

Baseline results on branch: main

Startup times

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

@lucas-zimerman lucas-zimerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@antonis antonis merged commit 513aeb3 into main Jul 7, 2026
139 of 148 checks passed
@antonis antonis deleted the fix/6399-skip-ios-debug-sourcemaps-upload branch July 7, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK 8 / sentry-cli 3: local Debug iOS builds hard-fail without SENTRY_ORG ("An organization ID or slug is required") — was warn-and-continue on 7.x

2 participants