Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPM Support #2280

Merged
merged 35 commits into from
Jan 20, 2025
Merged

SPM Support #2280

merged 35 commits into from
Jan 20, 2025

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Sep 10, 2024

📜 Description

Migration: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-add-swift-package-manager-support-to-an-existing-flutter-plugin

Enable SPM: https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-turn-on-swift-package-manager

  • Setup iOS project for SPM
  • Setup macOS project for SPM
  • Update plugin to import Hybrid SDK for Pods & SPM

💡 Motivation and Context

Closes #2250

💚 How did you test it?

📝 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

Copy link
Contributor

github-actions bot commented Sep 10, 2024

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

Generated by 🚫 dangerJS against 124590f

Copy link
Contributor

github-actions bot commented Sep 10, 2024

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 447.22 ms 533.02 ms 85.80 ms
Size 6.46 MiB 7.48 MiB 1.03 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
8ced2dc 295.58 ms 336.49 ms 40.91 ms
9f05645 349.43 ms 437.24 ms 87.81 ms
3adbea9 395.16 ms 447.88 ms 52.71 ms
f735167 404.38 ms 412.57 ms 8.19 ms
6a5a65d 410.26 ms 503.91 ms 93.65 ms
33d0587 308.79 ms 370.86 ms 62.07 ms
6d317ea 303.46 ms 356.06 ms 52.60 ms
256df44 447.58 ms 485.84 ms 38.25 ms
ed605cc 317.48 ms 374.24 ms 56.76 ms
3d305b9 403.55 ms 469.76 ms 66.20 ms

App size

Revision Plain With Sentry Diff
8ced2dc 6.06 MiB 7.03 MiB 990.29 KiB
9f05645 6.27 MiB 7.20 MiB 958.60 KiB
3adbea9 6.52 MiB 7.61 MiB 1.09 MiB
f735167 6.46 MiB 7.48 MiB 1.01 MiB
6a5a65d 6.35 MiB 7.41 MiB 1.05 MiB
33d0587 6.16 MiB 7.14 MiB 1007.47 KiB
6d317ea 5.94 MiB 6.92 MiB 1001.74 KiB
256df44 6.52 MiB 7.59 MiB 1.06 MiB
ed605cc 6.06 MiB 7.03 MiB 993.53 KiB
3d305b9 6.35 MiB 7.35 MiB 1021.16 KiB

Previous results on branch: feat/spm

Startup times

Revision Plain With Sentry Diff
5f38dda 432.24 ms 529.78 ms 97.54 ms
8adbf8e 481.79 ms 530.56 ms 48.77 ms
cf145b9 449.38 ms 538.56 ms 89.18 ms
160e5a5 460.87 ms 509.56 ms 48.69 ms
acc2ff0 470.52 ms 510.29 ms 39.77 ms
a4e2e38 459.34 ms 506.62 ms 47.28 ms
b2ebcf5 477.96 ms 578.92 ms 100.96 ms

App size

Revision Plain With Sentry Diff
5f38dda 6.46 MiB 7.48 MiB 1.02 MiB
8adbf8e 6.49 MiB 7.55 MiB 1.07 MiB
cf145b9 6.46 MiB 7.48 MiB 1.01 MiB
160e5a5 6.49 MiB 7.57 MiB 1.08 MiB
acc2ff0 6.49 MiB 7.57 MiB 1.08 MiB
a4e2e38 6.49 MiB 7.57 MiB 1.08 MiB
b2ebcf5 6.46 MiB 7.48 MiB 1.02 MiB

Copy link
Contributor

github-actions bot commented Sep 10, 2024

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1258.35 ms 1277.06 ms 18.71 ms
Size 8.42 MiB 9.89 MiB 1.47 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
7954fb3 1247.20 ms 1272.15 ms 24.94 ms
8ced2dc 1258.35 ms 1272.98 ms 14.62 ms
d0312c9 1205.55 ms 1224.45 ms 18.90 ms
25e9b59 1289.76 ms 1295.27 ms 5.51 ms
754cdbe 1261.67 ms 1280.88 ms 19.20 ms
e3ef570 1220.08 ms 1239.66 ms 19.58 ms
f275487 1291.65 ms 1339.92 ms 48.26 ms
cecd4ed 1232.88 ms 1250.65 ms 17.78 ms
6d317ea 1277.27 ms 1287.47 ms 10.20 ms
c1bb00f 1265.14 ms 1290.85 ms 25.71 ms

App size

Revision Plain With Sentry Diff
7954fb3 8.38 MiB 9.75 MiB 1.37 MiB
8ced2dc 8.10 MiB 9.16 MiB 1.07 MiB
d0312c9 8.32 MiB 9.39 MiB 1.06 MiB
25e9b59 8.16 MiB 9.15 MiB 1021.15 KiB
754cdbe 8.29 MiB 9.37 MiB 1.08 MiB
e3ef570 8.32 MiB 9.38 MiB 1.06 MiB
f275487 8.32 MiB 9.38 MiB 1.05 MiB
cecd4ed 8.38 MiB 9.75 MiB 1.37 MiB
6d317ea 8.15 MiB 9.12 MiB 986.26 KiB
c1bb00f 8.09 MiB 9.07 MiB 1001.06 KiB

Previous results on branch: feat/spm

Startup times

Revision Plain With Sentry Diff
acc2ff0 1223.71 ms 1233.08 ms 9.37 ms
cf145b9 1253.06 ms 1261.96 ms 8.90 ms
b2ebcf5 1230.84 ms 1260.41 ms 29.57 ms
8adbf8e 1258.88 ms 1281.85 ms 22.97 ms
5f38dda 1259.00 ms 1276.92 ms 17.92 ms
a4e2e38 1234.78 ms 1256.79 ms 22.01 ms
160e5a5 1250.08 ms 1277.88 ms 27.79 ms

App size

Revision Plain With Sentry Diff
acc2ff0 8.38 MiB 9.75 MiB 1.37 MiB
cf145b9 8.42 MiB 9.86 MiB 1.43 MiB
b2ebcf5 8.42 MiB 9.89 MiB 1.46 MiB
8adbf8e 8.38 MiB 9.73 MiB 1.36 MiB
5f38dda 8.42 MiB 9.86 MiB 1.44 MiB
a4e2e38 8.38 MiB 9.75 MiB 1.37 MiB
160e5a5 8.38 MiB 9.75 MiB 1.37 MiB

# Conflicts:
#	flutter/.gitignore
#	flutter/ios/sentry_flutter.podspec
uses locally build Swift.framwork for sim only
Copy link
Contributor

github-actions bot commented Nov 5, 2024

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/ios/Classes/SentryFlutterPluginApple.swift

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.63%. Comparing base (ea6d86d) to head (124590f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2280      +/-   ##
==========================================
+ Coverage   88.98%   92.63%   +3.65%     
==========================================
  Files         262       91     -171     
  Lines        8966     3013    -5953     
==========================================
- Hits         7978     2791    -5187     
+ Misses        988      222     -766     

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

Copy link
Contributor

github-actions bot commented Nov 6, 2024

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/ios/Classes/SentryFlutterPluginApple.swift

Copy link
Contributor

github-actions bot commented Nov 6, 2024

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/ios/Classes/SentryFlutterPluginApple.swift

Copy link
Contributor

github-actions bot commented Nov 6, 2024

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/ios/Classes/SentryFlutterPluginApple.swift

Copy link
Contributor

github-actions bot commented Nov 6, 2024

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/ios/Classes/SentryFlutterPluginApple.swift

# Conflicts:
#	flutter/ios/sentry_flutter.podspec
Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • flutter/ios/Classes/SentryFlutterPluginApple.swift

@denrase denrase marked this pull request as ready for review December 17, 2024 13:19
@denrase
Copy link
Collaborator Author

denrase commented Dec 17, 2024

@buenaflor sentry-cocoa with SPM support is now release. [Flutter 3.27] with SPM support also has landed.

@denrase denrase requested a review from buenaflor December 17, 2024 13:20
@buenaflor buenaflor removed the Blocked label Dec 17, 2024
Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

looks good!

do we need to do anything else when rolling out a release when this is merged or should it work automatically?

# Conflicts:
#	flutter/ios/sentry_flutter.podspec
@denrase denrase requested a review from buenaflor December 19, 2024 10:49
@denrase denrase enabled auto-merge (squash) December 19, 2024 10:50
Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

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

great! for me it's approved but won't approve it now because there's a risk of this breaking something in the release pipeline and with x-mas coming up its a bit risky :D

so wdyt if we merge it when holidays are over? @denrase

@denrase
Copy link
Collaborator Author

denrase commented Dec 19, 2024

@buenaflor Sure, don't want to mess with releases before the holidays. :) Tested it on a new project, works without CocoaPods.

Bildschirmfoto 2024-12-19 um 14 43 07

\cc @ueman 👀

@denrase denrase disabled auto-merge December 19, 2024 13:46
@ueman
Copy link
Collaborator

ueman commented Dec 19, 2024

I'm currently unable to test this. I'm right between jobs at the moment, so I don't have access to a code base which uses Sentry. (No clue whether the new one uses Sentry 😐) But it looks similar to a SPM migration in one of my packages and that didn't get any bug reports yet.

@denrase
Copy link
Collaborator Author

denrase commented Dec 30, 2024

@ueman Thanks for the feedback and congrats on the new job! :)

@buenaflor
Copy link
Contributor

@denrase I think we can merge this, pls update the branch

# Conflicts:
#	flutter/ios/sentry_flutter.podspec
CHANGELOG.md Outdated
@@ -78,6 +78,7 @@
```

- Warning (in a debug build) if a potentially sensitive widget is not masked or unmasked explicitly ([#2375](https://github.com/getsentry/sentry-dart/pull/2375))
- SPM Support ([#2280](https://github.com/getsentry/sentry-dart/pull/2280))
Copy link
Contributor

Choose a reason for hiding this comment

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

@denrase denrase merged commit 7659cbe into main Jan 20, 2025
61 checks passed
@denrase denrase deleted the feat/spm branch January 20, 2025 12:25
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # pin@v2.16.0
with:
channel: main
- run: flutter upgrade
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the point of running Flutter upgrade just after installing the latest flutter from the main channel? I've been removing these calls in the CI in the past and now that it have failed in another PR (https://github.com/getsentry/sentry-dart/actions/runs/13285871769/job/37094344923?pr=2670) I've noticed it's back.

Copy link
Contributor

Choose a reason for hiding this comment

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

we should change this to flutter pub get

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe not even needed since flutter build already calls it

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.

Swift Package Manger Support
4 participants