ci: Fix Spring Boot matrix version updates#5372
Conversation
📲 Install BuildsAndroid
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 91bb874 | 311.00 ms | 363.47 ms | 52.47 ms |
| 62b579c | 349.26 ms | 426.26 ms | 77.00 ms |
| b77456b | 393.26 ms | 441.10 ms | 47.84 ms |
| b1045ed | 361.35 ms | 429.17 ms | 67.81 ms |
| 5865051 | 319.74 ms | 365.60 ms | 45.86 ms |
| 0eaac1e | 322.53 ms | 389.31 ms | 66.78 ms |
| 5865051 | 324.24 ms | 356.02 ms | 31.78 ms |
| 648fbf7 | 316.54 ms | 372.39 ms | 55.85 ms |
| eb95ded | 317.51 ms | 369.08 ms | 51.57 ms |
| bb0ff41 | 344.70 ms | 413.82 ms | 69.12 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 91bb874 | 1.58 MiB | 2.13 MiB | 559.07 KiB |
| 62b579c | 0 B | 0 B | 0 B |
| b77456b | 1.58 MiB | 2.12 MiB | 548.11 KiB |
| b1045ed | 0 B | 0 B | 0 B |
| 5865051 | 0 B | 0 B | 0 B |
| 0eaac1e | 1.58 MiB | 2.19 MiB | 619.17 KiB |
| 5865051 | 0 B | 0 B | 0 B |
| 648fbf7 | 0 B | 0 B | 0 B |
| eb95ded | 0 B | 0 B | 0 B |
| bb0ff41 | 0 B | 0 B | 0 B |
Previous results on branch: ci/fix-spring-boot-matrix-version-sed
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 741c273 | 287.21 ms | 372.79 ms | 85.58 ms |
| 7092449 | 316.43 ms | 352.15 ms | 35.72 ms |
| 505b017 | 322.64 ms | 374.07 ms | 51.43 ms |
| 4c74ba4 | 308.60 ms | 360.84 ms | 52.23 ms |
| e235cc1 | 397.46 ms | 477.04 ms | 79.58 ms |
| da499be | 312.21 ms | 351.30 ms | 39.09 ms |
| e8826d8 | 331.94 ms | 394.48 ms | 62.54 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 741c273 | 0 B | 0 B | 0 B |
| 7092449 | 0 B | 0 B | 0 B |
| 505b017 | 0 B | 0 B | 0 B |
| 4c74ba4 | 0 B | 0 B | 0 B |
| e235cc1 | 0 B | 0 B | 0 B |
| da499be | 0 B | 0 B | 0 B |
| e8826d8 | 0 B | 0 B | 0 B |
Match the TOML version catalog format when overriding Spring Boot versions in matrix jobs. Preserve whitespace around the assignment and replace the quoted version value so the CI jobs actually test the requested matrix version. Co-Authored-By: Claude <noreply@anthropic.com>
The matrix jobs now actually update the version catalog. Remove Spring Boot versions that the current sample setup cannot build with the repository's Spring GraphQL integrations and Gradle version. Co-Authored-By: Claude <noreply@anthropic.com>
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>
Remove the explicit elastic scheduler from the Spring Boot WebFlux sample. Mono.delay already schedules the delayed work, and using Schedulers.elastic triggers deprecation warnings that fail CI under -Werror. Co-Authored-By: Claude <noreply@anthropic.com>
Spring Kafka sample support depends on newer Spring Boot 2 dependency management. Exclude Kafka sources, profile startup, and system tests when the matrix runs Boot 2 versions before 2.7. Keep the system test classpath aligned with the SDK test helpers by importing the OkHttp and Jackson BOMs after the tested Spring Boot BOMs. Co-Authored-By: Claude <noreply@anthropic.com>
1b25f8f to
87b8bc3
Compare
Spring Boot 2.1 and 2.2 use Reactor versions without Mono.doFirst or Schedulers.onScheduleHook. Avoid those calls in the Boot 2 WebFlux integration so old matrix jobs can start and serve requests. Co-Authored-By: Claude <noreply@anthropic.com>
Spring Boot 2.1 and 2.2 cannot parse newer OpenTelemetry auto-configuration classes during startup. Keep the matrix coverage for supported samples and skip the no-agent OTel sample for those versions. Co-Authored-By: Claude <noreply@anthropic.com>
Remove Spring Boot 2.1 and 2.2 from the matrix instead of carrying WebFlux compatibility changes for their older Reactor and Spring APIs. Restore the WebFlux filter implementation now that those versions are no longer tested. Co-Authored-By: Claude <noreply@anthropic.com>
Revert the compatibility guard for Reactor versions that are no longer covered by the Spring Boot matrix. Co-Authored-By: Claude <noreply@anthropic.com>
Use the erased Consumer signature in the batch loader registry wrapper so the code compiles with both Spring GraphQL 1.2/1.3 and 1.4. Let the Spring Boot 3 Gradle plugin follow the tested matrix version instead of pinning it separately. Co-Authored-By: Claude <noreply@anthropic.com>
| configure<SourceSetContainer> { test { java.srcDir("src/test/java") } } | ||
| configure<SourceSetContainer> { | ||
| main { | ||
| if (!includeGraphql) { |
There was a problem hiding this comment.
For the best gradle caching it would be best to make these 3 separate source sets.
This way they can each get their own cache entry and be compiled separately.
This depends however on what their dependencies look like but I imagine that if they are easily excluded like this that the sources are independent.
EDIT: after scrolling further down and seeing that they also have different imports maybe I need to understand better why we need this. could you explain it?
There was a problem hiding this comment.
Since older versions of Spring Boot 2 don't have GraphQL support, we're excluding it from the sample in the matrix build.
| resources.exclude("application-kafka.properties") | ||
| } | ||
| } | ||
| test { java.srcDir("src/test/java") } |
There was a problem hiding this comment.
nit: if this is the implicit default, why do we need this?
Does spring boot or something else change it?
There was a problem hiding this comment.
Probably redundant, can try to remove
| maxHeapSize = "1g" | ||
|
|
||
| filter { includeTestsMatching("io.sentry.systemtest*") } | ||
| filter { |
There was a problem hiding this comment.
Same as above, if we use 3 separate test source sets/tasks we can compile and execute/cache them independently.
|
|
||
| tasks.withType<KotlinCompile>().configureEach { | ||
| compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 | ||
| compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 |
There was a problem hiding this comment.
nit: should we import this?
| GraphQLError.class | ||
| }) | ||
| @ConditionalOnClass( | ||
| name = { |
There was a problem hiding this comment.
Should we add a comment on why we changed these to strings? It breaks type safety.
There was a problem hiding this comment.
AFAIR If classes don't exist during build, it fails. Which is the case for older Spring Boot 2 versions.
| resources.exclude("application-kafka.properties") | ||
| } | ||
| } | ||
| test { java.srcDir("src/test/java") } |
There was a problem hiding this comment.
nit: is this the default?
| echo "ORG_GRADLE_PROJECT_excludeGraphql=true" >> "$GITHUB_ENV" | ||
| echo "ORG_GRADLE_PROJECT_excludeKafka=true" >> "$GITHUB_ENV" | ||
| fi | ||
| sed -i 's/^\(springboot2[[:space:]]*=[[:space:]]*\)".*"/\1"'"$springboot_version"'"/' gradle/libs.versions.toml |
There was a problem hiding this comment.
Since this PR is about fixing the fact that this sed wasn't replacing versions correctly, how do we prevent changes or refactoring of libs.versions.toml file from breaking this? Can we make this fail if no replacement is found?
📜 Description
Fix the Spring Boot 2.x, 3.x, and 4.x matrix workflows so their version override matches the TOML version catalog format.
The workflows now preserve whitespace around the assignment and replace the quoted Spring Boot version value in
gradle/libs.versions.toml.💡 Motivation and Context
The existing
sedexpressions looked for keys without spaces around=, but the version catalog uses entries likespringboot2 = "2.7.18". As a result, matrix jobs did not actually update the Spring Boot version under test.💚 How did you test it?
sedexpressions against a temporary copy ofgradle/libs.versions.tomland verified Spring Boot 2, 3, and 4 versions were updated../gradlew spotlessApply apiDump.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog