-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore(dependency): upgrade spring boot from 2.7.x to 3.0.x and spring cloud from 2021.0.x to 2022.0.x #7057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93b5063 to
761a75f
Compare
56ae55f to
84e94e6
Compare
e0e0727 to
c0cc3da
Compare
68906b6 to
1111ae6
Compare
7e6849d to
9292e65
Compare
451dab4 to
4282a7b
Compare
3593138 to
b642fac
Compare
303ea6d to
94d7d7c
Compare
…pends on version coming from springboot 3.0.
Remove commented code
Since springboot 3.0, ResponseEntity#getStatusCode returns HttpStatusCode instead of HttpStatus.
Seeing the issue due the commit: bcc4539 StackTrace: ``` ClouddriverServiceTest > testBaseUrlWithMultipleSlashes() FAILED org.opentest4j.AssertionFailedError: Unexpected exception thrown: com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException: Status: 404, Method: PUT, URL: http://localhost:42625/api/artifacts/fetch, Message: Not Found at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152) at app//org.junit.jupiter.api.AssertDoesNotThrow.createAssertionFailedError(AssertDoesNotThrow.java:84) at app//org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:75) at app//org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:58) at app//org.junit.jupiter.api.Assertions.assertDoesNotThrow(Assertions.java:3196) at app//com.netflix.spinnaker.rosco.services.ClouddriverServiceTest.testBaseUrlWithMultipleSlashes(ClouddriverServiceTest.java:93) ================================================== V2BakeryControllerWithClouddriverServiceTest > testRequestHeadersToClouddriver() FAILED java.lang.AssertionError: Status expected:<200> but was:<404> at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59) 38 tests completed, 1 failed at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122) at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:637) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:214) at com.netflix.spinnaker.rosco.controllers.V2BakeryControllerWithClouddriverServiceTest.testRequestHeadersToClouddriver(V2BakeryControllerWithClouddriverServiceTest.java:149) ```
Seeing the issue due the commit: bcc4539 StackTrace: ``` StandaloneContainerTest > testHelmOverridesPriority(HelmTemplateValues, boolean, TemplateRenderer, HelmTemplateValues, boolean, boolean) > com.netflix.spinnaker.rosco.StandaloneContainerTest.testHelmOverridesPriority(HelmTemplateValues, boolean, TemplateRenderer, HelmTemplateValues, boolean, boolean)[28] FAILED org.opentest4j.AssertionFailedError: expected: 200 but was: 404 at jdk.internal.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source) at [email protected]/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at app//com.netflix.spinnaker.rosco.StandaloneContainerTest.testHelmOverridesPriority(StandaloneContainerTest.java:716) ```
As part of springboot 3.0 upgrade, Spring Framework 6 changed how NestedRuntimeException (and subclasses like ResourceAccessException) format their messages, omitting the nested exception details in getMessage(). This change explicitly appends those details to provide better context in case of failures.
…pring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of orca:
```
spinnaker/orca/orca-web/src/test/java/com/netflix/spinnaker/orca/controllers/ProjectControllerTest.java:27: error: package rx does not exist
import rx.Observable;
> Task :orca:orca-web:compileTestJava FAILED
^
spinnaker/orca/orca-web/src/test/java/com/netflix/spinnaker/orca/controllers/ProjectControllerTest.java:96: error: cannot find symbol
.thenReturn(Observable.from(Collections.singletonList(execution1)));
^
symbol: variable Observable
location: class ProjectControllerTest
spinnaker/orca/orca-web/src/test/java/com/netflix/spinnaker/orca/controllers/ProjectControllerTest.java:98: error: cannot find symbol
.thenReturn(Observable.from(Collections.singletonList(execution2)));
^
symbol: variable Observable
location: class ProjectControllerTest
3 errors
```
Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the imports.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava
… for SnakeYAML 1.33.
Reintroduces a lightweight replacement for org.springframework.util.SocketUtils, which was deprecated in Spring Framework 5.3.x and removed in 6.0. This utility provides a way to find available TCP ports on localhost without depending on spring-test (TestSocketUtils). Used in places where dynamic port allocation is required (e.g., GoogleProviderUtils).
…eprecated as of spring framework 6.0, in favor of standard ServletException.
Error:
```
Expected exception of type 'org.springframework.web.util.NestedServletException', but got 'jakarta.servlet.ServletException'
Expected :class org.springframework.web.util.NestedServletException
Actual :jakarta.servlet.ServletException: Request processing failed: com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException: Status: 500, Method: GET, URL: http://localhost/, Message: arbitrary message
<Click to see difference>
Expected exception of type 'org.springframework.web.util.NestedServletException', but got 'jakarta.servlet.ServletException'
at org.spockframework.lang.SpecInternals.checkExceptionThrown(SpecInternals.java:84)
at org.spockframework.lang.SpecInternals.thrownImpl(SpecInternals.java:71)
at com.netflix.spinnaker.orca.controllers.TaskControllerSpec./applications/{application}/pipelines/search with a given pipeline name when front50 responds with 500(TaskControllerSpec.groovy:678)
Caused by: jakarta.servlet.ServletException: Request processing failed: com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException: Status: 500, Method: GET, URL: http://localhost/, Message: arbitrary message
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1022)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:527)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:72)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:165)
at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:132)
at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:201)
at com.netflix.spinnaker.orca.controllers.TaskControllerSpec./applications/{application}/pipelines/search with a given pipeline name when front50 responds with 500(TaskControllerSpec.groovy:671)
Caused by: com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException: Status: 500, Method: GET, URL: http://localhost/, Message: arbitrary message
at com.netflix.spinnaker.orca.controllers.TaskControllerSpec.makeSpinnakerHttpException(TaskControllerSpec.groovy:1266)
at com.netflix.spinnaker.orca.controllers.TaskControllerSpec./applications/{application}/pipelines/search with a given pipeline name when front50 responds with 500(TaskControllerSpec.groovy:668)
```
Reference:
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/util/NestedServletException.html
…and add a comment clarifying why it is required.
Replaced usage of `new Constructor()` with `new Constructor(Object.class)` since the no-arg constructor is deprecated in SnakeYAML 1.33. The class-based constructor remains supported and preserves the original behavior in tests.
05b85e8 to
e6f8019
Compare
dbyron-sf
reviewed
Nov 8, 2025
kork/kork-core/src/main/java/com/netflix/spinnaker/kork/yaml/YamlParserProperties.java
Outdated
Show resolved
Hide resolved
… per general notation.
dbyron-sf
approved these changes
Nov 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5. Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases
Kork Details:
Unpinning okhttp and rest-assured, as spring boot 3.0.13 brings okhttp 4.10.0 and rest-assured 5.2.1.
While upgrading the spring boot and spring cloud, encountered the below errors during build process of kork-jedis module:
The root cause of these errors is upgrade of redis.clients:jedis from 3.8.0 to 4.3.2 with spring boot upgrade from 2.x to 3.x. In order to fix these issues, migrated jedis from 3.x to 4.x by following the migration document And for further changelogs, please refer here
Removed the reflection logic to check the internalPool field from JedisPool object, as internalPool field has been removed from Jedis 4.3.2 and JedisPool is sub class of GenericObjectPool from Jedis redis/jedis#2521 onwards. So, refactoring the logic to check null value.
In Jedis 4.x, default constructor of Pipeline class has be removed in lieu of parameterised constructor to obtain Connection object either directly passing Connection or Jedis, as discussed redis/jedis#2693. So, updating the constructor by replacing the Pipeline with Jedis, and updated its usage in InstrumentedJedis.pipelined() method.
======================================================================================
refactor(dependency): replace javax with jakarta and HandlerInterceptorAdapter with HandlerInterceptor during upgrade of spring boot 3.0.x
Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with javax to jakarta.
Since org.springframework.web.servlet.handler.HandlerInterceptorAdapter has been deprecated in springframework 5.3.0. So, replacing it with org.springframework.web.servlet.HandlerInterceptor.
spring-projects/spring-framework#25147
terasolunaorg/terasoluna-gfw#991
==========================================================================================
refactor(exception): replace NestedIOException with IOException during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-crypto module:
The root cause is the removal of org.springframework.core.NestedIOException from springframework 6.0, as mentioned in the below links:
spring-projects/spring-framework#28198
spring-projects/spring-framework#28929
So, replacing org.springframework.core.NestedIOException with java.io.IOException.
========================================================================================
refactor(eureka): removed deprecated client and refactor constructor code during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-eureka module:
Spring cloud upgrade from 2021.0.x to 2022.0.x also upgrades the eureka client transitively from 1.10.17 to 2.0.1
Eureka client 2.0.x is not backward compatible with 1.0.x. The constructor has also introduced new parameter. So, update the code accordingly.
https://github.com/Netflix/eureka/releases/tag/v2.0.0
======================================================================================
refactor(telemetry): replace the deprecated method and constructor during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-telemetry module:
Spring boot upgrade brings the caffeine 3.1.8 transitively, that was 2.9.3 with spring boot 2.7.x.
In caffeine 3.x, StatsCounter.recordEviction method variation has been deprecated and CacheStats constructor. So, update the both of them.
https://github.com/ben-manes/caffeine/releases/tag/v3.0.0
https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/latest/com.github.benmanes.caffeine/com/github/benmanes/caffeine/cache/stats/StatsCounter.html
https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.9.3/com/github/benmanes/caffeine/cache/stats/StatsCounter.html
=====================================================================================
refactor(dependency): replace rxjava with rxjava3 during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-stackdriver module:
Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava
=================================================================================
refactor(spring-security): refactor spring security from 5.x to 6.x with spring boot upgrade to 3.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-actuator module:
With spring boot upgrade, spring security also upgrades from 5.x to 6.x. As per the migration steps, WebSecurityConfigurerAdapter has been removed. So, it is not required to be extended, instead bean can be registered.
In spring boot 3, changes are introduced in sanitization of actuator endpoints.
Default Sanitizer implementation has been removed and replaced with SanitizingFunction.
spring-projects/spring-boot#33448
spring-projects/spring-boot#39243
spring-projects/spring-boot#32156
So, added the ActuatorSanitizingFunction class to provide the default implementation of SanitizingFunction.
===================================================================================
refactor(dependency): replace javax.inject with jakarta.inject and upgrade wiremock as part of spring boot 3.x upgrade
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock 3.0.0 onwards 2 major breaking changes are introduced:
support for Java 17, dropping Java 8 support
Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
refactor(test): replace spring.profiles with spring.config.activate.on-profile as part of spring boot 3.x upgrade
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error:
In order to fix this issue, replacing spring.profiles with spring.config.activate.on-profile in application-test.yml
===================================================================================
refactor(test): refactor the method getType() to getTableType() as part of spring boot 3.x upgrade
The root cause is the change in method of org.jooq.Table class upgrading jooq transitively from 3.14.16 to 3.17.16 while spring boot 2.7.18 to 3.0.13 upgrade.
In order to fix this issue refactoring the getTableType() method.
===================================================================================
refactor(test): upgrade spockframework to fix issue during upgrade of spring security from 5.x to 6.x and ninja-squad upgrade with spring boot upgrade to 3.x
While upgrading spring security from 5.x to 6.x, encountered the below error:
The root cause of this issue is a incompatibility bug in spockframework 2.3-groovy-4.0 version.
In order to fix this issue upgraded the spockframe to 2.4-M1-groovy-4.0
spring-projects/spring-boot#33376
https://spockframework.org/spock/docs/2.4-M1/release_notes.html#_2_4_m1_2022_11_30
Also encountered below error during test execution of kork-plugins-tck module:
In order to fix this issue, upgraded the ninja-squad dependency from 2.0.3 to 4.0.2 for the compatibility with Spring boot 3.x and Java 17+.
https://github.com/Ninja-Squad/springmockk?tab=readme-ov-file#versions-compatibility
======================================================================================