Skip to content

Commit ad53fe4

Browse files
committed
Make sure that the entire Spring AI compiles with Spring 7
* Add GitHub Worklfow that runs the suite with Spring 7 * Uncomment `@Override` from methods implementing from ResponseHandler * Add custom ApiClient.mustache, original copied from https://github.com/swagger-api/swagger-codegen/blob/92fcc8196bd90fef199c2932903135e3b519f689/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache and adjusted the use of the HttpHeaders to be compliant with Spring 7 * Adjust ChatCLientExtensions.kt to be compatible with Kotlin 2
1 parent be6f36c commit ad53fe4

File tree

6 files changed

+685
-4
lines changed

6 files changed

+685
-4
lines changed

.github/workflows/pr-check.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,22 @@ jobs:
2424
- name: Run tests
2525
run: |
2626
./mvnw --batch-mode test
27+
spring_7:
28+
name: Compile with Spring 7
29+
runs-on: ubuntu-latest
30+
if: ${{ github.repository_owner == 'spring-projects' }}
31+
steps:
32+
- name: Checkout source code
33+
uses: actions/checkout@v4
34+
35+
- name: Set up JDK 17
36+
uses: actions/setup-java@v4
37+
with:
38+
java-version: '17'
39+
distribution: 'temurin'
40+
cache: 'maven'
41+
42+
- name: Run tests
43+
run: |
44+
./mvnw --batch-mode -Dspring-framework.version=7.0.0-RC2 -Dkotlin.version=2.2.0 compile
45+

auto-configurations/common/spring-ai-autoconfigure-retry/src/main/java/org/springframework/ai/retry/autoconfigure/SpringAiRetryAutoConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public boolean hasError(@NonNull ClientHttpResponse response) throws IOException
8686
return response.getStatusCode().isError();
8787
}
8888

89-
@Override
89+
// On purposes commented out so that the code can compile both with Spring 6 and Spring 7
90+
// @Override
91+
@SuppressWarnings("removal")
9092
public void handleError(@NonNull ClientHttpResponse response) throws IOException {
9193
if (!response.getStatusCode().isError()) {
9294
return;

0 commit comments

Comments
 (0)