Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(dependency): upgrade spring boot from 2.7.x to 3.0.x and spring cloud from 2021.0.x to 2022.0.x #6348

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Feb 17, 2025

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

WebMvcConfigurerAdapter class has been deprecated in Springframework 5.0 and subsequently removed from Springframework 6.0. So, replacing it with WebMvcConfigurer interface for direct implementation.
https://docs.spring.io/spring-framework/docs/5.0.0.RELEASE/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.html

===============================================================================================

refactor(dependency): replace javax with jakarta and javax.inject with jakarta.inject 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.

javax.inject that has been moved from present coordinate to jakarta.inject. So, updating the coordinates in igor-web module.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

===============================================================================================

refactor(jedis): migrate jedis from 3.x to 4.x during upgrade of spring boot 3.0.x

Spring boot upgrade from 2.7.18 to 3.0.13, upgrades redis.clients:jedis from 3.8.0 to 4.3.2.
So, migrating jedis from 3.x to 4.x by following the migration document
And for further changelogs, please refer here

===============================================================================================

refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x

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

And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs.
https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0
https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0

===============================================================================================

refactor(dependency): add explicit resilience4j-vavr dependency with spring boot upgrade to 3.x

io.vavr dependency has been removed from resilience4j:2.0.2.
https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0
Resilience4j comes as transitive dependency of spring-cloud-dependencies.
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5
So, adding explicit dependency of resilience4j-vavr
As part of removing vavr dependency, resilience4j has made change that returns a Set instead of Seq when retryRegistry.getAllRetries() is called.
Link:
https://github.com/resilience4j/resilience4j/pull/1121/files#diff-f58a549005afee4cef1bdce1c1a5571f40fcede02013722f6bd05d221bde56eeR153
resilience4j/resilience4j#1537

===============================================================================================

refactor(dependency): upgrade wiremock as part of spring boot 3.x and spring cloud 2022.0.x upgrade

Upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock 3.0.0 onwards 2 major breaking changes are introduced:

  1. support for Java 17, dropping Java 8 support
  2. Change the Maven repository groupID to org.wiremock
    https://github.com/wiremock/wiremock/releases?page=3
  3. Change Artifact IDs of wiremock-jre8 and wiremock-jre8-standalone to wiremock and wiremock-standalone

===============================================================================================

refactor(dependency): pin elasticsearch as part of spring boot upgrade to 3.x

With Spring boot 3.0, Elasticsearch’s high-level REST client has been removed.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates

Error:

Execution failed for task ':clouddriver-elasticsearch:compileGroovy'.
> Could not resolve all files for configuration ':clouddriver-elasticsearch:compileClasspath'.
   > Could not find org.elasticsearch:elasticsearch:.
     Required by:
         project :clouddriver-elasticsearch

So, pining the elasticsearch dependency as 8.5.3 in accordance to the client used by Spring boot 3.0.13.

===============================================================================================

refactor(dependency): upgrade grpcVersion to 1.63.0 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 error:

clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/UserIPServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/ValidatorIPServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/HealthGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/LoadBalancerServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/ClusterMembershipServiceGrpc.java:11: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/TaskRelocationServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/ResourceAllocationArchiveServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/TaskManagementServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/TaskManagementArchiveServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/ResourceConsumptionServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/MachineServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/ResourceAllocationServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/AgentManagementServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/JobManagementServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/SupervisorServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/AutoScalingServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/SchedulerServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/EvictionServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation

The root cause of the issue is use of javax annotations in generated classes. So, upgrading the grpc-java to 1.63.0.
grpc/grpc-java#10927
https://github.com/grpc/grpc-java/releases/tag/v1.63.0

===============================================================================================

refactor(classname): update name of the class ElasticSearchRestHealthContributorAutoConfiguration to ElasticsearchRestHealthContributorAutoConfiguration 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 error:

 clouddriver/clouddriver-web/src/main/groovy/com/netflix/spinnaker/clouddriver/Main.groovy: 27: unable to resolve class org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration
  @ line 27, column 1.
    import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration
    ^

The root cause is the rename of class ElasticSearchRestHealthContributorAutoConfiguration to ElasticsearchRestHealthContributorAutoConfiguration in spring boot 3.0.
https://stackoverflow.com/questions/76774786/when-updating-to-springboot3-1-1-i-can-not-import-elasticsearchresthealthcon
spring-projects/spring-boot@27a936e#diff-02d5da5a17d8684660a73d36f62bfd086a9acda3174d510eae97d032a825e8ef

j-sandy and others added 3 commits February 17, 2025 16:54
… cloud from 2021.0.x to 2022.0.x

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

`WebMvcConfigurerAdapter` class has been deprecated in Springframework 5.0 and subsequently removed from Springframework 6.0. So, replacing it with `WebMvcConfigurer` interface for direct implementation.
https://docs.spring.io/spring-framework/docs/5.0.0.RELEASE/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurerAdapter.html

===============================================================================================

refactor(dependency): replace javax with jakarta and javax.inject with jakarta.inject 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`.

`javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in igor-web module.
google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject

===============================================================================================

refactor(jedis): migrate jedis from 3.x to 4.x during upgrade of spring boot 3.0.x

Spring boot upgrade from 2.7.18 to 3.0.13, upgrades `redis.clients:jedis` from 3.8.0 to 4.3.2.
So, migrating jedis from 3.x to 4.x by following the migration [document](https://github.com/redis/jedis/blob/master/docs/3to4.md)
And for further changelogs, please refer [here](https://github.com/redis/jedis/releases/tag/v4.0.0)

===============================================================================================

refactor(dependency): migrate rxjava to rxjava3 during upgrade of spring boot 3.0.x

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

And refactored the code to accomodate changes required by rxjava2 and rxjava3 following the changelogs.
https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0
https://github.com/ReactiveX/RxJava/wiki/What%27s-different-in-3.0

===============================================================================================

refactor(dependency): add explicit resilience4j-vavr dependency with spring boot upgrade to 3.x

`io.vavr` dependency has been removed from resilience4j:2.0.2.
https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0
Resilience4j comes as transitive dependency of spring-cloud-dependencies.
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5
So, adding explicit dependency of `resilience4j-vavr`
As part of removing vavr dependency, resilience4j has made change that returns a Set instead of Seq when retryRegistry.getAllRetries() is called.
Link:
https://github.com/resilience4j/resilience4j/pull/1121/files#diff-f58a549005afee4cef1bdce1c1a5571f40fcede02013722f6bd05d221bde56eeR153
resilience4j/resilience4j#1537
… spring cloud 2022.0.x upgrade

Upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced:
1. support for Java 17, dropping Java 8 support
2. Change the Maven repository groupID to org.wiremock
https://github.com/wiremock/wiremock/releases?page=3
3. Change Artifact IDs of wiremock-jre8 and wiremock-jre8-standalone to wiremock and wiremock-standalone

===============================================================================================

refactor(dependency): pin elasticsearch as part of spring boot upgrade to 3.x

With Spring boot 3.0, Elasticsearch’s high-level REST client has been removed.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#elasticsearch-clients-and-templates

Error:
```
Execution failed for task ':clouddriver-elasticsearch:compileGroovy'.
> Could not resolve all files for configuration ':clouddriver-elasticsearch:compileClasspath'.
   > Could not find org.elasticsearch:elasticsearch:.
     Required by:
         project :clouddriver-elasticsearch
```
So, pining the elasticsearch dependency as 8.5.3 in accordance to the client used by Spring boot 3.0.13.

===============================================================================================

refactor(dependency): upgrade grpcVersion to 1.63.0 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 error:
```
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/UserIPServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/ValidatorIPServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/HealthGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/LoadBalancerServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/ClusterMembershipServiceGrpc.java:11: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/TaskRelocationServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/ResourceAllocationArchiveServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/TaskManagementServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/TaskManagementArchiveServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/ResourceConsumptionServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/MachineServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/v4/ResourceAllocationServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/AgentManagementServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/JobManagementServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/SupervisorServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/AutoScalingServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/SchedulerServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
clouddriver/clouddriver-titus/build/generated/source/proto/main/grpc/com/netflix/titus/grpc/protogen/EvictionServiceGrpc.java:7: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
```
The root cause of the issue is use of javax annotations in generated classes. So, upgrading the grpc-java to 1.63.0.
grpc/grpc-java#10927
https://github.com/grpc/grpc-java/releases/tag/v1.63.0

===============================================================================================

refactor(classname): update name of the class ElasticSearchRestHealthContributorAutoConfiguration to ElasticsearchRestHealthContributorAutoConfiguration 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 error:
```
 clouddriver/clouddriver-web/src/main/groovy/com/netflix/spinnaker/clouddriver/Main.groovy: 27: unable to resolve class org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration
  @ line 27, column 1.
    import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration
    ^
```
The root cause is the rename of class `ElasticSearchRestHealthContributorAutoConfiguration` to `ElasticsearchRestHealthContributorAutoConfiguration` in spring boot 3.0.
https://stackoverflow.com/questions/76774786/when-updating-to-springboot3-1-1-i-can-not-import-elasticsearchresthealthcon
spring-projects/spring-boot@27a936e#diff-02d5da5a17d8684660a73d36f62bfd086a9acda3174d510eae97d032a825e8ef
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant