Skip to content

[No QA] Add Sentry build size analysis for AdHoc builds#82952

Open
rinej wants to merge 12 commits intoExpensify:mainfrom
callstack-internal:set-up-sentry-adhoc-size-analysis
Open

[No QA] Add Sentry build size analysis for AdHoc builds#82952
rinej wants to merge 12 commits intoExpensify:mainfrom
callstack-internal:set-up-sentry-adhoc-size-analysis

Conversation

@rinej
Copy link
Contributor

@rinej rinej commented Feb 19, 2026

Explanation of Change

Uploads Android and iOS AdHoc builds to Sentry for size analysis after the Rock Remote Build step
Uses the ARTIFACT_PATH env var set by the Rock actions:
Android:
https://github.com/callstackincubator/android/blob/4cedf4d9b5c167452c96fe67233577e0fde9a025/action.yml#L274
iOS:
https://github.com/callstackincubator/ios/blob/dd30f7e53eee2ea6a59509793d0a30fbb5c91216/action.yml#L372

Fixed Issues

$ #82850
PROPOSAL:

Tests

  • Trigger a test build via testBuild.yml from this branch
  • Verify the Sentry upload steps appear in the GitHub Actions logs for both Android and iOS jobs
  • Confirm builds succeded
  • Check Sentry dashboard for AdHoc build size data

Offline tests

QA Steps

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@rinej rinej marked this pull request as ready for review February 19, 2026 15:41
@rinej rinej requested a review from a team as a code owner February 19, 2026 15:41
@melvin-bot melvin-bot bot requested review from jayeshmangwani and removed request for a team February 19, 2026 15:41
@melvin-bot
Copy link

melvin-bot bot commented Feb 19, 2026

@jayeshmangwani Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@roryabraham
Copy link
Contributor

@jayeshmangwani no C+ review needed here

@github-actions
Copy link
Contributor

🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Ok, looks like this worked for iOS but not Android:
https://expensify.sentry.io/explore/releases/?project=4510228107427840&statsPeriod=24h&tab=mobile-builds

Also, can we add a GitHub workflow annotation (with a ::notice:: log) to link to the uploaded Sentry builds?

Also, NAB --log-level debug is more verbose than I imagined

@roryabraham roryabraham changed the title Add Sentry build size analysis for AdHoc builds [No QA] Add Sentry build size analysis for AdHoc builds Feb 19, 2026
@github-actions
Copy link
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@rinej
Copy link
Contributor Author

rinej commented Feb 20, 2026

Great that we have it for ios. Here is also some useful bundle chart, also the potential savings recommendations looks good -> https://expensify.sentry.io/preprod/size/52159/?project=4510228107427840

For the Android issue, the main problem is that it was uploaded with the error:
“Failed to extract basic app information: Could not load binary manifest for APK”

From the CI logs, we can see that the APK was built and uploaded successfully, and the file size is valid (~174MB).

Most likely, the failure occurs when Sentry tried to parse the binary AndroidManifest.xml.

Sentry recommends using sentry-cli >= 2.58.2 for the build upload command. The workflow was using version 2.58.0 (resolved transitively via @sentry/webpack-plugin), which might be the cause of the issue.

I added @sentry/cli as a direct devDependency (pinned to 3.2.0) in package.json
(If we don't want to add it to package.json, we can install it directly in the workflow, let me know what is prefered)

@rinej
Copy link
Contributor Author

rinej commented Feb 20, 2026

I also added notice logs for better visibility. I know the logs are quite verbose, but once we confirm the flow works as expected, we can remove the --log-level debug flag, before merging to avoid bloating the logs

@github-actions
Copy link
Contributor

🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Contributor

@roryabraham
Copy link
Contributor

@rinej can we get an actual table with proper hyperlinks like we see in the existing build summary?

image

@roryabraham
Copy link
Contributor

Also, it looks like unfortunately the Android build size analysis failed again

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 15 files with indirect coverage changes

@rinej
Copy link
Contributor Author

rinej commented Feb 23, 2026

Also, it looks like unfortunately the Android build size analysis failed again

Ok, I’ve added the table with the bundle URLs - we should now see them under the AdHoc builds urls

@rinej
Copy link
Contributor Author

rinej commented Feb 23, 2026

For Android issue:
The upload itself succeeds (HTTP 200, artifact URL is returned), but in Sentry we see:

“Failed to extract basic app information: Could not load binary manifest for APK”

Looks like we built and uploaded correctly but Sentry cannot parse the APK and the AndroidManifest.xml.

The docs say both APK and AAB are supported, but AAB is the preferred format.
I checked GitHub for similar issues and didn’t find any matching reports. Most likely it is new feature, so not many people use it.

What we can do:

  • We could try to upload the AAB instead of APK, but for it we will need to run another build step
    ./gradlew bundleAdhoc which will add the couple of minutes to the build (~10min). Not sure hovwer if it will work easyliy with out adhoc-rock build

  • Report it to the Sentry - since the docs claim APK is supported, this manifest parsing failure looks like a bug.

@rinej
Copy link
Contributor Author

rinej commented Feb 23, 2026

Also just to make sure it is the app parsing issue caused by Sentry, we could test the Staging approach, from this branch:
#82937

On staging we are using the ABB format for Android, which is recommended by Sentry so it should be able to parse the Manifest correctly

@roryabraham
Copy link
Contributor

What we can do:

We could try to upload the AAB instead of APK, but for it we will need to run another build step

  • ./gradlew bundleAdhoc which will add the couple of minutes to the build (~10min). Not sure hovwer if it will work easyliy with out adhoc-rock build
  • Report it to the Sentry - since the docs claim APK is supported, this manifest parsing failure looks like a bug.

Let's do both!

@rinej
Copy link
Contributor Author

rinej commented Feb 24, 2026

Ok, I updated the PR to build AAB using Rock - with that we can test if that was the main issue with Sentry.
Could you trigger the adhoc?

I also adjusted the refactor with splitting the Sentry upload logic into separate buildAndroid and buildIOS files.

there might be an issue with downloading adhoc builds in AAB format for adhoc, but let's first verify if this fixes the main issue with Sentry. If yes, we can add conversion

@roryabraham
Copy link
Contributor

@rinej happy to run another AdHoc build, but I wanted to also point out #83268 to you - I was planning to decouple sentry uploads from iOS/Android native builds and move them into their own callable workflow, which would potentially centralize some of your changes here

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as resolved.

@github-actions
Copy link
Contributor

🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions
Copy link
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #82952 Mobile-Expensify PR Expensify/Mobile-Expensify#82937.

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.us-east-1.amazonaws.com/rock-artifacts/ad-hoc/rock-ios-device-AdHoc-043541a-87fa108-170358fe108bb5867cb9e24505cc3d2efa80fa33/index.html
Android iOS
Web 🕸️
⏩ SKIPPED ⏩
The build for Web was skipped

👀 View the workflow run that generated this build 👀

@rinej
Copy link
Contributor Author

rinej commented Feb 25, 2026

The upload was successful, so the issue is with Sentry parsing APK for android. When uploaded AAB it worked fine.
iOS -> https://expensify.sentry.io/preprod/size/58165/?project=4510228107427840
Android -> https://expensify.sentry.io/preprod/size/58157/?project=4510228107427840

For release we upload AAB by default so no additional changed there are needed, with that tested I think we can proceed with the release upload from that PR -> #82937
@roryabraham could you merge it and and cherry-pick to staging?

For add-hocs we need to find another solution, cause we need APK so it is easier to download and install on testing devices.

@rinej
Copy link
Contributor Author

rinej commented Feb 25, 2026

For the adhocs, the only solution I have for now is to keep the Rock build with the APK as it is (we need the APK for the S3 upload). And add another step to build the AAB. It adds some extra build time, but when Rock uses the cache build, it shouldn’t take too long. We can remove this extra step once Sentry fixes the APK parsing

@roryabraham
Copy link
Contributor

I think short term that's ok. I posted further thoughts in the #expert-contributors slack room here

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Can you please combine #82937 into this PR and close that other one? I've lost sight of why they're separate and I think I'd have a clearer picture of the changes if they were combined.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants