Skip to content

Conversation

@noahsmartin
Copy link
Contributor

@noahsmartin noahsmartin commented Nov 20, 2025

Adds a new protocol for integrations that takes dependencies as an input. For the easiest migration conformers of the protocol can satisfy the Dependencies associated type with just typealias Dependencies = SentryDependencyContainer. This PR shows how it can be used to make the dependencies just define the minimum necessary dependencies so it can be easily mocked in tests.

#skip-changelog

Closes #6863

@noahsmartin noahsmartin added the ready-to-merge Use this label to trigger all PR workflows label Nov 20, 2025
@noahsmartin noahsmartin force-pushed the swiftIntegrations branch 2 times, most recently from ddc979e to 979af12 Compare November 20, 2025 19:26
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 52.38095% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.668%. Comparing base (5fcb6a1) to head (4a2d481).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rations/UserFeedback/UserFeedbackIntegration.swift 25.000% 12 Missing ⚠️
...Feedback/SentryUserFeedbackIntegrationDriver.swift 0.000% 5 Missing ⚠️
Sources/Sentry/SentryFeedbackAPI.m 0.000% 2 Missing ⚠️
Sources/Swift/Core/Integrations/Integrations.swift 94.117% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #6862       +/-   ##
=============================================
+ Coverage   84.650%   84.668%   +0.018%     
=============================================
  Files          452       453        +1     
  Lines        27603     27617       +14     
  Branches     12098     12112       +14     
=============================================
+ Hits         23366     23383       +17     
+ Misses        4191      4188        -3     
  Partials        46        46               
Files with missing lines Coverage Δ
Sources/Sentry/SentryHub.m 96.268% <100.000%> (ø)
Sources/Sentry/SentrySDKInternal.m 85.020% <100.000%> (-0.121%) ⬇️
Sources/Swift/SentryDependencyContainer.swift 98.437% <ø> (ø)
Sources/Swift/Core/Integrations/Integrations.swift 94.117% <94.117%> (ø)
Sources/Sentry/SentryFeedbackAPI.m 0.000% <0.000%> (ø)
...Feedback/SentryUserFeedbackIntegrationDriver.swift 0.000% <0.000%> (ø)
...rations/UserFeedback/UserFeedbackIntegration.swift 25.000% <25.000%> (ø)

... and 7 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 5fcb6a1...4a2d481. Read the comment docs.

@noahsmartin noahsmartin force-pushed the swiftIntegrations branch 3 times, most recently from b0d6dfe to 4a01fe6 Compare November 20, 2025 20:15
@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1222.02 ms 1248.70 ms 26.68 ms
Size 24.14 KiB 1.01 MiB 1015.45 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
1339919 1214.82 ms 1238.98 ms 24.16 ms
319fb1e 1219.48 ms 1242.69 ms 23.21 ms
3ec47ae 1231.02 ms 1256.67 ms 25.65 ms
e58d7bf 1219.98 ms 1242.39 ms 22.41 ms
85f7349 1232.28 ms 1248.27 ms 15.98 ms
7f26f16 1220.62 ms 1255.04 ms 34.42 ms
119ab1c 1226.79 ms 1254.55 ms 27.76 ms
1fe932f 1231.92 ms 1253.44 ms 21.52 ms
139db8b 1231.50 ms 1258.19 ms 26.69 ms
a4c5ddc 1239.61 ms 1266.41 ms 26.80 ms

App size

Revision Plain With Sentry Diff
1339919 23.75 KiB 919.70 KiB 895.95 KiB
319fb1e 23.75 KiB 1019.18 KiB 995.43 KiB
3ec47ae 23.75 KiB 919.88 KiB 896.13 KiB
e58d7bf 24.15 KiB 1.01 MiB 1014.91 KiB
85f7349 23.75 KiB 1.01 MiB 1006.48 KiB
7f26f16 23.75 KiB 1.02 MiB 1016.66 KiB
119ab1c 23.75 KiB 993.70 KiB 969.95 KiB
1fe932f 23.75 KiB 913.63 KiB 889.88 KiB
139db8b 23.75 KiB 920.64 KiB 896.89 KiB
a4c5ddc 23.75 KiB 977.30 KiB 953.55 KiB

Previous results on branch: swiftIntegrations

Startup times

Revision Plain With Sentry Diff
c1ceeee 1218.08 ms 1245.14 ms 27.06 ms

App size

Revision Plain With Sentry Diff
c1ceeee 24.14 KiB 1.02 MiB 1016.82 KiB

@noahsmartin noahsmartin force-pushed the swiftIntegrations branch 2 times, most recently from a35d333 to 10b2476 Compare November 20, 2025 21:12
@noahsmartin noahsmartin marked this pull request as ready for review November 20, 2025 21:12
@property (nullable, nonatomic, strong) SentrySession *session;

@property (nonatomic, strong) NSMutableArray<id<SentryIntegrationProtocol>> *installedIntegrations;
@property (nonatomic, strong) NSMutableArray<id> *installedIntegrations;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new version of this protocol is not accessible to ObjC, but as far as I can tell the fact this was previously SentryIntegrationProtocol wasn't important so it can just be replaced with id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ref: Use Swift integrations

2 participants