Repository navigation
Upgrade to Spring Boot 3.5.16 and jakarta (DGS 10.6.0, MyBatis 3.0.5, REST Assured 5.5.7) - #1265
Conversation
…write-recipe-bom 3.37.0) Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>
…ged REST Assured 5.5.7, sqlite-jdbc 3.54.1.0, permit ERROR dispatch, unwrapped JSON for /graphql Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…releases that fix new advisories Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>
There was a problem hiding this comment.
Devin Review found 2 findings. All 2 findings are left for you to triage below.
Custom reviewers
- ⏱️ TD API Contracts: 1 finding · View
| return new GraphQlHttpHandler( | ||
| webGraphQlHandler, new MappingJackson2HttpMessageConverter(graphQlMapper)); |
There was a problem hiding this comment.
🟡 Raw GraphQL requests rejected with 415
For application/graphql requests, GraphQlHttpHandler now returns HTTP 415 instead of executing the raw query. Its dedicated MappingJackson2HttpMessageConverter accepts only JSON media types, breaking clients supported by the previous DGS controller.
Devin left this for you to triage: This is real, but GraphQLHttpConfig is not the cause: I removed it and the stock Spring for GraphQL handler that DGS 10 uses still returns 415 for application/graphql. Raw-query POSTs worked on DGS 5 and stop working after this upgrade, and no smoke call covers them. Restoring them needs a custom converter (follow-up or regression step); the RealWorld clients send application/json.
Learn more
The previous DGS controller explicitly accepted Content-Type: application/graphql and treated the body as a query document. Spring GraphQL's HTTP request predicate still accepts that media type, but the custom converter supports only application/json and application/*+json. AbstractGraphQlHttpHandler.readBody checks the supplied converter's canRead result and throws HttpMediaTypeNotSupportedException before query execution. Merely adding the media type to Jackson's supported list cannot parse a raw GraphQL document as JSON.
Example: curl http://localhost:8080/graphql -H 'Content-Type: application/graphql' --data 'query { tags }' previously returned tag data and now receives HTTP 415.
Recommended fix: Preserve the isolated JSON mapper while adding explicit raw-document handling for application/graphql. Use a converter or HTTP adapter that wraps raw documents as GraphQL requests and delegates JSON requests to the current converter. Add transport regression coverage for both raw documents and root-unwrapped JSON requests.
Was this helpful? React with 👍 or 👎 to provide feedback.
| implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.3.2' | ||
| implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:5.6.2' | ||
| implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.5' | ||
| implementation 'com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter:10.6.0' |
There was a problem hiding this comment.
⏱️ TD API Contracts: GraphQL login errors lose locations
After the DGS upgrade, graphql.login.bad-password returns no errors[].locations, previously [] in the smoke baseline. GraphQL clients expecting that field break, and the unchanged baseline fails. Preserve locations: [] in handleException or version the endpoint under §8.
Devin left this for you to triage: Known diff, listed in the PR. graphql-java 22+ drops empty locations from the error spec map, so locations: [] cannot be kept without post-processing every error response. The 3 no-auth errors now carry real locations. The manager has to decide whether to accept this diff or hand it to the regression step; the baseline was not regenerated.
View in Devin Review · Custom reviewer
Was this helpful? React with 👍 or 👎 to provide feedback.
48b5629
into
devin/unt-5-spring-boot-2.7
Summary
Moves the app from Spring Boot 2.7.18 to Spring Boot 3.5.16 (Spring Framework 6.2.19, Security 6.5.11, Hibernate Validator 8.0.3, Tomcat 10.1.55, Flyway 11.7.2). Stacked on #1252 (base
devin/unt-5-spring-boot-2.7). Ticket: Bump to Spring Boot 3.5 and jakarta (plan steps3.1).Three commits, so the recipe output and the hand-written fixes can be reviewed separately:
71ae08bf: raw output of OpenRewriteorg.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5(rewrite-spring fromrewrite-recipe-bom:3.37.0, Gradle plugin 7.39.0, run via an init script so the build file has no rewrite plugin). It does thejavax.validation/javax.servlet→jakarta.*change (javax.cryptois left alone), bumps the Boot plugin, MyBatis 3.0.3 and REST Assured 5.1.1, and removes redundant@Autowired.f1d99487: hand fixes:build.gradle: DGSgraphql-dgs-spring-boot-starter:5.6.2→graphql-dgs-spring-graphql-starter:10.6.0. DGS 10.2.4–10.6.0 is the line built against Boot 3.5; DGS 11 targets Boot 4. Codegen stays 8.8.0, the latest release. MyBatis starter goes to 3.0.5 andsqlite-jdbcto 3.54.1.0. REST Assured now uses the Boot-managed 5.5.7. The 2.7-era overridesgraphql-java.version,tomcat.version(9.0.124) and thefederation-graphql-java-supportpin are removed. Thejavax.xml.bind:jaxb-apithat the recipe added is dropped because nothing uses it. Flyway 11.7.2 still ships SQLite inflyway-core, so no extra module is needed.WebSecurityConfig:.dispatcherTypeMatchers(DispatcherType.ERROR).permitAll(). Security 6 authorizes every dispatch type, so the/errorforward after a 404 or 403 was being answered with 401 (6 smoke calls).GraphQLHttpConfig: supplies theGraphQlHttpHandlerwith a converter whoseObjectMapperis a copy of the app mapper withUNWRAP_ROOT_VALUEdisabled. DGS 10 serves/graphqlthrough Spring for GraphQL, which reads the body with the MVC converters, andspring.jackson.deserialization.UNWRAP_ROOT_VALUE=true(needed by the REST API) made every GraphQL request fail with400 Failed to read request.GraphQLCustomizeExceptionHandlerneeded only the jakarta import. It already implements the asyncCompletableFuturehandleExceptionAPI and delegates toDefaultDataFetcherExceptionHandler, which DGS 10 still provides.spring-boot-properties-migratorwas added andbootRunproduced no migration warnings, so it was removed in the same commit.0a08fb72:ext['jackson-bom.version'] = '2.21.7'andext['tomcat.version'] = '10.1.59'. These patch releases fix advisories that are new versus base in the versions Boot 3.5.16 manages: jackson 2.21.4 (GHSA-p6pp-m3f8-5c89, GHSA-q4xh-88c3-wmh7, GHSA-mhm7-754m-9p8w) and tomcat 10.1.55 (7 advisories, 5 critical).Verification (local, JDK 17)
./gradlew clean spotlessCheck build: BUILD SUCCESSFUL, 68 tests in 20 classes, 0 failures (same as the baseline).bootRunstarts and the GraphQL endpoint is mapped atPOST /graphql.scripts/smoke/run.sh: all 75 calls and every assertion pass (0 FAIL), but the baseline diff is not empty, so the script exits 1 and the CIsmokejob is red with the same diff. The baseline was not regenerated. Differences, all in the shape of GraphQLerrors[]:graphql.login.bad-password(customTypedGraphQLError,UNAUTHENTICATED)"locations": []locationskey omitted (graphql-java 22+ drops empty locations)graphql.me.no-auth,graphql.createArticle.no-auth,graphql.feed.no-auth(DGS default handler,INTERNAL)"locations": []"locations": [{"line","column"}]Status codes,
errorTypevalues anddatashapes are unchanged. TheINTERNALresult for unauthenticated calls is the bug that already exists on master and is out of scope.Snyk
security/snykis red on0a08fb72. I can't open the Snyk report without a login, so this comes from an OSV scan of the runtime and test classpaths, basea1a428e9vs this head:spring-webmvc6.2.19. Every 6.2.x is affected and the only fix is 7.0.9 (Spring Framework 7 / Boot 4). No 6.2.20 is published, so Boot 3.5 cannot clear it.This PR adds no Snyk ignores and does not change the policy.
Known differences handed to UNT-8
The manager accepted these for this step. They move to the "Fix Boot 3 test and behaviour regressions" step; the baseline is unchanged.
POST /graphqlwithContent-Type: application/graphql(raw query body) returns 415 on DGS 10 / Spring for GraphQL. DGS 5 accepted it.errors[].locationsshapes (4 smoke calls):graphql.login.bad-password:locationsis omitted; the baseline has"locations": [].graphql.me.no-auth,graphql.createArticle.no-auth,graphql.feed.no-auth:"locations": [{"line","column"}]; the baseline has"locations": [].The spring-webmvc CVE-2026-47890 (see Snyk above) has gone to Joel for a decision.
Other notes
[removal]warnings only:AntPathRequestMatcherinWebSecurityConfigand@MockBeanin tests (deprecated in Security 6.5 and Boot 3.4).Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/fd777e7a0c4249aab846188357ca1cbc
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/fd777e7a0c4249aab846188357ca1cbc?variant=devin
Requested by: @joeloshea-cog
👀 2 findings for you to triage · Follow Devin's work