Skip to content

[Due for payment 2026-07-03] Set up Sentry release size analysis #82850

Closed

Description

@roryabraham

Problem

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.

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Feb 18, 2026
  2. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Feb 18, 2026
  3. self-assigned this
    on Feb 18, 2026
  4. melvin-bot commented on Feb 18, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @abzokhattab (External)

  5. melvin-bot commented on Feb 18, 2026

    @melvin-bot

    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.

  6. melvin-bot commented on Feb 18, 2026

    @melvin-bot

    Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

  7. roryabraham commented on Feb 18, 2026

    @roryabraham
    ContributorAuthor

    Going to forego C+ services for this issue

  8. MelvinBot commented on Feb 18, 2026

    @MelvinBot
    Contributor

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

  9. 58 remaining items

  10. roryabraham commented on Jun 16, 2026

    @roryabraham
    ContributorAuthor

    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.

  11. rinej commented on Jun 17, 2026

    @rinej
    Contributor

    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

  12. roryabraham commented on Jun 17, 2026

    @roryabraham
    ContributorAuthor

    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:

    1. Download the binaries that are being promoted to prod (from the GitHub Release matching the same version being promoted)
    2. Then upload them to Sentry
  13. rinej commented on Jun 19, 2026

    @rinej
    Contributor

    Created PR with that change -> #94039

  14. rinej commented on Jun 24, 2026

    @rinej
    Contributor

    @roryabraham please have a look on the PR when you have a moment -> #94039

  15. melvin-bot commented on Jun 26, 2026

    @melvin-bot

    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:

    • @rinej does not require payment (Contractor)
  16. changed the title [-]Set up Sentry release size analysis[/-] [+][Due for payment 2026-07-03] Set up Sentry release size analysis[/+] on Jun 26, 2026
  17. melvin-bot commented on Jun 26, 2026

    @melvin-bot

    @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]

  18. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    @rinej, @mallenexpensify, @roryabraham Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  19. roryabraham commented on Jun 30, 2026

    @roryabraham
    ContributorAuthor

    This is done. No payments due

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions