diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml index 5b7f299..b7fe4a1 100644 --- a/.github/workflows/maven-build.yml +++ b/.github/workflows/maven-build.yml @@ -20,12 +20,5 @@ jobs: java-version: '17' distribution: 'temurin' - - name: Build with Maven (+ unit tests only) - run: mvn clean test - - - name: Integration tests - run: mvn verify -P integration-tests - env: - GIGACHAT_API_CLIENT_ID: ${{ secrets.GIGACHAT_API_CLIENT_ID }} - GIGACHAT_API_CLIENT_SECRET: ${{ secrets.GIGACHAT_API_CLIENT_SECRET }} - GIGACHAT_API_SCOPE: ${{ secrets.GIGACHAT_API_SCOPE }} + - name: Build with Maven (unit tests only) + run: mvn clean test --no-transfer-progress diff --git a/.github/workflows/maven-integration-tests.yml b/.github/workflows/maven-integration-tests.yml new file mode 100644 index 0000000..38e1c63 --- /dev/null +++ b/.github/workflows/maven-integration-tests.yml @@ -0,0 +1,32 @@ +name: PR Merged build (with integration tests) + +on: + pull_request: + branches: + - main + - release/* + types: [closed] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Build with Maven (unit tests) + run: mvn clean test --no-transfer-progress + + - name: Integration tests + run: mvn verify -P integration-tests --no-transfer-progress + env: + GIGACHAT_API_CLIENT_ID: ${{ secrets.GIGACHAT_API_CLIENT_ID }} + GIGACHAT_API_CLIENT_SECRET: ${{ secrets.GIGACHAT_API_CLIENT_SECRET }} + GIGACHAT_API_SCOPE: ${{ secrets.GIGACHAT_API_SCOPE }} diff --git a/pom.xml b/pom.xml index 5f56954..dce10c6 100644 --- a/pom.xml +++ b/pom.xml @@ -50,14 +50,14 @@ 17 - 17 - 17 + 17 UTF-8 - 2.26.0 - 1.9.22 + 2.29.1 + 1.9.24 3.4.5 1.0.0 - 8.3.5 + 8.3.7 + 1.18.38 3.1.4 @@ -124,10 +124,26 @@ ${project.artifactId} + + org.apache.maven.plugins + maven-compiler-plugin + 3.14.0 + + + + org.projectlombok + lombok + ${lombok.version} + + + ${maven.compiler.release} + + + org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.5.3 false @@ -162,7 +178,7 @@ io.qameta.allure allure-maven - 2.12.0 + 2.15.2 ${allure-bom.version} ${project.build.directory}/allure-results @@ -172,7 +188,7 @@ com.diffplug.spotless spotless-maven-plugin - 2.43.0 + 2.44.5 @@ -248,6 +264,7 @@ org.apache.maven.plugins maven-failsafe-plugin + 3.5.3 diff --git a/spring-ai-gigachat-example/pom.xml b/spring-ai-gigachat-example/pom.xml index 96752b1..cc1b80c 100644 --- a/spring-ai-gigachat-example/pom.xml +++ b/spring-ai-gigachat-example/pom.xml @@ -85,6 +85,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.14.0 + + + + org.projectlombok + lombok + ${lombok.version} + + + ${java.version} + + + org.apache.maven.plugins maven-install-plugin diff --git a/spring-ai-gigachat/src/main/java/chat/giga/springai/api/auth/GigaChatApiProperties.java b/spring-ai-gigachat/src/main/java/chat/giga/springai/api/auth/GigaChatApiProperties.java index 4683e4b..51b563c 100644 --- a/spring-ai-gigachat/src/main/java/chat/giga/springai/api/auth/GigaChatApiProperties.java +++ b/spring-ai-gigachat/src/main/java/chat/giga/springai/api/auth/GigaChatApiProperties.java @@ -25,6 +25,8 @@ public class GigaChatApiProperties { private Resource clientCertificate; private Resource clientKey; + + @Builder.Default private boolean unsafeSsl = false; public enum GigaChatApiScope { diff --git a/spring-ai-gigachat/src/main/java/chat/giga/springai/api/chat/GigaChatApi.java b/spring-ai-gigachat/src/main/java/chat/giga/springai/api/chat/GigaChatApi.java index cc30a0e..6ec61eb 100644 --- a/spring-ai-gigachat/src/main/java/chat/giga/springai/api/chat/GigaChatApi.java +++ b/spring-ai-gigachat/src/main/java/chat/giga/springai/api/chat/GigaChatApi.java @@ -184,10 +184,10 @@ public ResponseEntity models() { private Consumer applyHeaders(@Nullable HttpHeaders headers) { return httpHeaders -> { - httpHeaders.add(HttpHeaders.USER_AGENT, USER_AGENT_SPRING_AI_GIGACHAT); if (!CollectionUtils.isEmpty(headers)) { httpHeaders.addAll(headers); } + httpHeaders.set(HttpHeaders.USER_AGENT, USER_AGENT_SPRING_AI_GIGACHAT); }; } }