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

feat: override native options #221

Merged
merged 31 commits into from
May 15, 2024
Merged

feat: override native options #221

merged 31 commits into from
May 15, 2024

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented May 10, 2024

📜 Description

Allows user to init with initWithPlatformOptions { } in the respective platform sourceSet which directly calls the native options

Requirements for being able to use this:

  • using the Gradle cocoapods plugin to create bindings for apple targets

Also open to changes to the API name

(the implementation is a pretty simple addition but changing multiple platforms in KMP just blows up the files changed stats)

💡 Motivation and Context

Implements #213

💚 How did you test it?

Unit tests

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • 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.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.

🔮 Next steps

Copy link
Contributor

github-actions bot commented May 10, 2024

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

Generated by 🚫 dangerJS against 7a15057

Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 78.52%. Comparing base (dc19da0) to head (7a15057).

Files Patch % Lines
...kotlin/io/sentry/kotlin/multiplatform/SentryKMP.kt 64.28% 5 Missing ⚠️
...lin/multiplatform/SentryPlatformOptions.android.kt 33.33% 0 Missing and 4 partials ⚠️
.../kotlin/multiplatform/SentryPlatformOptions.jvm.kt 20.00% 1 Missing and 3 partials ⚠️
...try/kotlin/multiplatform/SentryBridge.commonJvm.kt 90.90% 1 Missing ⚠️
...tlin/io/sentry/kotlin/multiplatform/Context.jvm.kt 0.00% 1 Missing ⚠️
...kotlin/multiplatform/SentryPlatformInstance.jvm.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   77.66%   78.52%   +0.85%     
==========================================
  Files          27       31       +4     
  Lines         412      419       +7     
  Branches       56       56              
==========================================
+ Hits          320      329       +9     
+ Misses         66       64       -2     
  Partials       26       26              

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

@buenaflor buenaflor marked this pull request as ready for review May 15, 2024 01:15
@buenaflor buenaflor requested a review from romtsn as a code owner May 15, 2024 01:15
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM!

anything against making the native dependencies api? I think that's what we do on RN for example

@buenaflor
Copy link
Contributor Author

buenaflor commented May 15, 2024

@romtsn actually I'd love to add it, then we can freely typealias stuff directly to the android/java sdk and the user doesn't need to add compileOnly(...) in their apps

the only thing speaking against it is that you'd have access to the android/java sdk directly in your android sourceSet but not sure if that's really so bad

The user just needs to be careful not to confuse io.sentry.Sentry with io.sentry.kotlin.multiplatform.Sentry for example

@romtsn
Copy link
Member

romtsn commented May 15, 2024

@romtsn actually I'd love to add it, then we can freely typealias stuff directly to the android/java sdk and the user doesn't need to add compileOnly(...) in their apps

the only thing speaking against it is that you'd have access to the android/java sdk directly in your android sourceSet but not sure if that's really so bad

The user just needs to be careful not to confuse io.sentry.Sentry with io.sentry.kotlin.multiplatform.Sentry for example

Let's expose it, I think we can always get back and re-think if there are problems. I also expect problems for those who use multiple sentry SDKs (e.g. RN and KMP which both expose the Android sdk), but then it's kind of not our problem and they'd have to resolve conflicts themselves. Just have to make sure we're not lagging behind with SDK updates for major bumps/breaking changes

@buenaflor buenaflor enabled auto-merge (squash) May 15, 2024 14:44
@buenaflor buenaflor merged commit 1c5183c into main May 15, 2024
9 of 10 checks passed
@buenaflor buenaflor deleted the feat/override-native-options branch May 15, 2024 15:51
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