wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.92k stars 1.3k forks source link

Adds Webview version in Sentry crash logging #20533

Closed antonis closed 1 month ago

antonis commented 1 month ago

Description

This PR adds the Webview version in Sentry crash logging to better monitor issues like https://github.com/wordpress-mobile/WordPress-Android/issues/20147

Notes

I initially considered adding the version in the extras https://github.com/wordpress-mobile/WordPress-Android/pull/20533/commits/4ba20a721dec802fc7b34a97b77d7d9e7a942e09. This worked (example) but additional data are not searchable/filterable making the added data less valuable. I switched to using a tag by using the applicationContextProvider that exposes it's data as tags. Another alternative would be to add a new dedicated field in the CrashLoggingDataProvider. Since this might not be valuable for other apps and to keep the enhancement simpler I didn't choose this path.


To Test:

  1. Run a build from this PR
  2. Trigger a crash (you could apply this patch and tap on the Posts menu option)
  3. Check Sentry and verify that the crash is received containing the webview.version tag (example)
Screenshot 2024-03-27 at 11 51 10 AM Screenshot 2024-03-27 at 11 51 17 AM

Regression Notes

  1. Potential unintended areas of impact

    • Sentry logging
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Manual testing
  3. What automated tests I added (or what prevented me from doing so)

    • Updated existing test cases

PR Submission Checklist:


Testing Checklist (strike-out the not-applying and unnecessary ones):

wpmobilebot commented 1 month ago
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20533-fb90630
Commitfb90630f67e9a98b7bece9d542796fb430b809a1
Direct Downloadjetpack-prototype-build-pr20533-fb90630.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 1 month ago
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20533-fb90630
Commitfb90630f67e9a98b7bece9d542796fb430b809a1
Direct Downloadwordpress-prototype-build-pr20533-fb90630.apk
Note: Google Login is not supported on these builds.
codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 40.24%. Comparing base (7ff5847) to head (fb90630).

Files Patch % Lines
...ndroid/util/crashlogging/WebviewVersionProvider.kt 0.00% 7 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## trunk #20533 +/- ## ========================================== - Coverage 40.24% 40.24% -0.01% ========================================== Files 1462 1463 +1 Lines 67592 67600 +8 Branches 11200 11201 +1 ========================================== + Hits 27204 27205 +1 - Misses 37927 37934 +7 Partials 2461 2461 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

antonis commented 1 month ago

Hey @wzieba 👋 I've added you as a reviewer on this PR since you might have a better understanding of the crash logging implementation in https://github.com/Automattic/Automattic-Tracks-Android. If you have the time any feedback is more than welcome 🙇

antonis commented 1 month ago

Thank you for the prompt review and feedback @wzieba 🙇

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud