chore: ci workflow for app size analysis#3368
Conversation
|
Cursor Agent can help with this pull request. Just |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. |
Android Performance metrics 🚀
|
| 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 |
iOS Performance metrics 🚀
|
| 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 |
packages/flutter/example/android/app/src/main/kotlin/io/sentry/flutter/sample/MainActivity.kt
Show resolved
Hide resolved
packages/flutter/test/android_platform_exception_event_processor_test.dart
Show resolved
Hide resolved
packages/flutter/example/android/app/src/main/kotlin/io/sentry/flutter/sample/MainActivity.kt
Show resolved
Hide resolved
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>
1b45278 to
7c194a8
Compare
Sentry Build Distribution
|
There was a problem hiding this comment.
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 AnalysisCI 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.fluttertoio.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.
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>
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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
packages/flutter/example/android/app/src/main/kotlin/io/sentry/flutter/sample/MainActivity.kt
Show resolved
Hide resolved
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>

📜 Description
Adds a CI workflow to enable Sentry Size Analysis for the
flutter/exampleapp. 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.fluttertoio.sentry.flutter.samplefor consistency with Sentry's SDK naming conventions. This includes updating the KotlinMainActivitypackage 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-flutterexample 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
iOS
Closes #3323
📝 Checklist
sendDefaultPiiis enabled🔮 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