dgs-framework icon indicating copy to clipboard operation
dgs-framework copied to clipboard

WIP: Spring Boot 3

Open Stuckya opened this issue 2 years ago • 3 comments

Pull request checklist

  • [x] Please read our contributor guide
  • [x] Consider creating a discussion on the discussion forum first
  • [ ] Make sure the PR doesn't introduce backward compatibility issues
  • [x] Make sure to have sufficient test cases

Pull Request type

  • [ ] Bugfix
  • [ ] Feature
  • [x] Refactoring (no functional changes, no api changes)
  • [x] Build related changes
  • [ ] Other (please describe):

Changes in this PR

Describe the new behavior from this PR, and why it's needed Issue https://github.com/Netflix/dgs-framework/issues/948

Spring Boot 3 is targeted to release this November 2022. This PR prepares dgs-framework for Spring Boot 3. Many project maintainers are currently validating their projects against Sprint Boot 3 to prepare for the upcoming release. I have tested this branch extensively against my own Spring Boot 3 project.

Currently this PR is marked WIP because it uses Spring Milestone releases. The intention here was to get something working early to asses impact and facilitate a discussion around the changes required prior to the GA release of Spring Boot 3.

Version upgrades:

  • Spring Boot 3.0.0-M4
  • Spring Framework 6.0.0-M5
  • Spring Security 6.0.0-M6
  • Spring Cloud 2022.0.0-M4
  • Kotlin 1.7.10
  • JDK target 17
  • graphql-java 19.2

Version downgrades:

  • mockk 1.12.4

Alternatives considered

Describe alternative implementation you have considered

N/A

Stuckya avatar Sep 13 '22 14:09 Stuckya

Thanks for the doing the pre-work and investigating this. Just to provide some context, we have some constraints with switching the framework to Spring Boot 3 due to internal usage and that will affect how we make this available. We don't have concrete timelines yet, but will be planning for it. I will post updates on this thread as and when we have more information from our side.

srinivasankavitha avatar Sep 13 '22 16:09 srinivasankavitha

Is there a way to test the WIP version?

arjunyel avatar Oct 06 '22 16:10 arjunyel

You'll have to check out the branch locally, publish to your local maven repo using ./gradlew publishToMavenLocal and pin to the local snapshot build in order to test it out. Unfortunately, we don't have a great way to publish candidates off of branches, so this is the mechanism you would need to test it out locally.

srinivasankavitha avatar Oct 11 '22 16:10 srinivasankavitha

@srinivasankavitha & @berngp, thank you both for your continued support and eyes on this PR.

I wanted to provide a quick update on the Spring Boot 3 release timeline. The release candidate process has begun. Last week the Spring team began publishing release candidates for Spring Framework & Spring Security, which this PR is now using.

Spring announced today that they will be releasing the Spring Boot 3.0.0-RC1 later this evening. https://spring.io/blog/2022/10/20/spring-framework-6-0-0-rc2-available-now

I will update this PR with the latest release candidates as they become available.

It appears that the Spring team is on track for a GA release in mid-late November.

Cheers!

Stuckya avatar Oct 20 '22 20:10 Stuckya

Thanks for all the work on the PR so far!

srinivasankavitha avatar Oct 20 '22 23:10 srinivasankavitha

Another quick update! The release candidates seem to be stabilizing from the Spring team. I'm seeing less refactoring or feature addition in these latest updates. I've updated this branch again to use the latest release candidates.

We also now have a targeted release date, the Spring team announced:

Our final release is scheduled for November 24, 2022

Stuckya avatar Nov 12 '22 21:11 Stuckya

Looks amazing thank you for this. Are there any updates now that spring boot 3 has official gone GA?

Ancient-Dragon avatar Nov 25 '22 20:11 Ancient-Dragon

Looks amazing thank you for this. Are there any updates now that spring boot 3 has official gone GA?

From my perspective, this branch is almost out of WIP / draft. spring-cloud-dependencies still hasn't gone GA. Once spring-cloud-dependencies has been released by the Spring team, I'll remove the WIP placeholder.

@srinivasankavitha & @berngp, has your team found a path around your internal constraints? I also believe we will need to update the dgs-examples-* repositories so smoke tests don't fail from version mis-matches.

Cheers! 🚀

Stuckya avatar Nov 25 '22 23:11 Stuckya

@Stuckya - the current plan for internal consumption is to maintain both 2.x and 3.x branches for a temporary period of time when we are ready to start consuming 3.x. Likely to happen in the next couple months. Sent from my iPhoneOn Nov 25, 2022, at 3:19 PM, Andrew Stucky @.***> wrote:

Looks amazing thank you for this. Are there any updates now that spring boot 3 has official gone GA?

From my perspective, this branch is almost out of WIP / draft. spring-cloud-dependencies still hasn't gone GA. Once spring-cloud-dependencies has been released by the Spring team, I'll remove the WIP placeholder. @srinivasankavitha & @berngp, has your team found a path around your internal constraints? I also believe we will need to update the dgs-examples-* repositories so smoke tests don't fail from version mis-matches. Cheers! 🚀

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

srinivasankavitha avatar Nov 26 '22 22:11 srinivasankavitha

@DGSMutation and @DGSQuery field need to be annotated with @AliasFor due to:

https://github.com/spring-projects/spring-framework/issues/28760

esfomeado avatar Nov 28 '22 17:11 esfomeado

@Stuckya - the current plan for internal consumption is to maintain both 2.x and 3.x branches for a temporary period of time when we are ready to start consuming 3.x. Likely to happen in the next couple months.

Sounds great, thanks for the update @srinivasankavitha!

Should I continue to target master with this PR?

FWIW in my experience, master usually becomes the most recent release and another branch is maintained for backwards compatibility. Preserves trunk based development for the new work, but provides the flexibility of a short-lived release branch for these weird times when internal limitations complicate ideal workflows.

3.x support would == master, corresponding with a DGS 6.x release. 2.x support would == new temporary branch, maintaining the DGS 5.x release line.

Please let me know if I can help in anyway!

@DGSMutation and @DGSQuery field need to be annotated with @AliasFor due to:

spring-projects/spring-framework#28760

Thanks for bringing this back to my attention. I would be happy to address this update in my PR.

Stuckya avatar Nov 29 '22 22:11 Stuckya

Thanks so much for all the great work in this PR! 👏

I still need to do some more testing with all these changes, so will work on that over the next few days. Next steps for me:

  1. Test with more apps to validate the branch
  2. Create a new branch for 2.7 maintenance and do a test release
  3. Clone and update dgs-examples that are used for the pipeline to Spring Boot 3, Java 17 - this should get the CI build passing. We will need separate examples that use SB 2.7 and 3.x

Our current plan is to aim for early Jan for a target 3.x compatible DGS release once the above is ready. We'll backport only essential changes and fixes to 2.7 branch, but new feature development will be enabled on master going forward.

srinivasankavitha avatar Dec 16 '22 00:12 srinivasankavitha

Hello -

Thanks for all your work on this PR - We are moving to Spring Boot 3 across our projects and so anxiously awaiting this update. I'm trying to get a ahead and give this update a test. I built the branch out to my local maven repo and pulled it in successfully implementation(platform("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:5.6.0-SNAPSHOT"))

However when I start my app, I am not seeing the DGS framework initialize and no /graphql endpoint is available. Do you know if there are other updates to ensure Spring Boot is autowiring all the needed DGS components?

Also looks like Spring Cloud final is supposed to be released today: https://calendar.spring.io/

Thank you!

GrantGochnauer avatar Dec 16 '22 15:12 GrantGochnauer

@Stuckya - I am thinking of merging your PR to a spring-boot-3 branch to further test and add any fixes on top of. Once we are ready, I can merge that branch to main (likely beginning of Jan). This will allow for us to make further fixes, if needed based on our testing. Does that sound ok?

srinivasankavitha avatar Dec 20 '22 21:12 srinivasankavitha

I updated this branch today to make use of the spring-cloud-dependencies 2022 GA release, which means we are no longer relying on the milestone spring repository.

@Stuckya - I am thinking of merging your PR to a spring-boot-3 branch to further test and add any fixes on top of. Once we are ready, I can merge that branch to main (likely beginning of Jan). This will allow for us to make further fixes, if needed based on our testing. Does that sound ok?

@srinivasankavitha - Of course, that sounds like it will make things easier for you all to continue making updates util early Jan. Please let me know if I can help in any way.

Stuckya avatar Dec 21 '22 00:12 Stuckya

Great, I'll create a new branch and merge your PR there and continue with my testing. It's looking really good so far! Thanks for the change you just made to update the spring-cloud-dependencies to GA. I am updating the example projects so we can get the build passing here and will take it from there.

Thanks again for the contributions!

srinivasankavitha avatar Dec 21 '22 00:12 srinivasankavitha

Hello -

Thanks for all your work on this PR - We are moving to Spring Boot 3 across our projects and so anxiously awaiting this update. I'm trying to get a ahead and give this update a test. I built the branch out to my local maven repo and pulled it in successfully implementation(platform("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:5.6.0-SNAPSHOT"))

However when I start my app, I am not seeing the DGS framework initialize and no /graphql endpoint is available. Do you know if there are other updates to ensure Spring Boot is autowiring all the needed DGS components?

Also looks like Spring Cloud final is supposed to be released today: https://calendar.spring.io/

Thank you!

@GrantGochnauer Have you checked to make sure you are on the same branch as this PR? My guess is you don't have the changes to make it work with spring boot 3. I am able to use a local snapshot built from this branch in my test projects successfully.

srinivasankavitha avatar Dec 21 '22 00:12 srinivasankavitha

@Stuckya - could you please make the following changes as well as part of the PR. I updated example projects to Spring Boot 3 and this branch needs to use the updated examples for the build to pass. I cannot merge to a branch until then anyway.

  1. Please update this file to use dgs-examples-kotlin and dgs-examples-java repositories: https://github.com/Netflix/dgs-framework/blob/master/scripts/config.yml#L21
  2. Same in this file: https://github.com/Netflix/dgs-framework/blob/master/.github/workflows/ci.yml#L62

srinivasankavitha avatar Dec 21 '22 17:12 srinivasankavitha

@Stuckya - could you please make the following changes as well as part of the PR. I updated example projects to Spring Boot 3 and this branch needs to use the updated examples for the build to pass. I cannot merge to a branch until then anyway.

  1. Please update this file to use dgs-examples-kotlin and dgs-examples-java repositories: https://github.com/Netflix/dgs-framework/blob/master/scripts/config.yml#L21
  2. Same in this file: https://github.com/Netflix/dgs-framework/blob/master/.github/workflows/ci.yml#L62

You got it, update coming shortly.

Stuckya avatar Dec 21 '22 17:12 Stuckya

@srinivasankavitha, should be good to go!

Stuckya avatar Dec 21 '22 17:12 Stuckya

Thanks @Stuckya - build seems to have passed ci checks as well with your latest commit. 🥳 I'll merge it to a spring-boot-3-candidate branch and continue testing it. As mentioned earlier, I'll merge the branch to master once we are ready and have created a separate branch for 2.7. So early Jan, 2023.

srinivasankavitha avatar Dec 21 '22 18:12 srinivasankavitha