Migrate to Java 17 + Spring Boot 3#566
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
Migrate to Java 17 + Spring Boot 3#566devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
Co-Authored-By: Samir Chaudhry <schaudhry123@gmail.com>
Author
🤖 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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the project from Java 11 / Spring Boot 2.6 to Java 17 / Spring Boot 3.2 per the requested 10-step plan.
Build / deps
sourceCompatibility/targetCompatibility→177.4→8.52.6.3→3.2.5, dependency-management1.1.42.2.2→3.0.3(main + test), SQLite JDBC →3.45.1.0, REST Assured →5.4.0, jjwt →0.12.5, Spotless →6.25.0graphql-dgs-spring-boot-starter:4.9.21→graphql-dgs-spring-graphql-starter:9.0.0, codegen plugin6.2.1joda-timespotlessJavatask deps (compileJava, generateJava, processResources, compileTestJava, processTestResources) to satisfy Gradle 8's stricter implicit-dependency validationCode changes
javax.servlet.*/javax.validation.*→jakarta.*across all web/validation filesWebSecurityConfigrefactored fromWebSecurityConfigurerAdapterto the Spring Security 6SecurityFilterChainbean (lambda DSL,requestMatchers,authorizeHttpRequests)CustomizeExceptionHandler.handleMethodArgumentNotValidsignature updated toHttpStatusCodeorg.joda.time.DateTime→java.time.Instanteverywhere (core entities, data DTOs, MyBatisDateTimeHandler, cursors, query services, Jackson serializer, tests)JacksonCustomizationsnow serializesInstantwith a manualDateTimeFormatterproducingyyyy-MM-dd'T'HH:mm:ss.SSS'Z'io.spring.graphql.types.PageInfo(replacinggraphql.relay.DefaultPageInfo);GraphQLCustomizeExceptionHandlernow implements the DGS 9.0.0handleExceptionmethod returningCompletableFuture<DataFetcherExceptionHandlerResult>DefaultJwtServiceupdated to the jjwt 0.12.x builder/parser API (subject,expiration,Jwts.SIG.HS512,verifyWith,parseSignedClaims,getPayload)instanceof,Map.of(...)replacing double-brace init,Stream.toList()Test/config
DefaultJwtServiceTestsetUp key extended from 60 → 80 chars so the HS512 key meets jjwt 0.12.x's enforced 512-bit minimumspring.graphql.schema.inspection.enabled=false— required to start the context (see note below)Full
./gradlew clean buildpasses locally (68 tests, all green).Review & Testing Checklist for Human
spring.graphql.schema.inspection.enabled=false— Spring GraphQL'sSchemaMappingInspectorinfers node type names by stripping theConnectionsuffix, soArticlesConnection/CommentsConnectionmap toArticles/Commentswhich don't exist (we haveArticle/Comment). I disabled the inspector to get the context to start. Confirm this workaround is acceptable, or consider renaming the GraphQL types toArticleConnection/CommentConnectionas a follow-up.JacksonCustomizationsdate format — the old JodaISODateTimeFormat.dateTime().withZoneUTC()producesyyyy-MM-dd'T'HH:mm:ss.SSSZZ(e.g....SSS+00:00); I replaced it with a formatter that hardcodes a trailingZ. Functionally equivalent for UTC, but the literal bytes differ from the pre-migration output. Verify no downstream consumer pins the exact previous suffix.jwt.secretinapplication.propertiesis already long enough. Confirm this is acceptable./graphql), login, and cursor pagination (connections). Verify timestamps in responses look correct with the newInstantserializer.dev.db— deletedev.dband start the app to confirm Spring Boot 3 / Flyway 9 still applies the SQLite migrations cleanly.Notes
cleanstill deletesdev.db.flyway-database-sqlitemodule was added — Flyway 9 bundled with Spring Boot 3.2 still handles SQLite viaflyway-coreand tests pass, but this is worth watching if you bump Flyway in the future.Link to Devin session: https://app.devin.ai/sessions/62e23f92e1624385ba70f64c526fb940
Requested by: @schaudhry123