Skip to content

chore: add Sentry Size Analysis uploads to nightly builds#28913

Merged
andrepimenta merged 7 commits into
mainfrom
chore/add-sentry-size-analysis-to-nightly
May 4, 2026
Merged

chore: add Sentry Size Analysis uploads to nightly builds#28913
andrepimenta merged 7 commits into
mainfrom
chore/add-sentry-size-analysis-to-nightly

Conversation

@andrepimenta

@andrepimenta andrepimenta commented Apr 16, 2026

Copy link
Copy Markdown
Member

Description

We have no visibility into how the native binary size (iOS xcarchive, Android AAB) changes over time. The existing JS bundle size check in CI only covers the JavaScript bundle, missing native libraries, assets, resources, and dex files that contribute to the install size users experience.

This PR integrates Sentry Size Analysis into the nightly build pipeline. After each nightly RC build completes, two new jobs download the build artifacts and upload them to Sentry for binary size tracking. Sentry then provides:

  • Build breakdown — see exactly where size comes from (native libs, assets, dex, Hermes bytecode, etc.)
  • Actionable insights — flags like uncompressed images, Hermes debug info in release builds, duplicate files, unnecessary bundled files
  • Nightly-over-nightly comparison — automatic diffs between consecutive nightly builds to spot regressions

The upload jobs run in parallel with the existing cleanup jobs, so they never block the critical path (TestFlight upload, branch cleanup).

Key design decisions

  • RC builds only — RC uses production code fencing, signing, and APIs, so binary size is representative of what ships to users
  • Separate build-configuration per platform (Release-iOS, Release-Android) — keeps Sentry comparisons scoped within the same platform
  • base-sha included — resolves the parent commit on main so Sentry can generate accurate build-over-build diffs
  • Off the critical path — runs as independent jobs after the RC builds complete, not as steps inside build.yml

Prerequisites

  • The MM_SENTRY_AUTH_TOKEN secret must have the org:ci scope (likely already the case since it's used for source map uploads)
  • Size Analysis must be enabled on the metamask-mobile Sentry project

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: Sentry Size Analysis uploads in nightly builds

  Scenario: nightly build uploads artifacts to Sentry Size Analysis
    Given the nightly build workflow runs at 04:00 UTC (or via workflow_dispatch)

    When the iOS RC and Android RC builds complete successfully
    Then two new "Sentry Size Analysis" jobs start in parallel
    And each job downloads the respective build artifact (xcarchive / AAB)
    And uploads it to Sentry using sentry-cli with correct metadata
    And the uploads appear on the Sentry Releases > Mobile Builds page

  Scenario: size analysis jobs do not block the critical path
    Given the nightly build workflow is running

    When the RC builds complete
    Then the Size Analysis jobs and the cleanup job run in parallel
    And the TestFlight upload for iOS is not delayed by the Size Analysis upload

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

Not applicable

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Moderate risk because it changes the nightly GitHub Actions pipeline and introduces new external sentry-cli uploads using a secret token, which could cause flaky/failed nightly runs if misconfigured.

Overview
Nightly build CI now uploads RC iOS and Android artifacts to Sentry Size Analysis to track native binary size over time.

After ios-rc/android-rc complete, new size-analysis-ios and size-analysis-android jobs download the xcarchive/aab artifacts, compute a base-sha from the previous commit, and run sentry-cli build upload with MM_SENTRY_AUTH_TOKEN and platform-specific --build-configuration metadata.

Reviewed by Cursor Bugbot for commit 02452e1. Bugbot is set up for automated code reviews on this repo. Configure here.

Upload iOS xcarchive and Android AAB from nightly RC builds to Sentry
Size Analysis for daily binary size tracking. The jobs run in parallel
with existing cleanup jobs so they never block the critical path.

Made-with: Cursor
@andrepimenta andrepimenta requested a review from a team as a code owner April 16, 2026 11:21
@metamaskbot metamaskbot added the team-mobile-platform Mobile Platform team label Apr 16, 2026
@github-actions github-actions Bot added size-S risk-low Low testing needed · Low bug introduction risk labels Apr 16, 2026
Comment thread .github/workflows/nightly-build.yml
The build pipeline zips the xcarchive via ditto before uploading as a
GitHub Actions artifact. The glob *.xcarchive won't match the zipped
*.xcarchive.zip file. Unzip it first so sentry-cli receives the
directory format it expects.

Made-with: Cursor
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 16, 2026
Comment thread .github/workflows/nightly-build.yml Outdated
Without ref: github.sha, checkout resolves refs/heads/main at execution
time. If commits land on main during the 1-2 hour build window, HEAD~1
would be the parent of a different commit than head-sha, giving Sentry
an inconsistent head/base pair.

Made-with: Cursor
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 17, 2026
jvbriones
jvbriones previously approved these changes Apr 17, 2026
tommasini
tommasini previously approved these changes Apr 17, 2026
@andrepimenta andrepimenta added the skip-e2e skip E2E test jobs label Apr 20, 2026
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 20, 2026
Filenames starting with dashes could be interpreted as options.
Using ./*.xcarchive.zip prevents this.

Made-with: Cursor
@andrepimenta andrepimenta dismissed stale reviews from tommasini and jvbriones via 3a2d60c April 20, 2026 09:44
@github-actions github-actions Bot added risk-low Low testing needed · Low bug introduction risk and removed risk-low Low testing needed · Low bug introduction risk labels Apr 20, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9dc7207. Configure here.

Comment thread .github/workflows/nightly-build.yml
sentry-cli build upload only supports xcarchive on ARM64 binaries.
The x86_64 Linux binary rejects xcarchive files. macOS runners
provide the ARM64 binary needed for xcarchive parsing.

Made-with: Cursor
@github-actions github-actions Bot removed the risk-low Low testing needed · Low bug introduction risk label Apr 21, 2026
@github-actions github-actions Bot added the risk-low Low testing needed · Low bug introduction risk label Apr 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is .github/workflows/nightly-build.yml, which adds two new CI jobs (size-analysis-ios and size-analysis-android) that upload nightly RC build artifacts to Sentry for binary size tracking. These changes are purely additive CI/CD infrastructure modifications:

  1. No application source code is modified
  2. No E2E test infrastructure is affected (no changes to Detox config, test fixtures, page objects, or test framework)
  3. The new jobs run in parallel with existing jobs and don't alter any existing workflow behavior
  4. No shared components (Browser, TabBar, Modals, Confirmations) are touched
  5. The change is a monitoring/observability improvement only

Since no app code or test infrastructure is changed, there is no need to run any E2E test tags. The nightly build workflow itself is not a test pipeline — it's a build/release pipeline, and the addition of Sentry size analysis jobs does not require E2E validation.

Performance Test Selection:
No application code changes were made. The PR only adds Sentry binary size analysis jobs to the nightly build CI workflow. There is no impact on app rendering, data loading, state management, or any user-facing flows that would warrant performance testing.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@andrepimenta andrepimenta enabled auto-merge May 4, 2026 10:03
@andrepimenta andrepimenta added this pull request to the merge queue May 4, 2026
Merged via the queue into main with commit 1e6a687 May 4, 2026
62 checks passed
@andrepimenta andrepimenta deleted the chore/add-sentry-size-analysis-to-nightly branch May 4, 2026 10:23
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.77.0 Issue or pull request that will be included in release 7.77.0 risk-low Low testing needed · Low bug introduction risk size-S skip-e2e skip E2E test jobs team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants