Skip to content

chore: ci workflow for app size analysis#3368

Merged
buenaflor merged 20 commits intomainfrom
cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5
Mar 26, 2026
Merged

chore: ci workflow for app size analysis#3368
buenaflor merged 20 commits intomainfrom
cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor commented Nov 25, 2025

📜 Description

Adds a CI workflow to enable Sentry Size Analysis for the flutter/example app. This workflow builds production iOS (XCArchive) and Android (AAB) artifacts and uploads them to Sentry for size trend monitoring.

Additionally, the Android example app's application/package ID was renamed from io.sentry.samples.flutter to io.sentry.flutter.sample for consistency with Sentry's SDK naming conventions. This includes updating the Kotlin MainActivity package declaration, AndroidManifest.xml, build.gradle, proguard rules, and related test files.

💡 Motivation and Context

This change implements Sentry's Size Analysis feature to proactively monitor the sentry-flutter example app's size in CI. The goal is to track build size trends. This follows the official Sentry documentation for integrating Size Analysis into CI.

Example of how it looks like:

Android

image

iOS

image

Closes #3323

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

Monitor initial workflow runs to ensure successful uploads and correct data visibility in Sentry's Size Analysis feature. Consider adding size budget checks in future iterations.

#skip-changelog

@cursor
Copy link
Copy Markdown

cursor bot commented Nov 25, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@buenaflor buenaflor marked this pull request as ready for review November 26, 2025 16:07
@buenaflor buenaflor marked this pull request as draft November 26, 2025 16:26
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.33%. Comparing base (20faa47) to head (1b45278).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3368      +/-   ##
==========================================
+ Coverage   88.31%   90.33%   +2.01%     
==========================================
  Files         291       95     -196     
  Lines        9957     3198    -6759     
==========================================
- Hits         8794     2889    -5905     
+ Misses       1163      309     -854     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 27, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 423.94 ms 430.68 ms 6.74 ms
Size 14.31 MiB 15.49 MiB 1.19 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2d34233 470.54 ms 558.90 ms 88.36 ms
67de70c 375.88 ms 356.11 ms -19.77 ms
a909995 383.55 ms 370.78 ms -12.77 ms
73dca78 476.53 ms 522.21 ms 45.68 ms
640ad0c 466.00 ms 552.67 ms 86.67 ms
a10aff4 488.19 ms 515.02 ms 26.83 ms
c97f488 502.43 ms 492.47 ms -9.97 ms
396cb30 405.70 ms 427.56 ms 21.86 ms
cf443d2 464.64 ms 479.04 ms 14.40 ms
bbdbcb9 400.81 ms 409.12 ms 8.31 ms

App size

Revision Plain With Sentry Diff
2d34233 6.54 MiB 7.55 MiB 1.01 MiB
67de70c 14.31 MiB 15.49 MiB 1.19 MiB
a909995 14.09 MiB 15.28 MiB 1.19 MiB
73dca78 6.54 MiB 7.69 MiB 1.15 MiB
640ad0c 6.54 MiB 7.69 MiB 1.15 MiB
a10aff4 13.93 MiB 15.06 MiB 1.13 MiB
c97f488 14.31 MiB 15.49 MiB 1.19 MiB
396cb30 13.93 MiB 15.06 MiB 1.13 MiB
cf443d2 13.93 MiB 15.00 MiB 1.06 MiB
bbdbcb9 13.93 MiB 15.18 MiB 1.25 MiB

Previous results on branch: cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5

Startup times

Revision Plain With Sentry Diff
474a041 391.70 ms 377.71 ms -13.99 ms
7c194a8 382.81 ms 376.65 ms -6.16 ms
32c38b5 380.15 ms 365.10 ms -15.04 ms
5432a8c 437.59 ms 429.08 ms -8.51 ms

App size

Revision Plain With Sentry Diff
474a041 14.31 MiB 15.49 MiB 1.19 MiB
7c194a8 14.31 MiB 15.49 MiB 1.19 MiB
32c38b5 14.31 MiB 15.49 MiB 1.19 MiB
5432a8c 14.31 MiB 15.49 MiB 1.19 MiB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 27, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1242.42 ms 1250.74 ms 8.32 ms
Size 5.73 MiB 6.17 MiB 455.44 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
fd88186 1255.06 ms 1252.76 ms -2.30 ms
114239b 1225.74 ms 1230.17 ms 4.43 ms
a10aff4 1241.67 ms 1255.02 ms 13.35 ms
5a95d04 1263.17 ms 1265.37 ms 2.20 ms
e45c0e1 1269.08 ms 1278.83 ms 9.75 ms
f872f8e 1253.29 ms 1250.49 ms -2.80 ms
2cf9161 1248.33 ms 1266.55 ms 18.22 ms
75284dc 1254.81 ms 1262.28 ms 7.46 ms
7cfbbd6 1270.63 ms 1285.36 ms 14.72 ms
cf443d2 1255.79 ms 1248.38 ms -7.40 ms

App size

Revision Plain With Sentry Diff
fd88186 5.53 MiB 6.00 MiB 479.94 KiB
114239b 5.53 MiB 5.96 MiB 444.85 KiB
a10aff4 5.53 MiB 6.00 MiB 486.71 KiB
5a95d04 5.53 MiB 6.01 MiB 487.81 KiB
e45c0e1 7.86 MiB 9.44 MiB 1.58 MiB
f872f8e 5.53 MiB 5.96 MiB 444.81 KiB
2cf9161 7.86 MiB 9.44 MiB 1.58 MiB
75284dc 5.53 MiB 5.97 MiB 453.77 KiB
7cfbbd6 7.86 MiB 9.44 MiB 1.58 MiB
cf443d2 5.53 MiB 6.00 MiB 479.99 KiB

Previous results on branch: cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5

Startup times

Revision Plain With Sentry Diff
7c194a8 1257.20 ms 1264.68 ms 7.48 ms
474a041 1214.49 ms 1213.51 ms -0.98 ms
5432a8c 1249.52 ms 1252.86 ms 3.33 ms
32c38b5 1268.33 ms 1257.51 ms -10.82 ms

App size

Revision Plain With Sentry Diff
7c194a8 5.73 MiB 6.17 MiB 455.44 KiB
474a041 5.73 MiB 6.17 MiB 455.46 KiB
5432a8c 5.73 MiB 6.17 MiB 455.45 KiB
32c38b5 5.73 MiB 6.17 MiB 455.44 KiB

@buenaflor buenaflor marked this pull request as ready for review November 28, 2025 14:29
@buenaflor buenaflor marked this pull request as draft December 11, 2025 15:37
cursoragent and others added 11 commits March 25, 2026 15:33
This commit introduces a new GitHub Actions workflow to perform size analysis for Android and iOS builds using Sentry. The workflow is triggered on push to main/release branches and pull requests. It builds the app bundles/archives, uploads them to Sentry, and includes information about the commit SHA, repository, and branch for comparison.

Co-authored-by: giancarlo.buenaflor <giancarlo.buenaflor@sentry.io>
- Move MainActivity.kt to io/sentry/flutter/sample/ to match package declaration
- Extract common setup steps into size-analysis-setup composite action
- Remove auto-fetched args (head-sha, head-ref, base-ref, etc.) from sentry-cli upload
- Pin GitHub Actions to full-length commit SHAs per repo convention
- Update checkout to v6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor force-pushed the cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5 branch from 1b45278 to 7c194a8 Compare March 25, 2026 14:36
@sentry
Copy link
Copy Markdown

sentry bot commented Mar 25, 2026

Sentry Build Distribution

App Name App ID Version Configuration Install Page
sentry_flutter_example io.sentry.flutter.sample 9.15.0 (1) Release Install Build

@buenaflor buenaflor requested a review from denrase March 26, 2026 10:40
@buenaflor buenaflor marked this pull request as ready for review March 26, 2026 10:42
Copilot AI review requested due to automatic review settings March 26, 2026 10:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a GitHub Actions workflow to build release Android/iOS artifacts for the Flutter example app and upload them to Sentry Size Analysis, while also aligning the Android example app id/package with iOS and updating affected tests/fixtures.

Changes:

  • Add Size Analysis CI workflow (Android AAB + iOS XCArchive) and a shared composite setup action (Flutter install, Sentry CLI install, build version env).
  • Rename the Flutter example Android package/applicationId from io.sentry.samples.flutter to io.sentry.flutter.sample.
  • Update integration + JVM parsing tests/fixtures to match the new Android package name.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/flutter/test/jvm/jvm_frame_test.dart Update expected JVM frame class/package strings for renamed Android package.
packages/flutter/test/jvm/jvm_exception_test.dart Update JVM stack trace fixtures to use the new package name.
packages/flutter/test/android_platform_exception_event_processor_test.dart Update JVM stack trace fixture for platform exception processing to use the new package name.
packages/flutter/example/integration_test/integration_test.dart Align expected app id to the unified io.sentry.flutter.sample.
packages/flutter/example/android/app/src/main/kotlin/io/sentry/flutter/sample/MainActivity.kt Update Kotlin package declaration to match the new namespace/app id.
packages/flutter/example/android/app/src/main/AndroidManifest.xml Update manifest package to the new app id.
packages/flutter/example/android/app/proguard-rules.pro Update ProGuard keep rules to the new package namespace.
packages/flutter/example/android/app/build.gradle Update namespace and applicationId to io.sentry.flutter.sample.
.github/workflows/size-analysis.yml New workflow to build and upload Android/iOS artifacts for size analysis.
.github/actions/size-analysis-setup/action.yml New composite action to set up Flutter, install sentry-cli, and derive build version env.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

buenaflor and others added 2 commits March 26, 2026 13:32
Use fastlane build_release for code signing via match and upload via
sentry_upload_build plugin to produce installable build links from
Sentry's Size Analysis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SharedValues from build_release aren't available in a separate lane
invocation, so the path must be provided explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor changed the title Add ci workflow for app size analysis chore: ci workflow for app size analysis Mar 26, 2026
Removed 'metrics/flutter.properties' from paths for push and pull request triggers.
- Add --obfuscate and --split-debug-info to both Android and iOS builds
- Switch iOS runner to macos-latest
- Remove hardcoded Xcode version workaround
- Remove flutter pub get (handled by flutter build)
- Rename variable to flutter_version for clarity
- Unpin sentry-cli version

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor bot left a comment

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, enable autofix in the Cursor dashboard.

JNI requires exact name matching between native function symbols and
the Java/Kotlin fully-qualified class name. The function names still
referenced the old package path (io.sentry.samples.flutter), causing
UnsatisfiedLinkError at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor merged commit 694da33 into main Mar 26, 2026
63 checks passed
@buenaflor buenaflor deleted the cursor/add-ci-workflow-for-app-size-analysis-claude-4.5-opus-high-thinking-5fe5 branch March 26, 2026 16:35
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.

Use Emerge's Size Analysis

5 participants