fix(ci): wire Sentry DSN + auth token into the Android release build (#209) - #244
Conversation
#241 added the @sentry/react-native SDK + app.json plugin but never fed EXPO_PUBLIC_SENTRY_DSN into android-release.yml. The real release path is expo prebuild + gradle bundleRelease (not `eas build`), so shipped builds had no DSN and the SDK no-op'd — mobile error tracking was silently off, the same wiring class as #232. Job-level EXPO_PUBLIC_SENTRY_DSN (from a GitHub Variable) so Metro inlines it at both prebuild and bundleRelease; job-level SENTRY_AUTH_TOKEN (from a Secret) for native symbol upload; organization + project added to the app.json Sentry plugin so the upload routes correctly. All non-breaking when unset: empty DSN -> SDK no-ops, no token -> upload skipped. Refs #209. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
There was a problem hiding this comment.
Code Review: PR #244
Scope: PR #244 — fix(ci): wire Sentry DSN + auth token into the Android release build
Recommendation: APPROVE
Summary
This PR wires EXPO_PUBLIC_SENTRY_DSN and SENTRY_AUTH_TOKEN into the job-level env block of android-release.yml so Metro inlines the DSN at both prebuild and bundle time. It also adds organization and project fields to the @sentry/react-native/expo plugin config in app.json to route symbol uploads to the correct Sentry project. The fix is narrow, correct, and safe — empty env vars cause graceful no-ops in both the SDK and the upload tool.
Findings
Critical
None
High
None
Medium
[Medium] SENTRY_AUTH_TOKEN not validated in "Validate release secrets" step
- dimension: Correctness (#1)
- location:
.github/workflows/android-release.yml:83-91 - issue: The
REQUIRED_SECRETSallowlist gates the build early on missing blocking secrets, butSENTRY_AUTH_TOKENis absent from it. If the token is missing, prebuild still runs and the symbol upload silently no-ops. This is intentional per the PR body, but it diverges from the validate-everything-upfront pattern. - risk: Shipped AABs without a symbol upload produce unreadable Sentry stack traces. The silent skip is hard to notice without reading the build log.
- fix: Either add
SENTRY_AUTH_TOKENto the step's env block andREQUIRED_SECRETSarray for a fast-fail experience, OR add a WHY comment on line 50 pointing to issue #209. CLAUDE.md rules 1 + 5 require a URL link for any intentional silence or workaround. - reference: CLAUDE.md rule 1 (root cause over silent failures); CLAUDE.md rule 5 (WHY comment must link a URL)
Low / Info
[Info] EXPO_PUBLIC_SENTRY_DSN correctly classified as a CI variable, not a secret
- The DSN is public-by-design (inlined into the JS bundle and visible to anyone who decompiles the APK). Using
vars.for DSN andsecrets.forSENTRY_AUTH_TOKENis the correct split. No action required.
[Info] organization + project in app.json are build-time config only
- These fields are consumed by the Sentry Expo plugin at prebuild time to write
sentry.properties, which the Gradle plugin reads when invoking the Sentry CLI at bundle time. No runtime effect. No action required.
Subagents
| Agent | Verdict |
|---|---|
| parity-checker | N/A — only app.json (config) and a workflow file changed; no mirrored source surface |
| i18n-syncer | N/A — no user-facing strings changed |
| contract-aligner | N/A — no packages/shared/src/types/*, endpoints.ts, or orbit-api changes |
| security-reviewer | N/A — no orbit-api code changed |
Validation
| Check | Result |
|---|---|
| Lint | N/A — YAML + JSON only |
| Type check | N/A — no TypeScript changed |
| Tests | N/A — no source code changed |
| Build (api) | N/A — CI/config diff only |
What's good
- Correct env inheritance model. Job-level
env:at line 42 flows to all steps, including the prebuild and Gradle steps that have their own additiveenv:blocks. No duplication needed. - Graceful degradation by design. Absent DSN → SDK no-ops; absent auth token → symbol upload skipped, build still produces the AAB. Both verified in the PR body.
- Narrow blast radius. 5 lines across 2 files; nothing changes for existing builds until the secrets are configured.
- Consistent with web Sentry.
apps/web/next.config.ts:35-36usesSENTRY_ORG+SENTRY_PROJECTfor the same symbol-upload routing; this PR brings mobile to parity. - PR description is excellent — explains root cause, the lesson from #232, graceful-degradation contract, and manual activation steps.
Recommendation
Clean, well-scoped CI fix. The one medium finding (SENTRY_AUTH_TOKEN not guarded upfront) is low-risk and intentional — just needs a WHY comment with a URL to satisfy the comment policy, or promote it to REQUIRED_SECRETS for a fast-fail experience. Neither blocks merge. Approve.
Generated with Claude Code



What
Wire mobile Sentry into the Android release build. #241 added the
@sentry/react-nativeSDK + theapp.jsonconfig plugin, but never fedEXPO_PUBLIC_SENTRY_DSNintoandroid-release.yml— and that workflow (expo prebuild+gradlew bundleRelease, noteas build) is the actual release path. So shipped builds carried no DSN,initSentry()no-op'd, and mobile error tracking was silently off. Same wiring class as #232 (env not reaching the real bundle step).Changes
.github/workflows/android-release.yml— job-levelenv::EXPO_PUBLIC_SENTRY_DSN: ${{ vars.EXPO_PUBLIC_SENTRY_DSN }}— job-level so Metro inlines it at both prebuild andbundleRelease(the Serve REAL AdMob ads on the free plan in production (not test ads) — pre-launch #232 lesson: the bundle step's env is what ships).SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}— native source-map / symbol upload at build time.apps/mobile/app.json—@sentry/react-native/expoplugin: addedorganization: thomasluizon+project: orbit-mobileso the symbol upload routes to the right project.Non-breaking by design
vars.EXPO_PUBLIC_SENTRY_DSN→ SDK no-ops (capture stays off), build unaffected.secrets.SENTRY_AUTH_TOKEN→ symbol upload is skipped, build still produces the AAB.Manual (to activate)
GitHub → Settings → Secrets and variables → Actions:
EXPO_PUBLIC_SENTRY_DSN= theorbit-mobileproject DSN (public-by-design).SENTRY_AUTH_TOKEN= a Sentry auth token withproject:releasesscope (build-only).The next release build then captures mobile errors and uploads symbols for readable stack traces. If the Sentry project slug isn't
orbit-mobile, updateprojectinapp.jsonto match.Refs #209.
🤖 Generated with Claude Code