You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-07-03] Set up Sentry release size analysis #82850
When we deploy App, if new packages are added or updated, then we can introduce start time regressions due to unexpected changes in bundle size.
Solution
Set up Sentry's size analysis feature with our deploy pipelines (for iOS/Android, staging/production/AdHoc).
Important Note: Access to Sentry is a prerequisite for this issue. Please do not post a proposal if you do not already have access to Expensify's Sentry dashboards.
Please re-state the problem that we are trying to solve in this issue.
When the App is deployed, new or updated packages can silently introduce start time regressions due to unexpected changes in bundle/binary size. There is currently no automated tracking of app binary size across releases, so these regressions go unnoticed until they impact users.
What is the root cause of that problem?
The deploy pipelines (deploy.yml for staging/production, buildAdHoc.yml for AdHoc builds) produce iOS and Android build artifacts (IPA/AAB) but never upload them to Sentry for size analysis. Despite having a mature Sentry integration for crash reporting and tracing (@sentry/react-native v7.6.0, org=expensify, project=app), the sentry-cli build upload command is not invoked anywhere in CI.
What changes do you think we should make in order to solve the problem?
Add sentry-cli build upload steps to the deploy workflows after build artifacts are produced. Specifically:
1. Staging/Production deploys (deploy.yml):
Android (after the fastlane android build_hybrid step at ~line 168): Upload the AAB artifact using npx @sentry/cli build upload <aab-path> --org expensify --project app --build-configuration Release
iOS (after the fastlane ios build_hybrid step at ~line 385): Upload the IPA artifact using npx @sentry/cli build upload <ipa-path> --org expensify --project app --build-configuration Release
Both steps should be conditional on SHOULD_BUILD_APP (same as the build steps), since production deploys promote existing builds rather than creating new ones
2. AdHoc builds (buildAdHoc.yml):
Android (after the Rock remote build step at ~line 206): Upload the produced APK/AAB artifact
iOS (after the Rock remote build step at ~line 336): Upload the produced IPA artifact
Use --build-configuration AdHoc to distinguish from release builds in Sentry's UI
3. Ensure sentry-cli >= 2.58.2 is available in CI. It's already bundled with @sentry/react-native and accessible via npx @sentry/cli, but the version should be verified. If it's too old, add an explicit npm install @sentry/cli@latest step or use curl to install the standalone binary.
4. Auth token scoping: Verify that the existing SENTRY_AUTH_TOKEN GitHub secret has the project:releases scope required for size analysis uploads. If not, it needs to be updated in Sentry's auth token settings.
All upload steps should use continue-on-error: true (similar to SENTRY_ALLOW_FAILURE already in .env.example) so that a Sentry upload failure doesn't block deployments.
What alternative solutions did you explore? (Optional)
Standalone bundle size tracking via react-native-bundle-visualizer or custom scripts: Would require maintaining a separate tracking infrastructure. Sentry's built-in solution is preferable since it integrates with the existing Sentry dashboard and correlates size data with release metadata.
Using only the existing webpack-bundle-analyzer (web-only, npm run analyze-packages): This only covers web builds and is manual/ad-hoc — it doesn't run in CI and doesn't cover React Native binaries.
Uploading XCArchive instead of IPA for iOS: Sentry docs recommend XCArchive for more detailed breakdown, but the current Fastlane build_app step with export_method: "app-store" produces an IPA. Producing an XCArchive would require modifying the Fastlane lane to also preserve the intermediate archive. IPA is supported and sufficient for size tracking; XCArchive optimization could be a follow-up.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
Maybe a simpler solution is to only upload production builds, since we aren't really doing any deploy-cycle monitoring of bundle sizes. The prod data would naturally be <100 month, and if we wanted to optimize we would have the historical data to see the size breakdown over time.
Yes, that would be the best thing to do, but a production deploy is a store promotion (fastlane flipping the Google Play / TestFlight track on a binary that was uploaded days earlier during the staging deploy of that same version).
So as I understand it, we build staging and then the prod candidate we just promote directly from the stores to go to prod. So in our action we won't have the builds. That's why we were uploading each staging build - each staging build is the POTENTIAL production build. So gating uploads on the production branch would give us zero uploads in steady state - there's no .aab/.ipa on disk at that point to hand to sentry-cli.
The artifact promoted to production is identical to the one built on staging - same bytes, same hash. So measuring staging-build size is measuring production release size.
That's why my idea was to do just one staging deploy per day, which will give us consistent data without reaching the cap
I might be missing another point of view here, but I don't see the way how we would know that the staging build will be promoted to production
Well right now we upload builds to Sentry in buildAndroid.yml and buildIOS.yml. We should move that to deploy.yml with jobs for androidUploadSentry and iOSUploadSentry. Those jobs will:
Download the binaries that are being promoted to prod (from the GitHub Release matching the same version being promoted)
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.20-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@roryabraham@mallenexpensify@rinej The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
Activity
melvin-bot commentedon Feb 18, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (
External)melvin-bot commentedon Feb 18, 2026
Triggered auto assignment to @sonialiap (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.melvin-bot commentedon Feb 18, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
roryabraham commentedon Feb 18, 2026
Going to forego C+ services for this issue
MelvinBot commentedon Feb 18, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When the App is deployed, new or updated packages can silently introduce start time regressions due to unexpected changes in bundle/binary size. There is currently no automated tracking of app binary size across releases, so these regressions go unnoticed until they impact users.
What is the root cause of that problem?
The deploy pipelines (
deploy.ymlfor staging/production,buildAdHoc.ymlfor AdHoc builds) produce iOS and Android build artifacts (IPA/AAB) but never upload them to Sentry for size analysis. Despite having a mature Sentry integration for crash reporting and tracing (@sentry/react-nativev7.6.0, org=expensify, project=app), thesentry-cli build uploadcommand is not invoked anywhere in CI.What changes do you think we should make in order to solve the problem?
Add
sentry-cli build uploadsteps to the deploy workflows after build artifacts are produced. Specifically:1. Staging/Production deploys (
deploy.yml):fastlane android build_hybridstep at ~line 168): Upload the AAB artifact usingnpx @sentry/cli build upload <aab-path> --org expensify --project app --build-configuration Releasefastlane ios build_hybridstep at ~line 385): Upload the IPA artifact usingnpx @sentry/cli build upload <ipa-path> --org expensify --project app --build-configuration ReleaseSHOULD_BUILD_APP(same as the build steps), since production deploys promote existing builds rather than creating new ones2. AdHoc builds (
buildAdHoc.yml):--build-configuration AdHocto distinguish from release builds in Sentry's UI3. Ensure
sentry-cli>= 2.58.2 is available in CI. It's already bundled with@sentry/react-nativeand accessible vianpx @sentry/cli, but the version should be verified. If it's too old, add an explicitnpm install @sentry/cli@lateststep or usecurlto install the standalone binary.4. Auth token scoping: Verify that the existing
SENTRY_AUTH_TOKENGitHub secret has theproject:releasesscope required for size analysis uploads. If not, it needs to be updated in Sentry's auth token settings.All upload steps should use
continue-on-error: true(similar toSENTRY_ALLOW_FAILUREalready in.env.example) so that a Sentry upload failure doesn't block deployments.What alternative solutions did you explore? (Optional)
react-native-bundle-visualizeror custom scripts: Would require maintaining a separate tracking infrastructure. Sentry's built-in solution is preferable since it integrates with the existing Sentry dashboard and correlates size data with release metadata.webpack-bundle-analyzer(web-only,npm run analyze-packages): This only covers web builds and is manual/ad-hoc — it doesn't run in CI and doesn't cover React Native binaries.build_appstep withexport_method: "app-store"produces an IPA. Producing an XCArchive would require modifying the Fastlane lane to also preserve the intermediate archive. IPA is supported and sufficient for size tracking; XCArchive optimization could be a follow-up.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.58 remaining items
roryabraham commentedon Jun 16, 2026
Maybe a simpler solution is to only upload production builds, since we aren't really doing any deploy-cycle monitoring of bundle sizes. The prod data would naturally be <100 month, and if we wanted to optimize we would have the historical data to see the size breakdown over time.
rinej commentedon Jun 17, 2026
Yes, that would be the best thing to do, but a production deploy is a store promotion (fastlane flipping the Google Play / TestFlight track on a binary that was uploaded days earlier during the staging deploy of that same version).
So as I understand it, we build staging and then the prod candidate we just promote directly from the stores to go to prod. So in our action we won't have the builds. That's why we were uploading each staging build - each staging build is the POTENTIAL production build. So gating uploads on the production branch would give us zero uploads in steady state - there's no .aab/.ipa on disk at that point to hand to sentry-cli.
The artifact promoted to production is identical to the one built on staging - same bytes, same hash. So measuring staging-build size is measuring production release size.
That's why my idea was to do just one staging deploy per day, which will give us consistent data without reaching the cap
I might be missing another point of view here, but I don't see the way how we would know that the staging build will be promoted to production
roryabraham commentedon Jun 17, 2026
Well right now we upload builds to Sentry in
buildAndroid.ymlandbuildIOS.yml. We should move that todeploy.ymlwith jobs forandroidUploadSentryandiOSUploadSentry. Those jobs will:rinej commentedon Jun 19, 2026
Created PR with that change -> #94039
rinej commentedon Jun 24, 2026
@roryabraham please have a look on the PR when you have a moment -> #94039
melvin-bot commentedon Jun 26, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.20-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-07-03. 🎊
For reference, here are some details about the assignees on this issue:
[-]Set up Sentry release size analysis[/-][+][Due for payment 2026-07-03] Set up Sentry release size analysis[/+]melvin-bot commentedon Jun 26, 2026
@roryabraham @mallenexpensify @rinej The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
melvin-bot commentedon Jun 29, 2026
@rinej, @mallenexpensify, @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
roryabraham commentedon Jun 30, 2026
This is done. No payments due