Skip to content

ref: Convert SentrySample to Swift#7405

Merged
philprime merged 10 commits intomainfrom
itay/swift-sentry-sample
Feb 27, 2026
Merged

ref: Convert SentrySample to Swift#7405
philprime merged 10 commits intomainfrom
itay/swift-sentry-sample

Conversation

@itaybre
Copy link
Contributor

@itaybre itaybre commented Feb 6, 2026

📜 Description

Converts SentrySample to Swift, mostly done by claude

💡 Motivation and Context

Less ObjC 🙌

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Closes #7429

@itaybre itaybre added the ready-to-merge Use this label to trigger all PR workflows label Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • (profiling) Remove launch profiling logs in sandboxed environments breaking CLI tools by philprime in #7294
  • Preserve NSException reason over unrelated crash_info_message by philprime in #7515

Documentation 📚

  • (ci) Add Cirrus Labs runner documentation by itaybre in #7522
  • Deprecate CocoaPods support in README by itaybre in #7526

Internal Changes 🔧

  • (ci) Update CI configurations to use runner concurrency groups by itaybre in #7511
  • Convert SentrySample to Swift by itaybre in #7405
  • Don't swiftlint generated sample code by 43jay in #7524
  • Remove unused .oclint config by philipphofmann in #7542
  • Remove unused .nvmrc by philipphofmann in #7540
  • Remove empty .gitmodules file by philipphofmann in #7538

Other

  • Fix optional chaining for window property access by benjaminpeters in #7508

🤖 This preview updates automatically when you update the PR.

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@0e4a9dc). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../Sentry/Profiling/SentryProfileDebugLoggerHelper.m 0.000% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #7405   +/-   ##
========================================
  Coverage        ?   85.025%           
========================================
  Files           ?       482           
  Lines           ?     28628           
  Branches        ?     12448           
========================================
  Hits            ?     24341           
  Misses          ?      4239           
  Partials        ?        48           
Files with missing lines Coverage Δ
...urces/Sentry/Profiling/SentryContinuousProfiler.mm 89.726% <ø> (ø)
...es/Sentry/Profiling/SentryProfilerSampleCreation.m 100.000% <100.000%> (ø)
...ces/Sentry/Profiling/SentryProfilerSerialization.m 63.598% <ø> (ø)
Sources/Sentry/Profiling/SentryProfilerState.mm 99.300% <100.000%> (ø)
Sources/Sentry/SentryProfileTimeseries.m 72.972% <ø> (ø)
Sources/Swift/Profiling/SentrySample.swift 100.000% <100.000%> (ø)
.../Sentry/Profiling/SentryProfileDebugLoggerHelper.m 0.000% <0.000%> (ø)

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 0e4a9dc...21318ac. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1206.90 ms 1246.00 ms 39.10 ms
Size 24.14 KiB 1.11 MiB 1.09 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
47c9f79 1216.57 ms 1240.94 ms 24.37 ms
d8db577 1206.83 ms 1244.39 ms 37.56 ms
59981b9 1207.25 ms 1240.71 ms 33.46 ms
e1e5f3b 1220.60 ms 1241.63 ms 21.04 ms
0e4a9dc 1222.92 ms 1255.78 ms 32.86 ms
db9e223 1193.69 ms 1213.56 ms 19.87 ms
e701dc8 1215.89 ms 1254.06 ms 38.17 ms
b984142 1219.17 ms 1250.17 ms 31.00 ms
3bff9ff 1217.72 ms 1246.43 ms 28.71 ms
2c4362a 1231.50 ms 1255.95 ms 24.45 ms

App size

Revision Plain With Sentry Diff
47c9f79 24.14 KiB 1.09 MiB 1.06 MiB
d8db577 24.14 KiB 1.06 MiB 1.04 MiB
59981b9 24.14 KiB 1.09 MiB 1.06 MiB
e1e5f3b 24.14 KiB 1.06 MiB 1.04 MiB
0e4a9dc 24.14 KiB 1.11 MiB 1.09 MiB
db9e223 24.14 KiB 1.06 MiB 1.03 MiB
e701dc8 24.14 KiB 1.06 MiB 1.04 MiB
b984142 24.14 KiB 1.11 MiB 1.09 MiB
3bff9ff 24.14 KiB 1.11 MiB 1.09 MiB
2c4362a 24.14 KiB 1.07 MiB 1.04 MiB

Previous results on branch: itay/swift-sentry-sample

Startup times

Revision Plain With Sentry Diff
edb00a9 1225.69 ms 1259.46 ms 33.77 ms
559d353 1210.88 ms 1248.72 ms 37.85 ms
71b09bb 1217.77 ms 1242.62 ms 24.85 ms

App size

Revision Plain With Sentry Diff
edb00a9 24.14 KiB 1.10 MiB 1.08 MiB
559d353 24.14 KiB 1.10 MiB 1.08 MiB
71b09bb 24.14 KiB 1.10 MiB 1.08 MiB

@itaybre itaybre marked this pull request as ready for review February 10, 2026 19:58
@github-actions github-actions bot mentioned this pull request Feb 10, 2026
7 tasks
Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

To be honest I don't see the value of this conversion, as it changes one file from Objective-C++ to Swift, but introduces 4 additional ones. Is this just an intermediate addition?

@itaybre
Copy link
Contributor Author

itaybre commented Feb 11, 2026

To be honest I don't see the value of this conversion, as it changes one file from Objective-C++ to Swift, but introduces 4 additional ones. Is this just an intermediate addition?

This one in particular is not relevant, I was testing compatibility with ObjC++ and Swift.
Eventually we will need to migrate them to Swift, so we need to find solutions for problems found.

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

I'll leave the decision to you.

Remove orphaned PBXBuildFile and PBXFileReference entries for
SentryPredicateDescriptor.m and .h. These files were deleted when
SentryPredicateDescriptor was migrated to Swift; the project
references caused potential build issues.
@philprime philprime enabled auto-merge (squash) February 27, 2026 10:25
@philprime philprime disabled auto-merge February 27, 2026 10:25
@philprime philprime enabled auto-merge (squash) February 27, 2026 10:25
@philprime
Copy link
Member

@sentry review

Copy link

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

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@philprime philprime merged commit bd65fee into main Feb 27, 2026
208 of 209 checks passed
@philprime philprime deleted the itay/swift-sentry-sample branch February 27, 2026 11:21
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: Convert SentrySample to Swift

2 participants