Upgrade to Spring Boot 3.2.5 / Java 17 (integrated: build, Jakarta, Security 6, DGS 8) - #831
devin-ai-integration[bot] wants to merge 9 commits into
Conversation
…ing Boot 3 upgrade) Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
…plication package Part of Spring Boot 3 / Java 17 upgrade (Session C — application package Jakarta migration). Replaces javax.validation.* imports with jakarta.validation.* across the assigned application-package files. Scoped to import prefixes only. Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
Part of Spring Boot 3 / Java 17 upgrade (workstream D). Replace javax.validation.* with jakarta.validation.* in GraphQL exception handler and UserMutation. JDK javax.* imports (javax.crypto in DefaultJwtService) left intact. Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
…rChain style Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
…on-jakarta' into devin/sb3-java17-integration
…nfra-jakarta' into devin/sb3-java17-integration
…' into devin/sb3-java17-integration
…7 wrapper (WS-A) Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
…ring 6 exception handler, spotless/JDK17, CI JDK 17 Co-Authored-By: Scotty Andrade <scotty.andrade@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| .requestMatchers(HttpMethod.OPTIONS, "/**") | ||
| .permitAll() |
There was a problem hiding this comment.
📝 Info: OPTIONS matcher migration preserves behavior
The old rule .antMatchers(HttpMethod.OPTIONS).permitAll() matched all paths for the OPTIONS method (path-less overload matches any path). The new .requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() is behaviorally equivalent, so CORS preflight handling is preserved. No issue.
Was this helpful? React with 👍 or 👎 to provide feedback.
| private PageInfo buildArticlePageInfo(CursorPager<ArticleData> articles) { | ||
| return PageInfo.newBuilder() | ||
| .startCursor( | ||
| articles.getStartCursor() == null ? null : articles.getStartCursor().toString()) | ||
| .endCursor(articles.getEndCursor() == null ? null : articles.getEndCursor().toString()) | ||
| .hasPreviousPage(articles.hasPrevious()) | ||
| .hasNextPage(articles.hasNext()) | ||
| .build(); |
There was a problem hiding this comment.
📝 Info: Generated PageInfo type matches schema and previous relay semantics
The schema declares its own PageInfo with non-null hasNextPage/hasPreviousPage and nullable startCursor/endCursor. The rewritten buildArticlePageInfo/buildCommentPageInfo build the DGS-generated io.spring.graphql.types.PageInfo with the same null-guarding on cursors and the same hasPrevious()/hasNext() values, preserving prior graphql.relay.DefaultPageInfo semantics. No issue.
Was this helpful? React with 👍 or 👎 to provide feedback.
| .path(handlerParameters.getPath()) | ||
| .extensions(errorsToMap(errors)) | ||
| .build(); | ||
| return DataFetcherExceptionHandlerResult.newResult().error(graphqlError).build(); | ||
| return CompletableFuture.completedFuture( | ||
| DataFetcherExceptionHandlerResult.newResult().error(graphqlError).build()); | ||
| } else { | ||
| return defaultHandler.onException(handlerParameters); | ||
| return defaultHandler.handleException(handlerParameters); |
There was a problem hiding this comment.
📝 Info: handleException override returns CompletableFuture as required by graphql-java in DGS 8
The prior onException sync method was removed from DataFetcherExceptionHandler; the new override handleException returning CompletableFuture<DataFetcherExceptionHandlerResult> correctly wraps both custom-error results and delegates to defaultHandler.handleException(...). Consistent with the new interface contract. No issue.
(Refers to lines 31-69)
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Upgrades the app from Spring Boot 2.6.3 / Java 11 to Spring Boot 3.2.5 / Java 17. This is the integration (workstream F) of five parallel workstreams (A–E), each of which owned a disjoint file set; this branch merges all five and adds the cross-cutting fixes needed to compile, build, and pass tests on the new stack.
Base of this PR is
devin/sb3-java17-base— a snapshot of the source repo'smaster(commitc20e1f6) — so the diff shows exactly the migration.Build & tooling (WS-A)
org.springframework.boot2.6.3→3.2.5;io.spring.dependency-management1.0.11.RELEASE→1.1.4.sourceCompatibility/targetCompatibility11→17; Gradle wrapper7.4→8.7.mybatis-spring-boot-starter(+-test)2.2.2→3.0.3; DGS starter4.9.21→8.5.3; DGS codegen plugin5.0.6→6.2.0; jjwt0.11.2→0.11.5; rest-assured4.5.1→5.4.0; sqlite-jdbc →3.45.3.0.flyway-corestays BOM-managed.Jakarta EE namespace migration (WS-B/C/D)
javax.servlet.*/javax.validation.*/javax.annotation.*→jakarta.*acrossio.spring.api,io.spring.application,io.spring.graphql, andio.spring.infrastructure. JDKjavax.*(e.g.javax.crypto) left untouched.Spring Security 6 (WS-E)
WebSecurityConfigno longer extends the removedWebSecurityConfigurerAdapter; it now exposes aSecurityFilterChainbean using the lambda DSL andauthorizeHttpRequests()+requestMatchers(...). Behavior preserved: CSRF disabled, CORS enabled,HttpStatusEntryPoint(UNAUTHORIZED), stateless sessions, identical matcher rules, andjwtTokenFilterbeforeUsernamePasswordAuthenticationFilter.Integration fixes (WS-F, this branch)
Cross-cutting changes that fall between workstreams and only surface when everything is combined:
io.spring.graphql.types.PageInfofor connections instead ofgraphql.relay.PageInfo.ArticleDatafetcher/CommentDatafetcherbuildXxxPageInfo(...)rewritten to build the generated type:DataFetcherExceptionHandler:onException(...)removed.GraphQLCustomizeExceptionHandlernow overridesCompletableFuture<DataFetcherExceptionHandlerResult> handleException(...)(results wrapped inCompletableFuture.completedFuture(...), default delegated viadefaultHandler.handleException(...)).ResponseEntityExceptionHandler.handleMethodArgumentNotValidsignature now takesHttpStatusCode(wasHttpStatus) —CustomizeExceptionHandlerupdated.com.diffplug.spotless6.2.1→6.25.0and pinnedgoogleJavaFormat('1.19.2')(old google-java-format fails on JDK 17 withjdk.compilermodule-access errors). Also scoped the Spotless target tosrc/**/*.javato satisfy Gradle 8's stricter implicit-task-dependency validation (previously it scannedbuild/generated)..github/workflows/gradle.ymlset up JDK11→17; refreshedactions/checkout,setup-java,cacheto v4.Validation
./gradlew clean build testpasses on JDK 17 — 68 tests, 0 failures, 0 errors.Note on repository
The task referenced
ankehao-demo/spring-boot-realworld-example-app, but that fork is read-only for automation (push returns 403). All workstream branches and this integrated PR therefore live on the writable forkCOG-GTM/spring-boot-realworld-example-app, based on the same source commit (c20e1f6).Link to Devin session: https://app.devin.ai/sessions/50b23c7855044ecaa3cde259fc927351
Requested by: @scottyandrade99
Devin Review