java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

Bump supported Spring Boot baseline to version 3.2.x

Open ThomasVitale opened this issue 1 year ago • 19 comments

Description

Spring Boot < 3.2.x reached end of life and it's not maintained anymore. This PR bumps the minimum supported version to 3.2.x, supporting both the 3.2.x and 3.3.x release trains.

  • Bump dependencies in sdk-springboot module from Spring Boot 2.x to 3.2.6
  • Update examples module to use new Spring Boot support with Java 17 baseline
  • Fix wrong sdkman and maven wrapper setup that failed the local setup
  • Update GHA workflow to stop testing for Spring Boot versions < 3.2.x

Issue reference

Fixes gh-1039

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • [x] Code compiles correctly
  • [x] Created/updated tests
  • [x] Extended the documentation

ThomasVitale avatar Jun 13 '24 15:06 ThomasVitale

@artursouza I just checked this PR.. and this is what we need to do to upgrade to spring 3.2.x .. We will start refactoring the spring boot support, trying not to break existing users.

salaboy avatar Jun 15 '24 09:06 salaboy

@artursouza can you please review?

salaboy avatar Jun 15 '24 09:06 salaboy

Looks like CI is failing the license/synk check, but I can't view it. I'm fine with proceeding with this change given if there are vulnerabilities in Spring Boot < 3.2.x it won't be fixed and users have had some time to upgrade by now.

cicoyle avatar Jun 19 '24 14:06 cicoyle

@cicoyle thanks for the review. I can't see the Snyk report either. @salaboy do you have access? I'm not sure which dependency is triggering the failure.

ThomasVitale avatar Jun 19 '24 15:06 ThomasVitale

@cicoyle when you have time can you please validate this one? now that the HTTP client is removed .. we need to upgrade the spring boot version.

salaboy avatar Jun 23 '24 07:06 salaboy

@cicoyle thanks for the review. I can't see the Snyk report either. @salaboy do you have access? I'm not sure which dependency is triggering the failure.

Let me ask for permission

salaboy avatar Jun 26 '24 08:06 salaboy

Screenshot 2024-06-26 at 15 35 52

salaboy avatar Jun 26 '24 14:06 salaboy

@ThomasVitale I am working out on the licence stuff.. but it seems that dapr-sdk-tests is still trying to get Could not find artifact io.dapr:dapr-sdk-springboot3:jar:1.12.0-SNAPSHOT which might be because you forgot to update that dependency. Here: https://github.com/dapr/java-sdk/blob/master/sdk-tests/pom.xml#L132

salaboy avatar Jun 26 '24 14:06 salaboy

@ThomasVitale I am working out on the licence stuff.. but it seems that dapr-sdk-tests is still trying to get Could not find artifact io.dapr:dapr-sdk-springboot3:jar:1.12.0-SNAPSHOT which might be because you forgot to update that dependency. Here: https://github.com/dapr/java-sdk/blob/master/sdk-tests/pom.xml#L132

I fixed it in FOSSA. Ignore Snyk's report on license, I disabled that going forward. Snyk is used for vulnerability reports only.

artursouza avatar Jun 26 '24 15:06 artursouza

@salaboy thanks, I had missed that sdk-tests was excluded from the multi-module Maven project, so the tests didn't actually run as part of the local workflow. I tried to set them up locally based on the pipeline content, but I didn't manage to do it fully, I'm afraid. I pushed a change to update the dependencies in dk-tests, and remove sdk-springboot3. Can you re-run the PR pipeline?

ThomasVitale avatar Jun 26 '24 18:06 ThomasVitale

@salaboy thanks, I had missed that sdk-tests was excluded from the multi-module Maven project, so the tests didn't actually run as part of the local workflow. I tried to set them up locally based on the pipeline content, but I didn't manage to do it fully, I'm afraid. I pushed a change to update the dependencies in dk-tests, and remove sdk-springboot3. Can you re-run the PR pipeline?

This is a breaking change but it might make sense for the Java community to simply move away from Springboot 2.

artursouza avatar Jun 26 '24 18:06 artursouza

Yes we made the decision to move forward to spring 3.2.x .. let’s unblock this if the PR is green

  • Blog: http://salaboy.com http://salaboy.wordpress.com

  • Github user: http://github.com/salaboy

  • Twitter: http://twitter.com/salaboy

  • Mauricio "Salaboy" Salatino -

On Wed, 26 Jun 2024 at 19:12, Artur Souza @.***> wrote:

@salaboy https://github.com/salaboy thanks, I had missed that sdk-tests was excluded from the multi-module Maven project, so the tests didn't actually run as part of the local workflow. I tried to set them up locally based on the pipeline content, but I didn't manage to do it fully, I'm afraid. I pushed a change to update the dependencies in dk-tests, and remove sdk-springboot3. Can you re-run the PR pipeline?

This is a breaking change but it might make sense for the Java community to simply move away from Springboot 2.

— Reply to this email directly, view it on GitHub https://github.com/dapr/java-sdk/pull/1050#issuecomment-2192351213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACCMXV6EOICF7PRK6KXLZTZJMABBAVCNFSM6AAAAABJIVLXTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGM2TCMRRGM . You are receiving this because you were mentioned.Message ID: @.***>

salaboy avatar Jun 26 '24 20:06 salaboy

@salaboy and @ThomasVitale I have spent some time looking at the build failures. According to this document: https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention things have changed in Spring Framework 6.x when it comes to parameter name resolution. We have to either use Java Compiler with -parameters flag or ensure that @PathVariable and @RequestPathParam are explicitly named. Here is the IT related file that has to be adjusted: https://github.com/dapr/java-sdk/blob/342f8045830cc96d308df2670a06b8d65f8cf19b/sdk-tests/src/test/java/io/dapr/it/methodinvoke/http/MethodInvokeController.java#L21.

I have run an experiment using explicit naming that can be found here: https://github.com/artur-ciocanu/java-sdk/actions/runs/9696067245/job/26757186160. The GitHub Action succeeded, so we can at least try to fix these issues in the near term.

I am still looking into other build failures. I'll keep you posted.

CC: @artursouza @cicoyle

artur-ciocanu avatar Jun 27 '24 12:06 artur-ciocanu

@salaboy and @ThomasVitale I have spent a few hours figuring out why the tests are failing. Here are my findings:

  • "parameter name resolution" - the are changes in SB 2.x and SB 3.x it is due to Spring Framework 6.x changes. The fixes are trivial I have suggested them in the previous comment.
  • OpenTelemetry version mismatch - it seems that as part of SB 3.x upgrade we get a new version of Zipkin reporter and this conflicts with OTEL version that is currently used in sdk-tests. Here is the error that I managed to reproduce:
Error:  Errors: 
Error:    TracingIT.testInvoke:60 » NoSuchMethod 'zipkin2.Call zipkin2.reporter.Sender.sendSpans(java.util.List)'
Error:    TracingIT.testInvoke:58 » NoSuchMethod 'zipkin2.Call zipkin2.reporter.Sender.sendSpans(java.util.List)'

My suggestion for the second issue would be to upgrade OTEL to latest library, but this requires some significant changes in sdk-tests since currently it uses 0.14.0 while the latest is 1.39.0.

@artursouza and @cicoyle what are your thoughts.

artur-ciocanu avatar Jun 27 '24 14:06 artur-ciocanu

@artur-ciocanu I wonder if we can rely on the OTEL stuff that comes with Spring Boot 3.x instead of adding our own dependency

salaboy avatar Jun 27 '24 14:06 salaboy

@artur-ciocanu I wonder if we can rely on the OTEL stuff that comes with Spring Boot 3.x instead of adding our own dependency

@salaboy I was thinking about it ... I guess for Spring Boot based IT tests we can, but I would have to defer to @artursouza and others, since I don't know why we had to use OTEL in its "raw" form. I am assuming because of GRPC tests, but I am not sure.

In any case if we upgrade OTEL the IT tests have to be adjusted.

artur-ciocanu avatar Jun 27 '24 14:06 artur-ciocanu

@cicoyle @artursouza or @ThomasVitale could you please try to merge the "master" and see if we still have any issues with Spring Boot upgrade.

artur-ciocanu avatar Jul 04 '24 05:07 artur-ciocanu

@artur-ciocanu thanks, I'll try that later today

ThomasVitale avatar Jul 04 '24 06:07 ThomasVitale

@artur-ciocanu I have rebased this PR on the current "master" and pushed the changes

ThomasVitale avatar Jul 04 '24 15:07 ThomasVitale

@artursouza and @cicoyle it seems that we need maintainers approval. The build workflows are blocked right now.

Whenever you have a chance, could you please help? Thank you.

artur-ciocanu avatar Jul 05 '24 13:07 artur-ciocanu

@ThomasVitale we are almost there 😀. It seems that there is still one IT test that is failing. It is related to SDK resiliency. I will take a look on Monday and see if I can reproduce it and come up with a fix.

artur-ciocanu avatar Jul 06 '24 06:07 artur-ciocanu

Thanks so much for the help @artur-ciocanu 💪💪

salaboy avatar Jul 06 '24 08:07 salaboy

@ThomasVitale and @salaboy I have opened #1070 to try to fix the SDK resiliency IT failure. Let's wait until it is merged and see if it will fix the issue.

artur-ciocanu avatar Jul 08 '24 13:07 artur-ciocanu

@ThomasVitale the SDK resiliency IT fix PR has been merged. Could you please merge "master" and see if things are looking good.

artur-ciocanu avatar Jul 10 '24 04:07 artur-ciocanu

@artur-ciocanu thanks! I've just rebased the PR

ThomasVitale avatar Jul 10 '24 05:07 ThomasVitale

@artursouza or @cicoyle it seems that we need maintainers approval to kick off the GitHub workflows. Could you please approve and if everything looks merge the PR.

Thank you! 🙇‍♀️

artur-ciocanu avatar Jul 10 '24 05:07 artur-ciocanu

Need to check why the build is failing

yaron2 avatar Jul 11 '24 16:07 yaron2

Build is still failing. I have no problem merging this once validation passes.

artursouza avatar Jul 11 '24 16:07 artursouza

Let me check tomorrow one more time to see what might be the issue. Thanks for checking @artursouza 🙇

artur-ciocanu avatar Jul 11 '24 17:07 artur-ciocanu

Thanks! I would like to help debug the integration tests, but I didn't manage to run them locally. I have suggested an improvement for the docs on how to establish a local setup for running the sdk-tests project. https://github.com/dapr/java-sdk/issues/1075

ThomasVitale avatar Jul 11 '24 17:07 ThomasVitale