Skip to content

Commit

Permalink
Merge pull request #20483 from wordpress-mobile/bump_sentry_gradle_pl…
Browse files Browse the repository at this point in the history
…ugin

Bump Sentry Gradle plugin
  • Loading branch information
irfano authored Mar 20, 2024
2 parents ae393b7 + 6c59564 commit 1f319a4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 12 deletions.
21 changes: 13 additions & 8 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import io.sentry.android.gradle.extensions.InstrumentationFeature
import se.bjurr.violations.comments.github.plugin.gradle.ViolationCommentsToGitHubTask
import se.bjurr.violations.lib.model.SEVERITY

Expand All @@ -17,14 +18,18 @@ plugins {
sentry {
tracingInstrumentation {
enabled = true
features = [io.sentry.android.gradle.extensions.InstrumentationFeature.DATABASE]
logcat {
enabled = false
}
}
autoInstallation {
enabled = false
}
features = [InstrumentationFeature.DATABASE]
logcat.enabled = false
}
autoInstallation.enabled = false
includeSourceContext = true
autoUploadSourceContext = true
includeDependenciesReport = false
/* Sentry won't send source context or add performance instrumentations for debug builds
so we can save build times. Sending events will still work in debug builds
(if enabled in WPCrashLoggingDataProvider).
*/
ignoredBuildTypes = ["debug"]
}

repositories {
Expand Down
55 changes: 52 additions & 3 deletions docs/test_instructions_per_dependency_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,58 @@ and [here](https://github.com/orgs/wordpress-mobile/projects/95)).
<details>
<summary>Why & How</summary>

- TODO
- TODO
- TODO
`sentryVersion` in this project relates to Sentry Gradle Plugin only. Sentry SDK is bundled with
[Automattic-Tracks-Android](https://github.com/Automattic/Automattic-Tracks-Android).

#### Why?
We use Sentry Gradle Plugin to send ProGuard mapping files and source context files to Sentry. It
makes stacktrace readable on Sentry dashboard. This should be the main focus when testing after
bumping `sentryVersion`.

#### To Test

Please build the release variant (`vanillaRelease`) of both WordPress and Jetpack flavors and verify if issues are sent correctly. You can use the following snippet.

<details><summary>PATCH (warning: it'll probably have some conflicts in the future when `WPMainActivityViewModel` change. It's more for an idea:</summary>

```PATCH
Subject: [PATCH] tests: add a test for features in development generation
---
Index: WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt
--- a/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt (revision 806913d9fb807250cecd5b24b36001d55ea4c255)
+++ b/WordPress/src/main/java/org/wordpress/android/viewmodel/main/WPMainActivityViewModel.kt (date 1710772966823)
@@ -5,6 +5,7 @@
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.distinctUntilChanged
+import com.automattic.android.tracks.crashlogging.CrashLogging
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.firstOrNull
import org.wordpress.android.R
@@ -67,6 +68,7 @@
private val bloggingPromptsStore: BloggingPromptsStore,
@Named(UI_THREAD) private val mainDispatcher: CoroutineDispatcher,
private val shouldAskPrivacyConsent: ShouldAskPrivacyConsent,
+ private val crashLogging: CrashLogging,
) : ScopedViewModel(mainDispatcher) {
private var isStarted = false

@@ -161,6 +163,7 @@
launch { loadMainActions(site) }

updateFeatureAnnouncements()
+ crashLogging.sendReport(Throwable("Test crash"))
}

@Suppress("LongMethod")
```
</details>


</details>

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginManagement {
gradle.ext.agpVersion = '8.1.0'
gradle.ext.googleServicesVersion = '4.3.15'
gradle.ext.navigationVersion = '2.7.7'
gradle.ext.sentryVersion = '3.14.0'
gradle.ext.sentryVersion = '4.3.1'
gradle.ext.daggerVersion = "2.50"
gradle.ext.detektVersion = '1.23.0'
gradle.ext.violationCommentsVersion = '1.70.0'
Expand Down

0 comments on commit 1f319a4

Please sign in to comment.