ref(build): Consolidate sentry-java version into version catalog#1245
ref(build): Consolidate sentry-java version into version catalog#1245runningcode wants to merge 6 commits into
Conversation
40f1eec to
27eace0
Compare
The sentry SDK version was declared twice: once in libs.versions.toml (7.0.0, used for the plugin's own compile dependency) and once in gradle.properties as sdk_version (8.43.0, used as BuildConfig.SdkVersion for auto-installation defaults and telemetry). Consolidate into a single source of truth in libs.versions.toml and read it via libs.versions.sentry in build.gradle.kts. Dependabot (gradle package ecosystem, directory "/") now handles updates to the sentry version via libs.versions.toml, making the custom getsentry/github-workflows/updater job and scripts/update-android.sh redundant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
521eeeb to
91a36c2
Compare
| asm = "9.4" # // compatibility matrix -> https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/instrumentation/InstrumentationContext#apiversion | ||
| ktfmt = "0.51" | ||
| sqlite = "2.1.0" | ||
| sentry = "7.0.0" |
There was a problem hiding this comment.
i'm wondering why dependabot never updated this.
| name: CLI | ||
| ssh-key: ${{ secrets.CI_DEPLOY_KEY }} | ||
|
|
||
| android: |
There was a problem hiding this comment.
technically we don't need this if dependabot updates the libs.versions.toml.
The sentry SDK version was declared twice: once in libs.versions.toml (7.0.0, used for the plugin's own compile dependency) and once in gradle.properties as sdk_version (8.43.0, used as BuildConfig.SdkVersion for auto-installation defaults and telemetry). Consolidate into a single source of truth in libs.versions.toml and read it via libs.versions.sentry in build.gradle.kts. Update scripts/update-android.sh to read/write the version from libs.versions.toml instead of gradle.properties. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
||
| cd $(dirname "$0")/../ | ||
| file='plugin-build/gradle.properties' | ||
| file='gradle/libs.versions.toml' |
There was a problem hiding this comment.
I have a feeling that there is a bug here with dependabot and included builds and libs.versions.toml files since this was never updated. So let's keep the custom updater script but it will update a single source of truth now.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 30df376. Configure here.
sentry-android-okhttp was removed in sentry-java 8.0.0 and replaced by sentry-okhttp, which is a plain java-library (JAR) rather than an AAR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
[0-9\.]+ stops at the first non-numeric character, so when the current version in libs.versions.toml has a prerelease suffix (e.g. 9.0.0-RC1), set-version only matches the numeric prefix and leaves the suffix in place, producing corrupt entries like sentry = "9.1.0-RC1". Switch to [^"]+ so the entire value up to the closing quote is captured and replaced in one shot. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0xadam-brown
left a comment
There was a problem hiding this comment.
One comment, but doesn't have to block you.
| testImplementationAar(libs.sentryAndroid) | ||
| testImplementationAar(libs.sentryAndroidOkhttp) | ||
| testImplementation(libs.sentryOkhttp) | ||
| testImplementationAar(libs.sentryOkhttp) |
There was a problem hiding this comment.
l: Seems we should be able to get rid of the AAR config now that we're depending on the JAR directly.
VisitorTest verifies instrumented bytecode against the real classes on the test classpath. After bumping sentry to 8.43.0, the test classpath provides sentry-okhttp instead of sentry-android-okhttp, so io.sentry.android.okhttp.SentryOkHttpEventListener no longer resolves. The classloader then generated an empty stub extending Object, which is not an okhttp3.EventListener subtype, so the eventListener() call in the legacy useSentryAndroidOkHttp path failed bytecode verification. Generate a stub for it that extends io.sentry.okhttp.SentryOkHttpEventListener, mirroring the real inheritance so the verifier accepts the call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sentry-okhttp is a plain JVM library, so pulling it through the testImplementationAar (.aar -> .jar) configuration is unnecessary; the testImplementation entry already provides it on the test classpath. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| ktfmt = "0.51" | ||
| sqlite = "2.1.0" | ||
| sentry = "7.0.0" | ||
| sentry = "8.43.0" |
There was a problem hiding this comment.
potentially bumping this all the time would require us adapting SentryTelemetryService, but that's probably a good thing
| sqliteFramework = { group = "androidx.sqlite", name = "sqlite-framework", version.ref = "sqlite" } | ||
| sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" } | ||
| sentryAndroid = { group = "io.sentry", name = "sentry-android", version.ref = "sentry" } | ||
| sentryAndroidOkhttp = { group = "io.sentry", name = "sentry-android-okhttp", version.ref = "sentry" } |
There was a problem hiding this comment.
could we still keep it at a fixed version and drop that codepath (and the dep) in the next major of the plugin altogether?

Remove the duplicate
sdk_versionproperty fromplugin-build/gradle.propertiesand consolidate the sentry SDK version into a single declaration ingradle/libs.versions.toml.I have a feeling that there is a bug here with included builds and
libs.versions.tomlfiles, so let's keep the custom script but it will update a single source of truth now.