embrace-io / embrace-android-sdk

Embrace mobile performance monitoring SDK for Android
https://embrace.io/docs/android/
Apache License 2.0
132 stars 8 forks source link

Add moshi rules to prevent adapters failing in minified build #1326

Closed fractalwrench closed 1 week ago

fractalwrench commented 1 week ago

Goal

Moshi requires enums to be annotated to prevent R8/ProGuard from stripping their values. Several enums in our codebase were not annotated in this way, which worked fine until we changed the ProGuard rules to be more specific in #1043.

This change adds the JsonClass annotation to enums as recommended.

Testing

Manually verified against the release build variant of a minified test app that no errors show up in Logcat related to serialization.

github-actions[bot] commented 1 week ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.

Project coverage is 82.94%. Comparing base (2967682) to head (337be04).

Files with missing lines Patch % Lines
...esdk/internal/serialization/DecoratedSerializer.kt 50.00% 7 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326/graphs/tree.svg?width=650&height=150&src=pr&token=4kNC8ceoVB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io)](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io) ```diff @@ Coverage Diff @@ ## master #1326 +/- ## ========================================== - Coverage 82.97% 82.94% -0.03% ========================================== Files 483 484 +1 Lines 11156 11173 +17 Branches 1707 1707 ========================================== + Hits 9257 9268 +11 - Misses 1163 1169 +6 Partials 736 736 ``` | [Files with missing lines](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io) | Coverage Δ | | |---|---|---| | [...id/embracesdk/internal/injection/InitModuleImpl.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-core%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Finjection%2FInitModuleImpl.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLWNvcmUvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL2luamVjdGlvbi9Jbml0TW9kdWxlSW1wbC5rdA==) | `100.00% <100.00%> (ø)` | | | [.../android/embracesdk/internal/comms/api/Endpoint.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fcomms%2Fapi%2FEndpoint.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL2NvbW1zL2FwaS9FbmRwb2ludC5rdA==) | `100.00% <100.00%> (ø)` | | | [...roid/embracesdk/internal/config/remote/Unwinder.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fconfig%2Fremote%2FUnwinder.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL2NvbmZpZy9yZW1vdGUvVW53aW5kZXIua3Q=) | `100.00% <100.00%> (ø)` | | | [...android/embracesdk/internal/payload/AnrInterval.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fpayload%2FAnrInterval.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL3BheWxvYWQvQW5ySW50ZXJ2YWwua3Q=) | `100.00% <ø> (ø)` | | | [...id/embracesdk/internal/payload/ApplicationState.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fpayload%2FApplicationState.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL3BheWxvYWQvQXBwbGljYXRpb25TdGF0ZS5rdA==) | `100.00% <ø> (ø)` | | | [...sdk/internal/payload/PushNotificationBreadcrumb.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fpayload%2FPushNotificationBreadcrumb.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL3BheWxvYWQvUHVzaE5vdGlmaWNhdGlvbkJyZWFkY3J1bWIua3Q=) | `76.92% <100.00%> (+1.92%)` | :arrow_up: | | [...android/embracesdk/internal/payload/ThreadState.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fpayload%2FThreadState.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL3BheWxvYWQvVGhyZWFkU3RhdGUua3Q=) | `100.00% <100.00%> (ø)` | | | [...ndroid/embracesdk/internal/payload/WebVitalType.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-payload%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fpayload%2FWebVitalType.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLXBheWxvYWQvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL3BheWxvYWQvV2ViVml0YWxUeXBlLmt0) | `100.00% <ø> (ø)` | | | [...esdk/internal/serialization/DecoratedSerializer.kt](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326?src=pr&el=tree&filepath=embrace-android-core%2Fsrc%2Fmain%2Fkotlin%2Fio%2Fembrace%2Fandroid%2Fembracesdk%2Finternal%2Fserialization%2FDecoratedSerializer.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io#diff-ZW1icmFjZS1hbmRyb2lkLWNvcmUvc3JjL21haW4va290bGluL2lvL2VtYnJhY2UvYW5kcm9pZC9lbWJyYWNlc2RrL2ludGVybmFsL3NlcmlhbGl6YXRpb24vRGVjb3JhdGVkU2VyaWFsaXplci5rdA==) | `50.00% <50.00%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/embrace-io/embrace-android-sdk/pull/1326/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=embrace-io)