Skip to content

Conversation

@buenaflor
Copy link
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.

💡 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

📝 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.


Open in Cursor Open in Web

#skip-changelog

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 <[email protected]>
@cursor
Copy link

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 1b45278

@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

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
Contributor

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 351.65 ms 372.72 ms 21.07 ms
Size 13.93 MiB 15.18 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
73a3c38 478.18 ms 526.62 ms 48.44 ms
40c8f93 417.10 ms 482.60 ms 65.50 ms
8541716 437.14 ms 443.65 ms 6.51 ms
d3fb366 391.49 ms 385.85 ms -5.64 ms
2cf9161 454.12 ms 512.67 ms 58.55 ms
1f639ee 429.98 ms 476.60 ms 46.62 ms
b6c8720 457.41 ms 519.04 ms 61.63 ms
a69a51f 437.18 ms 450.60 ms 13.42 ms
6bcdc99 440.23 ms 435.77 ms -4.46 ms
393f8ec 360.07 ms 362.70 ms 2.64 ms

App size

Revision Plain With Sentry Diff
73a3c38 6.54 MiB 7.69 MiB 1.15 MiB
40c8f93 13.93 MiB 15.00 MiB 1.06 MiB
8541716 13.93 MiB 15.00 MiB 1.06 MiB
d3fb366 13.93 MiB 15.06 MiB 1.13 MiB
2cf9161 6.54 MiB 7.70 MiB 1.16 MiB
1f639ee 13.93 MiB 15.00 MiB 1.06 MiB
b6c8720 6.54 MiB 7.69 MiB 1.15 MiB
a69a51f 13.93 MiB 15.06 MiB 1.13 MiB
6bcdc99 13.93 MiB 15.00 MiB 1.06 MiB
393f8ec 13.93 MiB 15.06 MiB 1.13 MiB

@github-actions
Copy link
Contributor

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1281.71 ms 1279.98 ms -1.73 ms
Size 5.53 MiB 6.02 MiB 501.33 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
c0dde50 1268.90 ms 1275.61 ms 6.71 ms
1f639ee 1252.43 ms 1257.82 ms 5.38 ms
7cfee3b 1260.90 ms 1273.14 ms 12.24 ms
192b44c 1269.08 ms 1275.52 ms 6.44 ms
7b21e8b 1256.79 ms 1267.12 ms 10.33 ms
6f47800 1247.52 ms 1259.37 ms 11.85 ms
ad121c0 1275.04 ms 1280.59 ms 5.55 ms
e04b24b 1230.22 ms 1233.90 ms 3.67 ms
819c1e7 1250.59 ms 1249.08 ms -1.51 ms
d0aa4b6 1268.23 ms 1268.39 ms 0.15 ms

App size

Revision Plain With Sentry Diff
c0dde50 5.53 MiB 6.01 MiB 488.14 KiB
1f639ee 5.53 MiB 6.00 MiB 479.95 KiB
7cfee3b 20.70 MiB 22.46 MiB 1.75 MiB
192b44c 5.53 MiB 5.96 MiB 444.33 KiB
7b21e8b 5.53 MiB 6.00 MiB 479.96 KiB
6f47800 7.86 MiB 9.44 MiB 1.58 MiB
ad121c0 5.53 MiB 6.01 MiB 488.11 KiB
e04b24b 5.53 MiB 6.00 MiB 480.00 KiB
819c1e7 5.53 MiB 6.00 MiB 479.96 KiB
d0aa4b6 5.53 MiB 6.02 MiB 502.04 KiB

@buenaflor buenaflor marked this pull request as ready for review November 28, 2025 14:29
@@ -1,4 +1,4 @@
package io.sentry.samples.flutter
package io.sentry.flutter.sample
Copy link

Choose a reason for hiding this comment

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

Bug: MainActivity.kt package declaration io.sentry.flutter.sample mismatches its directory io/sentry/samples/flutter/.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The MainActivity.kt file's package declaration io.sentry.flutter.sample does not match its physical directory structure io/sentry/samples/flutter/. This fundamental mismatch will cause the Kotlin compiler to reject the code, leading to an immediate failure of the Android build step in the CI workflow. This prevents the successful creation of the Android AAB artifact.

💡 Suggested Fix

Either move MainActivity.kt to io/sentry/flutter/sample/ or revert its package declaration to io.sentry.samples.flutter.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
packages/flutter/example/android/app/src/main/kotlin/io/sentry/samples/flutter/MainActivity.kt#L1

Potential issue: The `MainActivity.kt` file's package declaration
`io.sentry.flutter.sample` does not match its physical directory structure
`io/sentry/samples/flutter/`. This fundamental mismatch will cause the Kotlin compiler
to reject the code, leading to an immediate failure of the Android build step in the CI
workflow. This prevents the successful creation of the Android AAB artifact.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 4268466

at io.sentry.samples.flutter.MainActivity.lambda\$TiSaAm1LIEmKLVswI4BlR_5sw5Y(Unknown Source:0)
at io.sentry.samples.flutter.-\$\$Lambda\$MainActivity\$TiSaAm1LIEmKLVswI4BlR_5sw5Y.onMethodCall(Unknown Source:2)
at io.sentry.flutter.sample.MainActivity.configureFlutterEngine\$lambda-0(MainActivity.kt:40)
at io.sentry.flutter.sample.MainActivity.lambda\$TiSaAm1LIEmKLVswI4BlR_5sw5Y(Unknown Source:0)
Copy link

Choose a reason for hiding this comment

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

Bug: Old package ID io.sentry.samples.flutter remains in AppFrameworkInfo.plist and run.sh.
Severity: HIGH | Confidence: High

🔍 Detailed Analysis

The old package ID io.sentry.samples.flutter is still referenced in packages/flutter/example/ios/Flutter/AppFrameworkInfo.plist and packages/flutter/example/run.sh. This indicates an incomplete update of the package ID across the project, which could lead to build failures or incorrect application behavior on iOS and during script execution.

💡 Suggested Fix

Update all remaining references of io.sentry.samples.flutter to the new package ID io.sentry.flutter.sample in AppFrameworkInfo.plist and run.sh.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location:
packages/flutter/test/android_platform_exception_event_processor_test.dart#L247

Potential issue: The old package ID `io.sentry.samples.flutter` is still referenced in
`packages/flutter/example/ios/Flutter/AppFrameworkInfo.plist` and
`packages/flutter/example/run.sh`. This indicates an incomplete update of the package ID
across the project, which could lead to build failures or incorrect application behavior
on iOS and during script execution.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 4268466

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.

3 participants