Skip to content

Commit 1ae8108

Browse files
Fix tests for Spring 7 and Spring Boot 4 (#4614)
* Second attempt to fix Kotlin 2.2 * Format code * Third attempt at fixing Kotlin 2.2 compat * Fix tests for Spring 7 and Spring Boot 4 * Move Spring 7 and Spring Boot 4 packages (#4615) * Move Spring 7 and Spring Boot 4 packages * Fix class not found due to OTel not supporting spring boot 4 yet (#4616) * Format code * some fixes * change kotlin 1.8 to 1.9 and some cleanup * ignore warnings about api level that is not relevant * fix optional dependencies in SentryAutoConfiguration * Update trace origin * Remove duplicate e2e test config * Update Strings for Spring 7 and Spring Boot 4 * Disable Spring Boot 4 agentless e2e tests for now --------- Co-authored-by: Sentry Github Bot <[email protected]>
1 parent f90693a commit 1ae8108

File tree

185 files changed

+526
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+526
-499
lines changed

.github/workflows/system-tests-backend.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,12 @@ jobs:
5454
- sample: "sentry-samples-console"
5555
agent: "false"
5656
agent-auto-init: "true"
57-
- sample: "sentry-samples-spring-boot-jakarta"
58-
agent: "false"
59-
agent-auto-init: "true"
6057
- sample: "sentry-samples-spring-boot-4-webflux"
6158
agent: "false"
6259
agent-auto-init: "true"
63-
- sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
64-
agent: "false"
65-
agent-auto-init: "true"
60+
# - sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
61+
# agent: "false"
62+
# agent-auto-init: "true"
6663
- sample: "sentry-samples-spring-boot-4-opentelemetry"
6764
agent: "true"
6865
agent-auto-init: "true"

build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ plugins {
2020
alias(libs.plugins.kotlin.android) apply false
2121
alias(libs.plugins.kotlin.multiplatform) apply false
2222
alias(libs.plugins.kotlin.jvm) apply false
23-
// alias(libs.plugins.kotlin.jvm.spring7) apply false
2423
alias(libs.plugins.kotlin.spring) apply false
25-
// alias(libs.plugins.kotlin.spring7) apply false
2624
alias(libs.plugins.buildconfig) apply false
2725
// dokka is required by gradle-maven-publish-plugin.
2826
alias(libs.plugins.dokka) apply false

sentry-android-fragment/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ android {
2727

2828
kotlin {
2929
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
30-
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8
31-
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8
30+
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
31+
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
3232
}
3333

3434
testOptions {

sentry-android-replay/src/main/java/io/sentry/android/replay/Windows.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,21 @@ internal class RootViewsSpy private constructor() : Closeable {
124124

125125
private val delegatingViewList: ArrayList<View> =
126126
object : ArrayList<View>() {
127+
@Suppress("NewApi")
127128
override fun addAll(elements: Collection<View>): Boolean {
128129
listeners.forEach { listener ->
129130
elements.forEach { element -> listener.onRootViewsChanged(element, true) }
130131
}
131132
return super.addAll(elements)
132133
}
133134

135+
@Suppress("NewApi")
134136
override fun add(element: View): Boolean {
135137
listeners.forEach { it.onRootViewsChanged(element, true) }
136138
return super.add(element)
137139
}
138140

141+
@Suppress("NewApi")
139142
override fun removeAt(index: Int): View {
140143
val removedView = super.removeAt(index)
141144
listeners.forEach { it.onRootViewsChanged(removedView, false) }

sentry-android-replay/src/main/java/io/sentry/android/replay/capture/CaptureStrategy.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ internal interface CaptureStrategy {
125125
)
126126
}
127127

128+
@Suppress("NewApi")
128129
private fun buildReplay(
129130
options: SentryOptions,
130131
video: File,
@@ -256,6 +257,7 @@ internal interface CaptureStrategy {
256257
scopes?.captureReplay(replay, hint.apply { replayRecording = recording })
257258
}
258259

260+
@Suppress("NewApi")
259261
fun setSegmentId(segmentId: Int) {
260262
replay.segmentId = segmentId
261263
recording.payload?.forEach {

sentry-android-timber/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ android {
3535

3636
kotlin {
3737
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
38-
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8
39-
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8
38+
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
39+
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
4040
}
4141

4242
testOptions {

sentry-apollo-4/api/sentry-apollo-4.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public final class io/sentry/apollo4/SentryApollo4HttpInterceptor : com/apollogr
2020
public fun <init> (Lio/sentry/IScopes;Lio/sentry/apollo4/SentryApollo4HttpInterceptor$BeforeSpanCallback;Z)V
2121
public fun <init> (Lio/sentry/IScopes;Lio/sentry/apollo4/SentryApollo4HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;)V
2222
public synthetic fun <init> (Lio/sentry/IScopes;Lio/sentry/apollo4/SentryApollo4HttpInterceptor$BeforeSpanCallback;ZLjava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
23+
public fun dispose ()V
2324
public fun intercept (Lcom/apollographql/apollo/api/http/HttpRequest;Lcom/apollographql/apollo/network/http/HttpInterceptorChain;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
2425
}
2526

sentry-compose/build.gradle.kts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ kotlin {
2121
androidTarget {
2222
compilerOptions {
2323
jvmTarget.set(JvmTarget.JVM_1_8)
24-
apiVersion.set(KotlinVersion.KOTLIN_1_8)
25-
languageVersion.set(KotlinVersion.KOTLIN_1_8)
24+
apiVersion.set(KotlinVersion.KOTLIN_1_9)
25+
languageVersion.set(KotlinVersion.KOTLIN_1_9)
2626
}
2727
publishLibraryVariants("release")
2828
}
2929
jvm("desktop") {
3030
compilerOptions {
3131
jvmTarget.set(JvmTarget.JVM_1_8)
32-
apiVersion.set(KotlinVersion.KOTLIN_1_8)
33-
languageVersion.set(KotlinVersion.KOTLIN_1_8)
32+
apiVersion.set(KotlinVersion.KOTLIN_1_9)
33+
languageVersion.set(KotlinVersion.KOTLIN_1_9)
3434
}
3535
}
3636

@@ -47,8 +47,8 @@ kotlin {
4747
sourceSets {
4848
val commonMain by getting {
4949
compilerOptions {
50-
apiVersion.set(KotlinVersion.KOTLIN_1_8)
51-
languageVersion.set(KotlinVersion.KOTLIN_1_8)
50+
apiVersion.set(KotlinVersion.KOTLIN_1_9)
51+
languageVersion.set(KotlinVersion.KOTLIN_1_9)
5252
}
5353
}
5454
val androidMain by getting {

sentry-ktor-client/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ plugins {
1414

1515
tasks.withType<KotlinCompile>().configureEach {
1616
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
17+
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
18+
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
1719
}
1820

1921
kotlin { explicitApi() }

sentry-okhttp/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ plugins {
1414

1515
tasks.withType<KotlinCompile>().configureEach {
1616
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
17+
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
18+
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
1719
}
1820

1921
kotlin { explicitApi() }

0 commit comments

Comments
 (0)