Skip to content

Commit 52df6e9

Browse files
adinauerclaude
andcommitted
ci(spring): Restore Spring Boot matrix coverage
Expand the Spring Boot 2 and 3 CI matrices to cover supported minor versions. Exclude GraphQL from Spring Boot 2 versions before 2.7 because the starter is unavailable there. Keep the Spring Boot 3 Gradle plugin pinned to a Gradle-compatible version while importing the tested Spring Boot BOM in samples, so the matrix exercises the intended runtime dependencies. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 917ebad commit 52df6e9

19 files changed

Lines changed: 206 additions & 67 deletions

File tree

.github/workflows/spring-boot-2-matrix.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
springboot-version: [ '2.7.17', '2.7.18' ]
22+
springboot-version: [ '2.1.0', '2.2.5', '2.4.13', '2.5.15', '2.6.15', '2.7.0', '2.7.18' ]
2323

2424
name: Spring Boot ${{ matrix.springboot-version }}
2525
env:
@@ -62,8 +62,15 @@ jobs:
6262

6363
- name: Update Spring Boot 2.x version
6464
run: |
65-
sed -i 's/^\(springboot2[[:space:]]*=[[:space:]]*\)".*"/\1"${{ matrix.springboot-version }}"/' gradle/libs.versions.toml
66-
echo "Updated Spring Boot 2.x version to ${{ matrix.springboot-version }}"
65+
springboot_version="${{ matrix.springboot-version }}"
66+
if [[ "$springboot_version" =~ ^2\.[0-3]\. ]]; then
67+
springboot_version="${springboot_version}.RELEASE"
68+
fi
69+
if [[ ! "$springboot_version" =~ ^2\.7\. ]]; then
70+
echo "ORG_GRADLE_PROJECT_excludeGraphql=true" >> "$GITHUB_ENV"
71+
fi
72+
sed -i 's/^\(springboot2[[:space:]]*=[[:space:]]*\)".*"/\1"'"$springboot_version"'"/' gradle/libs.versions.toml
73+
echo "Updated Spring Boot 2.x version to $springboot_version"
6774
6875
- name: Exclude android modules from build
6976
run: |

.github/workflows/spring-boot-3-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
springboot-version: [ '3.5.0', '3.5.13' ]
22+
springboot-version: [ '3.2.12', '3.3.13', '3.4.13', '3.5.13' ]
2323

2424
name: Spring Boot ${{ matrix.springboot-version }}
2525
env:

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ retrofit = "2.9.0"
3232
slf4j = "1.7.30"
3333
springboot2 = "2.7.18"
3434
springboot3 = "3.5.0"
35+
springboot3Plugin = "3.5.0"
3536
springboot4 = "4.0.0"
3637
# Android
3738
targetSdk = "36"
@@ -61,7 +62,7 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.8" }
6162
jacoco-android = { id = "com.mxalbert.gradle.jacoco-android", version = "0.2.0" }
6263
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
6364
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
64-
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3" }
65+
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3Plugin" }
6566
springboot4 = { id = "org.springframework.boot", version.ref = "springboot4" }
6667
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.1.7" }
6768
gretty = { id = "org.gretty", version = "4.0.0" }
@@ -160,6 +161,7 @@ slf4j2-api = { module = "org.slf4j:slf4j-api", version = "2.0.5" }
160161
spotlessLib = { module = "com.diffplug.spotless:com.diffplug.spotless.gradle.plugin", version.ref = "spotless"}
161162
springboot2-bom = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "springboot2" }
162163
springboot-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot2" }
164+
spring-graphql = { module = "org.springframework.graphql:spring-graphql", version = "1.0.6" }
163165
springboot-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot2" }
164166
springboot-starter-quartz = { module = "org.springframework.boot:spring-boot-starter-quartz", version.ref = "springboot2" }
165167
springboot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "springboot2" }

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry-noagent/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ java.targetCompatibility = JavaVersion.VERSION_17
1818

1919
repositories { mavenCentral() }
2020

21+
dependencyManagement {
22+
imports {
23+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
24+
mavenBom(libs.otel.instrumentation.bom.get().toString())
25+
}
26+
}
27+
2128
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2229
extra["kotlin-coroutines.version"] = "1.9.0"
2330

@@ -79,8 +86,6 @@ dependencies {
7986
testImplementation("ch.qos.logback:logback-core:1.5.16")
8087
}
8188

82-
dependencyManagement { imports { mavenBom(libs.otel.instrumentation.bom.get().toString()) } }
83-
8489
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
8590

8691
tasks.register<Test>("systemTest").configure {

sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ java.targetCompatibility = JavaVersion.VERSION_17
1919

2020
repositories { mavenCentral() }
2121

22+
dependencyManagement {
23+
imports {
24+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
25+
}
26+
}
27+
2228
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2329
extra["kotlin-coroutines.version"] = "1.9.0"
2430

sentry-samples/sentry-samples-spring-boot-jakarta/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ java.targetCompatibility = JavaVersion.VERSION_17
1818

1919
repositories { mavenCentral() }
2020

21+
dependencyManagement {
22+
imports {
23+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
24+
}
25+
}
26+
2127
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2228
extra["kotlin-coroutines.version"] = "1.9.0"
2329

sentry-samples/sentry-samples-spring-boot-opentelemetry-noagent/build.gradle.kts

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,35 @@ group = "io.sentry.sample.spring-boot"
1515

1616
version = "0.0.1-SNAPSHOT"
1717

18-
java.sourceCompatibility = JavaVersion.VERSION_17
18+
java.sourceCompatibility = JavaVersion.VERSION_11
1919

20-
java.targetCompatibility = JavaVersion.VERSION_17
20+
java.targetCompatibility = JavaVersion.VERSION_11
2121

2222
repositories { mavenCentral() }
2323

24+
fun springBoot2SupportsGraphql(): Boolean {
25+
val version = libs.versions.springboot2.get().removeSuffix(".RELEASE")
26+
val parts = version.split(".").map { it.toIntOrNull() ?: 0 }
27+
val major = parts.getOrElse(0) { 0 }
28+
val minor = parts.getOrElse(1) { 0 }
29+
return major > 2 || (major == 2 && minor >= 7)
30+
}
31+
32+
val includeGraphql = !project.hasProperty("excludeGraphql") && springBoot2SupportsGraphql()
33+
2434
configure<JavaPluginExtension> {
25-
sourceCompatibility = JavaVersion.VERSION_17
26-
targetCompatibility = JavaVersion.VERSION_17
35+
sourceCompatibility = JavaVersion.VERSION_11
36+
targetCompatibility = JavaVersion.VERSION_11
2737
}
2838

2939
tasks.withType<KotlinCompile>().configureEach {
30-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
40+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3141
}
3242

3343
tasks.withType<KotlinCompile>().configureEach {
3444
kotlin {
3545
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
36-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
46+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3747
}
3848
}
3949

@@ -43,7 +53,9 @@ dependencies {
4353
implementation(libs.springboot.starter)
4454
implementation(libs.springboot.starter.actuator)
4555
implementation(libs.springboot.starter.aop)
46-
implementation(libs.springboot.starter.graphql)
56+
if (includeGraphql) {
57+
implementation(libs.springboot.starter.graphql)
58+
}
4759
implementation(libs.springboot.starter.jdbc)
4860
implementation(libs.springboot.starter.quartz)
4961
implementation(libs.springboot.starter.security)
@@ -55,7 +67,9 @@ dependencies {
5567
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
5668
implementation(projects.sentrySpringBootStarter)
5769
implementation(projects.sentryLogback)
58-
implementation(projects.sentryGraphql)
70+
if (includeGraphql) {
71+
implementation(projects.sentryGraphql)
72+
}
5973
implementation(projects.sentryQuartz)
6074
implementation(projects.sentryOpentelemetry.sentryOpentelemetryAgentlessSpring)
6175
implementation(projects.sentryAsyncProfiler)
@@ -103,7 +117,15 @@ tasks.jar {
103117

104118
tasks.startScripts { dependsOn(tasks.shadowJar) }
105119

106-
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
120+
configure<SourceSetContainer> {
121+
main {
122+
if (!includeGraphql) {
123+
java.exclude("**/graphql/**")
124+
resources.exclude("graphql/**")
125+
}
126+
}
127+
test { java.srcDir("src/test/java") }
128+
}
107129

108130
tasks.register<Test>("systemTest").configure {
109131
group = "verification"
@@ -121,7 +143,12 @@ tasks.register<Test>("systemTest").configure {
121143
minHeapSize = "128m"
122144
maxHeapSize = "1g"
123145

124-
filter { includeTestsMatching("io.sentry.systemtest*") }
146+
filter {
147+
includeTestsMatching("io.sentry.systemtest*")
148+
if (!includeGraphql) {
149+
excludeTestsMatching("io.sentry.systemtest.Graphql*")
150+
}
151+
}
125152
}
126153

127154
tasks.named("test").configure {

sentry-samples/sentry-samples-spring-boot-opentelemetry/build.gradle.kts

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,32 @@ group = "io.sentry.sample.spring-boot"
1515

1616
version = "0.0.1-SNAPSHOT"
1717

18-
java.sourceCompatibility = JavaVersion.VERSION_17
18+
java.sourceCompatibility = JavaVersion.VERSION_11
1919

20-
java.targetCompatibility = JavaVersion.VERSION_17
20+
java.targetCompatibility = JavaVersion.VERSION_11
2121

2222
repositories { mavenCentral() }
2323

24+
fun springBoot2SupportsGraphql(): Boolean {
25+
val version = libs.versions.springboot2.get().removeSuffix(".RELEASE")
26+
val parts = version.split(".").map { it.toIntOrNull() ?: 0 }
27+
val major = parts.getOrElse(0) { 0 }
28+
val minor = parts.getOrElse(1) { 0 }
29+
return major > 2 || (major == 2 && minor >= 7)
30+
}
31+
32+
val includeGraphql = !project.hasProperty("excludeGraphql") && springBoot2SupportsGraphql()
33+
2434
configure<JavaPluginExtension> {
25-
sourceCompatibility = JavaVersion.VERSION_17
26-
targetCompatibility = JavaVersion.VERSION_17
35+
sourceCompatibility = JavaVersion.VERSION_11
36+
targetCompatibility = JavaVersion.VERSION_11
2737
}
2838

2939
tasks.withType<KotlinCompile>().configureEach {
30-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
40+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3141
kotlin {
3242
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
33-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
43+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
3444
}
3545
}
3646

@@ -39,7 +49,9 @@ dependencies {
3949
implementation(libs.springboot.starter)
4050
implementation(libs.springboot.starter.actuator)
4151
implementation(libs.springboot.starter.aop)
42-
implementation(libs.springboot.starter.graphql)
52+
if (includeGraphql) {
53+
implementation(libs.springboot.starter.graphql)
54+
}
4355
implementation(libs.springboot.starter.jdbc)
4456
implementation(libs.springboot.starter.quartz)
4557
implementation(libs.springboot.starter.security)
@@ -51,7 +63,9 @@ dependencies {
5163
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
5264
implementation(projects.sentrySpringBootStarter)
5365
implementation(projects.sentryLogback)
54-
implementation(projects.sentryGraphql)
66+
if (includeGraphql) {
67+
implementation(projects.sentryGraphql)
68+
}
5569
implementation(projects.sentryQuartz)
5670
implementation(projects.sentryAsyncProfiler)
5771
implementation(libs.otel)
@@ -99,7 +113,15 @@ tasks.jar {
99113

100114
tasks.startScripts { dependsOn(tasks.shadowJar) }
101115

102-
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
116+
configure<SourceSetContainer> {
117+
main {
118+
if (!includeGraphql) {
119+
java.exclude("**/graphql/**")
120+
resources.exclude("graphql/**")
121+
}
122+
}
123+
test { java.srcDir("src/test/java") }
124+
}
103125

104126
tasks.register<JavaExec>("bootRunWithAgent").configure {
105127
group = "application"
@@ -141,7 +163,12 @@ tasks.register<Test>("systemTest").configure {
141163
minHeapSize = "128m"
142164
maxHeapSize = "1g"
143165

144-
filter { includeTestsMatching("io.sentry.systemtest*") }
166+
filter {
167+
includeTestsMatching("io.sentry.systemtest*")
168+
if (!includeGraphql) {
169+
excludeTestsMatching("io.sentry.systemtest.Graphql*")
170+
}
171+
}
145172
}
146173

147174
tasks.named("test").configure {

sentry-samples/sentry-samples-spring-boot-webflux-jakarta/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ java.targetCompatibility = JavaVersion.VERSION_17
1818

1919
repositories { mavenCentral() }
2020

21+
dependencyManagement {
22+
imports {
23+
mavenBom("org.springframework.boot:spring-boot-dependencies:${libs.versions.springboot3.get()}")
24+
}
25+
}
26+
2127
// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
2228
extra["kotlin-coroutines.version"] = "1.9.0"
2329

sentry-samples/sentry-samples-spring-boot-webflux/build.gradle.kts

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,36 @@ group = "io.sentry.sample.spring-boot"
1515

1616
version = "0.0.1-SNAPSHOT"
1717

18-
java.sourceCompatibility = JavaVersion.VERSION_17
18+
java.sourceCompatibility = JavaVersion.VERSION_11
1919

20-
java.targetCompatibility = JavaVersion.VERSION_17
20+
java.targetCompatibility = JavaVersion.VERSION_11
2121

2222
repositories { mavenCentral() }
2323

24+
fun springBoot2SupportsGraphql(): Boolean {
25+
val version = libs.versions.springboot2.get().removeSuffix(".RELEASE")
26+
val parts = version.split(".").map { it.toIntOrNull() ?: 0 }
27+
val major = parts.getOrElse(0) { 0 }
28+
val minor = parts.getOrElse(1) { 0 }
29+
return major > 2 || (major == 2 && minor >= 7)
30+
}
31+
32+
val includeGraphql = !project.hasProperty("excludeGraphql") && springBoot2SupportsGraphql()
33+
2434
dependencies {
2535
implementation(platform(libs.springboot2.bom))
2636
implementation(libs.springboot.starter.actuator)
27-
implementation(libs.springboot.starter.graphql)
37+
if (includeGraphql) {
38+
implementation(libs.springboot.starter.graphql)
39+
}
2840
implementation(libs.springboot.starter.webflux)
2941
implementation(Config.Libs.kotlinReflect)
3042
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
3143
implementation(projects.sentrySpringBootStarter)
3244
implementation(projects.sentryLogback)
33-
implementation(projects.sentryGraphql)
45+
if (includeGraphql) {
46+
implementation(projects.sentryGraphql)
47+
}
3448
implementation(projects.sentryAsyncProfiler)
3549

3650
testImplementation(kotlin(Config.kotlinStdLib))
@@ -68,12 +82,20 @@ tasks.jar {
6882

6983
tasks.startScripts { dependsOn(tasks.shadowJar) }
7084

71-
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
85+
configure<SourceSetContainer> {
86+
main {
87+
if (!includeGraphql) {
88+
java.exclude("**/graphql/**")
89+
resources.exclude("graphql/**")
90+
}
91+
}
92+
test { java.srcDir("src/test/java") }
93+
}
7294

7395
tasks.withType<KotlinCompile>().configureEach {
7496
kotlin {
7597
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
76-
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
98+
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
7799
}
78100
}
79101

@@ -93,7 +115,12 @@ tasks.register<Test>("systemTest").configure {
93115
minHeapSize = "128m"
94116
maxHeapSize = "1g"
95117

96-
filter { includeTestsMatching("io.sentry.systemtest*") }
118+
filter {
119+
includeTestsMatching("io.sentry.systemtest*")
120+
if (!includeGraphql) {
121+
excludeTestsMatching("io.sentry.systemtest.Graphql*")
122+
}
123+
}
97124
}
98125

99126
tasks.named("test").configure {

0 commit comments

Comments
 (0)