From cea07c75f8b3829480b6a484bde7862fd76de993 Mon Sep 17 00:00:00 2001 From: Sergio Date: Fri, 3 Feb 2023 19:48:08 +0100 Subject: [PATCH 1/2] Bump from spring boot 2.3.5.RELEASE to 2.7.8 Signed-off-by: Sergio (cherry picked from commit 9152c91bc1f08ecf2dd3bccf8159fd5d0500e351) --- examples/pom.xml | 4 ++-- pom.xml | 2 +- sdk-actors/pom.xml | 2 +- sdk-springboot/pom.xml | 4 +--- sdk-springboot/src/main/resources/META-INF/spring.factories | 2 -- ...ringframework.boot.autoconfigure.AutoConfiguration.imports | 1 + sdk-tests/pom.xml | 2 +- sdk/pom.xml | 4 ++-- 8 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 sdk-springboot/src/main/resources/META-INF/spring.factories create mode 100644 sdk-springboot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/examples/pom.xml b/examples/pom.xml index 5238d66dd..a83f11851 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -66,12 +66,12 @@ org.springframework.boot spring-boot-starter-web - 2.3.5.RELEASE + 2.7.8 org.springframework.boot spring-boot-autoconfigure - 2.3.5.RELEASE + 2.7.8 com.jayway.jsonpath diff --git a/pom.xml b/pom.xml index fe0c7f6ee..4af82cf57 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ true 4.0.0-RC1 true - 2.3.5.RELEASE + 2.7.8 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED diff --git a/sdk-actors/pom.xml b/sdk-actors/pom.xml index def8e3d10..503f8651e 100644 --- a/sdk-actors/pom.xml +++ b/sdk-actors/pom.xml @@ -58,7 +58,7 @@ org.springframework.boot spring-boot-starter-web - 2.3.5.RELEASE + 2.7.8 test diff --git a/sdk-springboot/pom.xml b/sdk-springboot/pom.xml index fd8d05303..a0b38714c 100644 --- a/sdk-springboot/pom.xml +++ b/sdk-springboot/pom.xml @@ -18,7 +18,7 @@ false - 2.3.5.RELEASE + 2.7.8 @@ -68,13 +68,11 @@ org.springframework spring-web - 5.2.10.RELEASE compile org.springframework spring-context - 5.2.10.RELEASE compile diff --git a/sdk-springboot/src/main/resources/META-INF/spring.factories b/sdk-springboot/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 58ff4b58d..000000000 --- a/sdk-springboot/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -io.dapr.springboot.DaprAutoConfiguration diff --git a/sdk-springboot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/sdk-springboot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 000000000..7c43d8482 --- /dev/null +++ b/sdk-springboot/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +io.dapr.springboot.DaprAutoConfiguration \ No newline at end of file diff --git a/sdk-tests/pom.xml b/sdk-tests/pom.xml index 55e532f10..3d10de646 100644 --- a/sdk-tests/pom.xml +++ b/sdk-tests/pom.xml @@ -20,7 +20,7 @@ 1.42.1 3.17.3 0.14.0 - 2.3.5.RELEASE + 2.7.8 diff --git a/sdk/pom.xml b/sdk/pom.xml index 09efa68bf..01a354fa5 100644 --- a/sdk/pom.xml +++ b/sdk/pom.xml @@ -94,13 +94,13 @@ org.springframework.boot spring-boot-starter-web - 2.3.5.RELEASE + 2.7.8 test org.springframework.boot spring-boot-autoconfigure - 2.3.5.RELEASE + 2.7.8 test From 4af329236ef2abbac1aac9653ca1d5d99ef43cda Mon Sep 17 00:00:00 2001 From: Sergio Date: Sun, 5 Feb 2023 21:59:49 +0100 Subject: [PATCH 2/2] Ensure old versions of spring boot are still compatible Signed-off-by: Sergio --- .github/workflows/build.yml | 34 +++++++++++++---- .../main/resources/META-INF/spring.factories | 2 + sdk-tests/pom.xml | 38 ++++++++++++++++++- .../src/test/java/io/dapr/it/AppRun.java | 2 +- .../java/io/dapr/it/pubsub/http/PubSubIT.java | 2 +- .../http/OpenTelemetryInterceptor.java | 2 +- 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 sdk-springboot/src/main/resources/META-INF/spring.factories diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aef0398fc..ec27ee60a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,10 +15,28 @@ on: jobs: build: + name: "Build jdk:${{ matrix.java }} sb:${{ matrix.spring-boot-version }} exp:${{ matrix.experimental }}" runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} strategy: + fail-fast: true matrix: java: [ 11, 13, 15, 16 ] + spring-boot-version: [ 2.7.8 ] + experimental: [ false ] + include: + - java: 11 + spring-boot-version: 2.6.14 + experimental: false + - java: 11 + spring-boot-version: 2.5.7 + experimental: false + - java: 11 + spring-boot-version: 2.4.0 + experimental: false + - java: 11 + spring-boot-version: 2.3.6.RELEASE + experimental: false env: GOVER: 1.19 GOOS: linux @@ -92,18 +110,18 @@ jobs: docker-compose -f ./sdk-tests/deploy/local-test-mongo.yml up -d docker ps - name: Clean up files - run: mvn clean + run: mvn clean -B - name: Build sdk - run: mvn compile -q + run: mvn compile -B -q - name: Unit tests - run: mvn test -q + run: mvn -B test -q - name: Codecov uses: codecov/codecov-action@v3.1.1 - name: Install jars - run: mvn install -q - - name: Integration tests + run: mvn install -q -B -DskipTests + - name: Integration tests using spring boot version ${{ matrix.spring-boot-version }} id: integration_tests - run: mvn -f sdk-tests/pom.xml verify + run: PRODUCT_SPRING_BOOT_VERSION=${{ matrix.spring-boot-version }} mvn -B -f sdk-tests/pom.xml verify - name: Upload test report for sdk uses: actions/upload-artifact@master with: @@ -145,7 +163,7 @@ jobs: java-version: ${{ env.JDK_VER }} - name: Get pom parent version run: | - PARENT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + PARENT_VERSION=$(mvn -B -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) echo "PARENT_VERSION=$PARENT_VERSION" >> $GITHUB_ENV - name: Is SNAPSHOT release ? if: contains(github.ref, 'master') && contains(env.PARENT_VERSION, '-SNAPSHOT') @@ -157,7 +175,7 @@ jobs: echo "DEPLOY_OSSRH=true" >> $GITHUB_ENV - name: Install jars if: env.DEPLOY_OSSRH == 'true' - run: mvn clean install -q + run: mvn clean install -B -q - name: Publish to ossrh if: env.DEPLOY_OSSRH == 'true' run: | diff --git a/sdk-springboot/src/main/resources/META-INF/spring.factories b/sdk-springboot/src/main/resources/META-INF/spring.factories new file mode 100644 index 000000000..58ff4b58d --- /dev/null +++ b/sdk-springboot/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +io.dapr.springboot.DaprAutoConfiguration diff --git a/sdk-tests/pom.xml b/sdk-tests/pom.xml index c35de8c0d..2546b97d9 100644 --- a/sdk-tests/pom.xml +++ b/sdk-tests/pom.xml @@ -23,6 +23,19 @@ 2.7.8 + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + commons-cli @@ -102,13 +115,11 @@ org.springframework.boot spring-boot-starter-web - ${spring-boot.version} test org.springframework.boot spring-boot-autoconfigure - ${spring-boot.version} test @@ -203,4 +214,27 @@ + + + + custom-spring-boot-version + + + env.PRODUCT_SPRING_BOOT_VERSION + + + + ${env.PRODUCT_SPRING_BOOT_VERSION} + + + + + com.squareup.okhttp3 + okhttp + 4.9.0 + test + + + + diff --git a/sdk-tests/src/test/java/io/dapr/it/AppRun.java b/sdk-tests/src/test/java/io/dapr/it/AppRun.java index a29034be0..5900f6a22 100644 --- a/sdk-tests/src/test/java/io/dapr/it/AppRun.java +++ b/sdk-tests/src/test/java/io/dapr/it/AppRun.java @@ -28,7 +28,7 @@ public class AppRun implements Stoppable { private static final String APP_COMMAND = - "mvn exec:java -D exec.mainClass=%s -D exec.classpathScope=test -D exec.args=\"%s\" -D %s=%s -D %s=%s"; + "mvn exec:java -B -D exec.mainClass=%s -D exec.classpathScope=test -D exec.args=\"%s\" -D %s=%s -D %s=%s"; private final DaprPorts ports; diff --git a/sdk-tests/src/test/java/io/dapr/it/pubsub/http/PubSubIT.java b/sdk-tests/src/test/java/io/dapr/it/pubsub/http/PubSubIT.java index 86b35b2a8..7cd74906c 100644 --- a/sdk-tests/src/test/java/io/dapr/it/pubsub/http/PubSubIT.java +++ b/sdk-tests/src/test/java/io/dapr/it/pubsub/http/PubSubIT.java @@ -755,8 +755,8 @@ public void testLongValues() throws Exception { for (CloudEvent message : messages) { actual.add(message.getData()); } + Assert.assertEquals(values, actual); }, 2000); - Assert.assertEquals(values, actual); } } diff --git a/sdk-tests/src/test/java/io/dapr/it/tracing/http/OpenTelemetryInterceptor.java b/sdk-tests/src/test/java/io/dapr/it/tracing/http/OpenTelemetryInterceptor.java index 5c49a16da..36e250436 100644 --- a/sdk-tests/src/test/java/io/dapr/it/tracing/http/OpenTelemetryInterceptor.java +++ b/sdk-tests/src/test/java/io/dapr/it/tracing/http/OpenTelemetryInterceptor.java @@ -16,7 +16,7 @@ import io.opentelemetry.api.OpenTelemetry; import io.opentelemetry.context.Context; import io.opentelemetry.context.propagation.TextMapPropagator; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nullable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor;