Skip to content

Enable Sentry Size Analysis#143

Merged
kpujjigit merged 8 commits into
masterfrom
enable-size-analysis
Apr 26, 2026
Merged

Enable Sentry Size Analysis#143
kpujjigit merged 8 commits into
masterfrom
enable-size-analysis

Conversation

@kpujjigit
Copy link
Copy Markdown
Contributor

Summary

  • Updates sentry-cli from 2.21.2 to latest (v3.3.5+ required for Size Analysis)
  • Adds a new Upload to Sentry Size Analysis step to release.yml that:
    1. Builds an XCArchive for generic/platform=iOS (code signing disabled — no distribution cert in CI)
    2. Uploads the archive via sentry-cli build upload so Sentry can track binary size across releases

The existing simulator build and GitHub release zip steps are unchanged.

Test plan

  • Trigger the release.yml workflow via workflow_dispatch
  • Confirm the new "Upload to Sentry Size Analysis" step passes
  • Check Sentry → Size Analysis for a new build entry with binary size breakdown

🤖 Generated with Claude Code

- Update sentry-cli to latest (≥3.3.5 required for size analysis)
- Add step to archive app and upload XCArchive to Sentry Size Analysis

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.565%. Comparing base (9c96dad) to head (a4e30d6).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##            master      #143       +/-   ##
=============================================
+ Coverage   29.460%   37.565%   +8.105%     
=============================================
  Files           14        14               
  Lines         1334      1339        +5     
  Branches       385       385               
=============================================
+ Hits           393       503      +110     
+ Misses         928       817      -111     
- Partials        13        19        +6     

see 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9c96dad...a4e30d6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kpujjigit
Copy link
Copy Markdown
Contributor Author

image

kpujjigit and others added 2 commits April 17, 2026 11:20
Passes --head-sha and --head-ref so each build is linked to its
exact commit and branch in the Sentry Size Analysis timeline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pinning to a specific version is more stable for CI — avoids
unexpected breaking changes from future sentry-cli releases.
3.3.5 is the minimum version required for Size Analysis.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread .github/workflows/release.yml Outdated
kpujjigit and others added 3 commits April 17, 2026 11:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reduces asset from 29MB to 13MB (~55% smaller) while still large
enough to trigger frozen frames and app hangs for Sentry perf demos.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
--vcs-provider and --head-repo-name are required by Sentry's API
whenever head-sha/head-ref are passed, otherwise the upload fails.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kpujjigit kpujjigit requested a review from itaybre April 17, 2026 18:50
Copy link
Copy Markdown
Contributor

@itaybre itaybre left a comment

Choose a reason for hiding this comment

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

Looks like the app is built twice during the release process, so it might be doing rework there.

Also, it might be a good idea to analyze the build on each PR, so we get build comparisons: https://docs.sentry.io/product/size-analysis/integrating-into-ci/

Comment on lines +25 to +43
- name: Upload to Sentry Size Analysis
run: |
xcodebuild archive \
-project EmpowerPlant.xcodeproj \
-scheme EmpowerPlant \
-configuration Release \
-destination "generic/platform=iOS" \
-archivePath build/EmpowerPlant.xcarchive \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
-quiet
sentry-cli build upload build/EmpowerPlant.xcarchive \
--org ${{ secrets.SENTRY_ORG }} \
--project ${{ secrets.SENTRY_PROJECT }} \
--build-configuration Release \
--head-sha ${{ github.sha }} \
--head-ref "${{ github.ref_name }}" \
--vcs-provider github \
--head-repo-name ${{ github.repository }}
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.

m: While this works, looks like the deploy script already builds the app once, so it might be a good idea to avoid building it twice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it - gonna strip the xcodebuild archive out of release.yml then.

kpujjigit and others added 2 commits April 21, 2026 10:30
On push to master: uploads a base build for comparison baseline.
On pull_request: uploads head build with base-sha, base-ref, and
pr-number so Sentry can produce a per-PR size diff.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves xcodebuild archive into deploy_project.sh alongside the
simulator build, so release.yml only does the sentry-cli upload.
Addresses reviewer feedback about the app being built twice in CI.

Note: two separate builds remain necessary — simulator for the
Saucelabs/GitHub release zip, real device for Size Analysis — but
both are now managed in one place.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kpujjigit kpujjigit merged commit 826990a into master Apr 26, 2026
6 of 7 checks passed
@kpujjigit kpujjigit deleted the enable-size-analysis branch April 26, 2026 20:28
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