Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

[FEATURE SPIKE] Preparing for supporting Spring Boot 3.0 #29230

Closed saragluna closed 2 years ago

saragluna commented 2 years ago

Is your feature request related to a problem? Please describe. Spring Boot 3.0 is going to release in Nov 2022, https://spring.io/blog/2022/05/24/preparing-for-spring-boot-3-0, we should prepare for it.

Describe the solution you'd like Spike the upgrade preparation on how to support Spring Boot 3.0 in azure-sdk-for-java repo, which will cover the below parts:

  1. Can Azure SDK support two Spring Boot major versions simultaneously?

  2. Where is the code to support Spring Boot 3.0 placed?

  3. How to process the different dependencies of Spring Boot 2.x and 3.x?

  4. Shall we distinguish the version or the artifact id when releasing?

Describe alternatives you've considered N/A

Additional context N/A

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

moarychan commented 2 years ago

Part 1: I use three Azure SDK(Azure Storage Queue, Azure Event Hubs, Azure Cosmos) libraries to integrate with the Spring boot 3 application, They represent the main implementations of several different protocols in the Azure SDK, only issues with Cosmos have been found so far.

moarychan commented 2 years ago

Update:

  1. Source code for Spring Boot 3.0 will be placed under a new service directory spring-3.
  2. Use a new version prefix tag spring3_ for all Spring Boot 3 dependencies in external_dependencies.txt.
  3. Use different major versions to distinguish the different supports for multi Spring Boot versions, such as 5.x for Spring Boot 3 support, 4.x for Spring Boot 2.x support.

Here's a test PR [Verify Spring Cloud Azure supports Spring Boot 3] to verify this feature spike, which is not perfect, but solves most major problems.

List of things that need improvement:

  1. The eng system should support a new way to identify the same artifact id in a different service directory.

    The following table mainly lists the modified file path and instructions.

    File path(Link to test PR) Changes
    eng/pipelines/templates/jobs/ci.yml Add a parameter BuildProfile, default value is default, a special value spring3 is used for enabling same artifact id in service directory spring-3. Add maven options -P${{parameters.BuildProfile}}; Add an argument ServiceDirectory for script eng/scripts/Verify-Required-Maven-Artifacts.ps1.
    eng/scripts/Verify-Required-Maven-Artifacts.ps1 Identify and override the version tags for dependencies under the service directory spring-3.
    eng/pipelines/templates/jobs/build-validate-pom.yml Add parameter ServiceDirectory to identify the duplicate coordinates.
    eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml Identify and override the global variable ProjectList for project list under the service directory spring-3, the project coordinate is combined with relatively path, not group id and artifact id.
    eng/scripts/Generate-ServiceDirectories-From-Project-List.ps1 The same with file eng/pipelines/templates/steps/generate-project-list-and-cache-maven-repository.yml.
    eng/pipelines/templates/jobs/live.tests.yml Add parameter BuildProfile.
    eng/versioning/pom_file_version_scanner.ps1 Read the renamed version tags from the files version_.txt* and modified the matching condition to meet validation for the spring-boot-3 artifact version tags.
    eng/versioning/version_client.txt eng/versioning/external_dependencies.txt Define the new tag prefix for Spring Boot 3 support.
    eng/pipelines/templates/jobs/build-validate-pom.yml eng/pipelines/templates/jobs/ci.tests.yml eng/pipelines/templates/stages/archetype-sdk-client.yml eng/pipelines/templates/stages/archetype-sdk-tests.yml eng/pipelines/templates/steps/build-and-test.yml Update parameter BuildProfile.
    pom.xml eng/jacoco-test-coverage/pom.xml Add a new profile spring3 to contain the new service directory spring-3 or the same artifact id with a different version.
  2. Dev IDE(Idea) does not allow managing the same artifact id in different modules, so we use different profiles to activate the spring or spring-3, it'll bring some extra effort.

  3. spring-cloud-azure-dependencies needs to be manually modified to support different version features.

moarychan commented 2 years ago

Close this, and will track the milestone support progress on the new issue https://github.com/Azure/azure-sdk-for-java/issues/30356