Modernize: Java 17 + Spring Boot 3.2 + Jakarta EE + Spring Security 6#565
Open
devin-ai-integration[bot] wants to merge 6 commits intomasterfrom
Open
Modernize: Java 17 + Spring Boot 3.2 + Jakarta EE + Spring Security 6#565devin-ai-integration[bot] wants to merge 6 commits intomasterfrom
devin-ai-integration[bot] wants to merge 6 commits intomasterfrom
Conversation
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.com>
Co-Authored-By: sachet.agarwal <sachet.agarwal@windsurf.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
Upgrades the stack from Java 11 / Spring Boot 2.6 to Java 17 / Spring Boot 3.2. Completed across six committed phases:
sourceCompatibility/targetCompatibilityto 17, Gradle wrapper to 8.5, spotless to 6.25.0.java.time.Instant— replacedorg.joda.time.DateTimeacross 21 files (domain entities, DTOs,DateTimeCursor,DateTimeHandler, Jackson serializer, GraphQL datafetchers, tests). Joda dependency removed.build.gradle: Spring Boot 3.2.5, dependency-management 1.1.4, MyBatis 3.0.3, DGS 8.5.0 (+ codegen 6.2.1), Flyway pinned to 9.22.3 (last version with community SQLite support), JJWT 0.12.5, SQLite 3.45.1.0, rest-assured 5.4.0.javax.servlet.*/javax.validation.*→jakarta.*(javax.cryptokept as-is, it's JDK).WebSecurityConfig: full rewrite fromWebSecurityConfigurerAdaptertoSecurityFilterChainbean with the new lambda DSL. Route rules preserved 1:1.CustomizeExceptionHandler.handleMethodArgumentNotValid:HttpStatus→HttpStatusCode.DefaultJwtService: rewritten for JJWT 0.12.x (Keys.hmacShaKeyFor,.subject()/.expiration(),Jwts.parser().verifyWith(...).parseSignedClaims(...)).ArticleDatafetcher/CommentDatafetcher: switched fromgraphql.relay.PageInfo/DefaultPageInfoto the DGS-generatedio.spring.graphql.types.PageInfo.GraphQLCustomizeExceptionHandler:onException→handleExceptionreturningCompletableFuture<DataFetcherExceptionHandlerResult>.DefaultJwtServiceTestsecret extended to 64 chars; expired-token test rewritten to generate the token programmatically (the old hardcoded token was signed by the previous JJWT version and is no longer a valid expiry test in isolation).DateTimeCursorTest,DateTimeHandlerTest,JacksonCustomizationsTest../gradlew clean testpasses locally.Review & Testing Checklist for Human
This is a wide-reaching upgrade — please do not rely on green CI alone.
./gradlew bootRun). I did not verify runtime startup, only compile + unit/integration tests. In particular, confirm Flyway migrations apply against SQLite and the schema is created.Keys.hmacShaKeyForthrowsWeakKeyExceptionifjwt.secretis < 32 bytes (HS256) / 64 bytes (HS512). Check whateverapplication.propertiesis used in deployment has a long-enough secret, and note that all previously issued tokens become invalid because the oldSignatureAlgorithm.HS512 + SecretKeySpec(bytes)path is gone.WebSecurityConfigroute rules — compare oldantMatcherschain vs. newrequestMatcherschain; confirm no endpoint that was protected is nowpermitAlland vice-versa. Particular scrutiny on/articles/feed(authenticated) vs/articles/**GET (public) ordering.ISODateTimeFormat.dateTime().withZoneUTC()which always emits 3 fractional digits (e.g.2024-01-15T12:34:56.789Z). New path usesDateTimeFormatter.ISO_INSTANTwhich omits fractional seconds when zero and uses variable precision otherwise. If any API consumer parses a strict format, this is a breaking change.ArticleApiTestwas updated to the new format, but external clients weren't.PageInfo: DGS 8 generates its ownio.spring.graphql.types.PageInfo. Exercise/graphqlqueries that usearticlesConnection/feed/comments pagination and confirm cursors still round-trip correctly../gradlew dependencies | grep flyway) and that migrations run on a fresh DB.Notes
application.properties/application.ymlis checked into the repo; I did not create one. If one is injected at deploy time, nothing here changes that contract, butjwt.secretlength must be validated there (see checklist).MockBeanimports were left onorg.springframework.boot.test.mock.mockito.MockBean— still valid (deprecated but functional) in Boot 3.2.x; migrating to@MockitoBeanis only required at 3.4+.Link to Devin session: https://app.devin.ai/sessions/f95d9a0043c3470b930fb59f2e50b454
Requested by: @SachetCognition