Skip to content
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

How to automatically keep in sync with spring boot version #301

Open
StefanLobbenmeierObjego opened this issue Dec 11, 2024 · 7 comments
Open

Comments

@StefanLobbenmeierObjego

Is your feature request related to a problem? Please describe.
It is a tedious to make sure that the selected cloud stream version and the spring boot version are kept in sync. This also shows in the amount of questions about compatability that are asked in this project.

Describe the solution you'd like
A) manage spring cloud stream version as part of the spring boot dependencies bom:
https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-dependencies/build.gradle

B) create a new spring overarching dependencies bom that includes the spring boot dependencies bom as well as spring cloud dependencies

C) align version numbers so they can be shares as a single variable

D) add a spring cloud bom that is more strict about dependency resolution so it fails on its own when conflicting versions are used

Describe alternatives you've considered
Turning off renovate upgrades for spring cloudstream and manually applying them to spring boot upgrade PRs

Additional context

@spencergibb
Copy link
Member

spencergibb commented Dec 11, 2024

Are you using the spring-cloud-dependencies bom?

'A' cannot happen since spring cloud depends on spring boot and we will not introduce circular dependencies

'B', while possible is doubtful. Spring Cloud separates itself from boot so users can upgrade patch versions independently.

'C' again, while possible is again doubtful. This is not required anywhere in the spring portfolio. This would require spring boot skipping a major version.

'D' I'm unsure what you mean by a stricter bom. Typically spring cloud supports two minor versions, not just patch versions.

We have runtime checking of boot version compatibility that should fail builds with, is that not working for you?

@spencergibb
Copy link
Member

I will talk to colleagues about it also

@StefanLobbenmeierObjego
Copy link
Author

We have runtime checking of boot version compatibility that should fail builds with, is that not working for you?

That would work - since we can just check if contextLoads and then we should be safe at PR time. But it does not seem to be working, we updated to 2024 release train while we are still on 3.3.6 and only noticed issues after the application was already running for some time.

Regarding D I was wondering if something like this could fail at dependency resolution:
https://github.com/spring-projects/spring-boot/blob/8308e9e976e554cc589d16547caf5ac395b9af0d/spring-boot-project/spring-boot-dependencies/build.gradle#L306

I will set up an example repo here to find the runtime check, maybe its only the way our build is set up that the check is not working or something.

@StefanLobbenmeierObjego
Copy link
Author

Prepared an example repo, I would expect either dependency resolution to fail or at least contextLoads to not succeed because of the runtime check:
https://github.com/StefanLobbenmeierObjego/spring-boot-and-spring-cloud-dependecy-management

Maybe the runtime check is just in some libraries of spring cloud?

@spencergibb
Copy link
Member

spencergibb commented Dec 12, 2024

So your example doesn't use any spring-cloud starters.

implementation("org.springframework.cloud:spring-cloud-starter")

If it did, you would get the following error

***************************
APPLICATION FAILED TO START
***************************

Description:

Your project setup is incompatible with our requirements due to following reasons:

- Spring Boot [3.3.6] 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.4.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]

There are two specific issues here, one is that there isn't a starter for spring-cloud-stream-binder-kafka-streams and the other is that the existing stream starters don't include spring-cloud-starter.

@olegz @sobychacko thoughts on this?

@StefanLobbenmeierObjego
Copy link
Author

I can confirm, adding that additional dependency to my project gives me the error:

Caused by: org.springframework.cloud.configuration.CompatibilityNotMetException: Spring Cloud/ Spring Boot version compatibility checks have failed: [[VerificationResult@690c0c33 description = 'Spring Boot [3.3.6] is not compatible with this Spring Cloud release train', action = 'Change Spring Boot version to one of the following versions [3.4.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]']]

So adding the additional dependency should be a good workaround until it is included by default, right?

@spencergibb
Copy link
Member

So adding the additional dependency should be a good workaround until it is included by default, right?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants