feat: [SDK-4999] emit Kotlin version on remote log resource attrs - #2713
feat: [SDK-4999] emit Kotlin version on remote log resource attrs#2713abdulraqeeb33 wants to merge 6 commits into
Conversation
Pin OneSignal-KMP-SDK to the SDK-4999 commit and wire Android hosts to supply KotlinVersion.CURRENT so dashboards can filter by language stack. Mirrors the same attrs on the legacy otel path for parity. Co-authored-by: abdulraqeeb33 <abdulraqeeb33@users.noreply.github.com>
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)17/20 touched executable lines covered (85.0% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
|
Emit runtime toolchain extras via additionalVersionAttributes so dashboards can filter on ART Java language level and device API level alongside kotlin_version. Co-authored-by: abdulraqeeb33 <abdulraqeeb33@users.noreply.github.com>
Co-authored-by: abdulraqeeb33 <abdulraqeeb33@users.noreply.github.com>
fadi-george
left a comment
There was a problem hiding this comment.
Two issues to address before merge:
java.specification.versionis hardcoded to"0.9"on Android, soossdk.java_versionwould be misleading. Robolectric returns the host JDK version and masks this behavior.- Default interface getters preserve source compatibility, but older compiled
IOtelPlatformProviderimplementations may still throwAbstractMethodError.
Also, please trim attribute keys before removing ossdk. to avoid emitting ossdk.ossdk.*.
- Drop ossdk.java_version: ART hardcodes java.specification.version to "0.9"; Robolectric hid this by returning the host JDK version. - Make kotlinVersion/swiftVersion/additionalVersionAttributes required on IOtelPlatformProvider so we do not pretend Kotlin defaults give JVM binary compatibility without -Xjvm-default=all. - Trim attribute keys before stripping ossdk. so " ossdk.foo" cannot become ossdk.ossdk.foo. Co-authored-by: abdulraqeeb33 <abdulraqeeb33@users.noreply.github.com>
|
One compatibility concern remains: making these properties abstract removes source compatibility but does not prevent older compiled implementations from throwing The KDoc also says the interface and Android implementation share an artifact, but |
Drop the incorrect same-artifact / AbstractMethodError compatibility framing. Nobody outside the SDK implements this interface — leave the members abstract. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Agreed the KDoc was wrong on the same-artifact claim ( We're deliberately not adding a capability interface or default methods here though: this isn't a public implementor surface. The only production implementor is our own Updated the KDoc to say SDK-internal only and dropped the misleading binary-compat framing. |
|
I understand this is intended as SDK-internal, but it is still publicly exposed from the published :otel module, and public OtelFactory methods accept it. KDoc alone does not make it internal. Adding abstract properties is therefore a source-breaking API change for any external implementor. If we accept that risk because there are no known consumers, please document it as a deliberate compatibility break and update the PR body, which still says defaults preserve compatibility. |
Document :otel as SDK-internal (not for public use) and call out the deliberate source-compat break for new abstract IOtelPlatformProvider members. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@fadi-george Good catch — agreed. Updated to document |
Discussed with @fadi-george - the otel module is something that will always be consumed internally. We should deter external users to use it as we won't be supporting external usage of this module. |
Summary
Android host follow-up for OneSignal-KMP-SDK#17 (SDK-4999): supply
KotlinVersion.CURRENTso remote logs includeossdk.kotlin_versionfor dashboard filtering.Changes
OneSignal-KMP-SDKto KMP One Signal Android SDK getTags can't get all tags from server #17 (267b460,ar/sdk-4999).OtelPlatformProvider—kotlinVersion = KotlinVersion.CURRENT.toString().IOtelPlatformProvider/LoggerPlatformProviderAdapter— add abstractkotlinVersion/swiftVersion/additionalVersionAttributes(adapter forwards to the logger path).OtelFieldsTopLevel— mirrors KMPLogFieldsTopLevel(extras first, blank skip,ossdk.prefix normalize) so the legacy otel path stays at parity while both modules coexist.KotlinVersion.CURRENT; top-level attrs cover emit / blank omit / extras merge / reserved-key protection.:otel/IOtelPlatformProvider/OtelFactoryas SDK-internal (not for public use).Compatibility note
Adding the new abstract members on
IOtelPlatformProvideris a deliberate source-compatibility break for any external implementor of that interface.:otelis published andOtelFactoryaccepts the type, but this is an SDK-internal injection seam — the only production implementor isOtelPlatformProviderin:core, and there are no known external consumers. We are not adding default methods or a capability interface for this reason.Merge order
Test plan
:OneSignal:core:testDebugUnitTest --tests "*OtelPlatformProviderTest*":OneSignal:otel:testDebugUnitTest --tests "*OtelFieldsTopLevelTest*":OneSignal:core:compileDebugKotlinagainst pinned submoduleMade with Cursor