quick-perf / quickperf

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
https://github.com/quick-perf/doc/wiki/QuickPerf
Apache License 2.0
465 stars 67 forks source link

Provide compatibility with Spring Boot 3 #196

Open klu2 opened 1 year ago

klu2 commented 1 year ago

Description The library currently does not work with Spring Boot 3. The problem is that already in Spring Boot 2.7 there was a change how to load AutoConfiguration, see https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#building-jars-with-maven-shade-plugin-and-gradle-shadow-plugin

Implementation ideas

What we need is a file called org.springframework.boot.autoconfigure.AutoConfiguration.imports inside src/main/resources/META-INF/spring with the following content:

org.quickperf.spring.boot.QuickPerfProxyBeanAutoConfiguration

I see 2 options:

  1. create a module quick-perf-springboot3-sql-starter

drawback: additional module, code duplication with springboot2

  1. modify the existing quick-perf-springboot2-sql starter and add the org.springframework.boot.autoconfigure.AutoConfiguration.imports file there

drawback: will require at least Spring Boot 2.7 but if you leave the old file as well (spring.factories), all versions (also Spring Boot 3.0) would work, so I'd prefer that option

jeanbisutti commented 1 year ago

Thank you @klu2 for having reported and analyzed this problem! I agree with your analysis. Would you be interested in creating a PR to fix the problem?

jeanbisutti commented 1 year ago

@klu2 I have deployed a snapshot version (1.1.1-SNAPSHOT) with the fix. You may want to check that the SQL annotations now work with Spring Boot 3.

klu2 commented 1 year ago

hi @jeanbisutti thanks - I have tested that already in another library that we are publishing (https://github.com/cloudflightio/cloudflight-platform-spring) where I temporarily add that file to our library which loads quickperf transitively (https://github.com/cloudflightio/cloudflight-platform-spring/blob/master/platform-spring-test-bom/platform-spring-test-jpa/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports) and that works perfectly fine with Spring Boot 3, we are running that already.

As soon as you've published a release, I will update the version in our library and remove that file again from our code-base.

maciejwalkowiak commented 1 year ago

@jeanbisutti when do you plan to release 1.1.1?

jeanbisutti commented 1 year ago

@maciejwalkowiak I will try my best to do a release in March. Waiting for the release you can apply this workaround for this issue.

maciejwalkowiak commented 1 year ago

Thanks @jeanbisutti! If there's anything I can help regarding migration to Spring Boot 3 let me know.

NaitYoussef commented 10 months ago

any updates on this @jeanbisutti ?

jeanbisutti commented 10 months ago

@NaitYoussef I have been pretty busy these last months... Thank you for the reminder. I will try to a a release soon. For this issue, you can apply this workaround.

jeanbisutti commented 10 months ago

Workaround: https://github.com/quick-perf/quickperf/issues/196#issuecomment-1384864117

maciejwalkowiak commented 5 months ago

@jeanbisutti I don't want to nag you periodically but it would be great to release 1.1.1. Is there anything I can do to help? I'd like to avoid forking this project but maybe it is a right thing to do?

jeanbisutti commented 5 months ago

Hey @maciejwalkowiak If you want to help, you can document #175. The documentation is done in the wiki: https://github.com/quick-perf/doc/wiki/QuickPerf Just fork the wiki and do the modifications on your copy. Thanks.