GoogleCloudPlatform / GoogleCloudPlatform/spring-cloud-gcp
Spring Boot and Spring Cloud compatibility check on startup
- Dominant language
- Java
- Stars
- 551
- Forks
- 349
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Problem:**
I recently ran into a problem with Jackson while using spring-cloud-gcp within a Spring-Boot project together with Spring Cloud. This was related to a bad versioning on my side. With automated dependency updates I got to a state where I used Spring Boot 3.4.2 together with Spring Cloud 2024.0.0 and spring-cloud-gcp 5.10.0.
After having a look at the [spring-cloud-gcp compatibility matrix](https://github.com/GoogleCloudPlatform/spring-cloud-gcp?tab=readme-ov-file#compatibility-with-spring-project-versions) I noticed that it is not compatible.
Previous updates like Spring Boot from 3.3.x to 3.4.x or the major Spring Cloud update to 2024.0.0 seemed to work fine together with spring-cloud-gcp 5.9.0. The compatibility matrix on the other hand show that it should be incompatible and not be used together with Spring Cloud 5.x. This will be left unrecognized unless you double check every Spring Boot or Spring Cloud update with the compatibility matrix.
**Suggestion:**
From Spring Cloud I'm used to get an exception on startup which tells me that the Spring Boot release is incompatible with the selected Spring Cloud release if my dependency update system is too fast with its updates.
It uses a [SpringBootVersionVerifier](https://github.com/spring-cloud/spring-cloud-commons/blob/23d6202a71a8928b7ab202edbbe56388346e4c87/spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SpringBootVersionVerifier.java) to check if the current used Spring Cloud is compatible with the related Spring Boot version and prints something like this:
````
***************************
APPLICATION FAILED TO START
***************************
Description:
Your project setup is incompatible with our requirements due to following reasons:
- Spring Boot [3.3.0] is not compatible with this Spring Cloud release train
Action:
Consider applying the following actions:
- Change Spring Boot version to one of the following versions [3.2.x] .
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn].
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
If you want to disable this check, just set the property [spring.cloud.compatibility-verifier.enabled=false]
````
I'd suggest implementing a similar approach within spring-cloud-gcp as well, so that it will not accidentally happen that you're using an unsupported Spring Boot or Spring Cloud version and that simple integration tests will already fail on startup. This way I'd notice on early updates of Spring Boot or Spring Cloud that my versioning became incompatible.
Contributor guide
Research direction
Start by reading the linked SpringBootVersionVerifier and the project's startup and integration-test entry points. Define the supported Spring Boot and Spring Cloud combinations from the compatibility matrix, then verify that an incompatible setup fails during startup with an actionable message and that the suggested disable property is honored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java, spring, spring-boot
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100