Skip to content

feature: upgrade Spring Boot 2.0.2 -> 4.1.1 (Java 17) incrementally - #79

Open
devin-ai-integration[bot] wants to merge 19 commits into
masterfrom
devin/1788460423-springboot-4.1.1-upgrade
Open

devin-ai-integration[bot] wants to merge 19 commits into
masterfrom
devin/1788460423-springboot-4.1.1-upgrade

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Upgrades the app from Spring Boot 2.0.2.RELEASE / Java 8 (what master actually had — not 2.7.18) to Spring Boot 4.1.1 / Java 17, one minor version at a time with one commit per step. At every step mvn clean verify passed and the jar was started and smoke-tested (/topic, /topic/java, /?name=Devin, banner version checked).

Upgrade path (one commit each)

2.0.2.RELEASE → 2.1.18.RELEASE → 2.2.13.RELEASE → 2.3.12.RELEASE → 2.4.13 → 2.5.15 → 2.6.15 → 2.7.18 → 3.0.13 → 3.1.12 → 3.2.12 → 3.3.13 → 3.4.13 → 3.5.16 → 4.0.8 → 4.1.1

Breaking changes handled

Step Change
pre-req (bug) <packaging>pom</packaging>jar. With pom packaging Maven compiled nothing and produced no jar, so the "build" was a no-op and the app could not be run.
pre-req (bug) Startup crashed with UnknownHostException: gturnquist-quoters.cfapps.io (dead demo quote service called from main and a CommandLineRunner). Wrapped the call in logRandomQuote() which logs a WARN on RestClientException instead of failing startup.
2.1 → 2.7 No code changes needed; spring-boot-properties-migrator reported no deprecated/renamed properties (the only property, server.port, is commented out).
3.0 java.version 1.8 → 17. No javax.* imports exist in the code base, so no jakarta.* migration was required. Properties migrator stayed on the classpath through 3.x and reported nothing.
3.1 → 3.5 No changes needed.
4.0 Per the 4.0 migration guide module split: spring-boot-starter-webspring-boot-starter-webmvc (old starter deprecated); RestTemplateBuilder moved to org.springframework.boot.restclient.RestTemplateBuilder in the new spring-boot-restclient module, so spring-boot-starter-restclient was added. Java baseline remains 17 (4.0/4.1 require 17+, no bump needed).
4.1 No changes needed (4.1 release notes; only jOOQ needs Java 21, not used).
cleanup Removed spring-boot-properties-migrator (migration guide says to remove it once done). Added spring-boot-starter-actuator so /actuator/health is available. Replaced the Spring Framework 7–deprecated JdbcTemplate.query(String, Object[], RowMapper) with the varargs overload query(String, RowMapper, Object...) so the build is deprecation-warning free.

Not changed

  • build.gradle (still references Spring Boot 2.0.2 / Gradle compile config) was left as-is; the Maven build is the one used by CI/blueprint. Happy to update in a follow-up if wanted.
  • Tracked target/ build artifacts were not re-committed.
  • No tests exist under src/test, so nothing to run there.

Verification (Spring Boot 4.1.1, Java 17)

Full log in the attached springboot-4.1.1-evidence.txt (session attachment). Excerpt:

 :: Spring Boot ::                (v4.1.1)
INFO ... hello.Application : Started Application in 1.493 seconds

$ curl -s -i localhost:8080/topic                 -> 200 [{"id":"spring",...},{"id":"java",...},{"id":"javascript",...}]
$ curl -s -i localhost:8080/topic/java            -> 200 {"id":"java","subjectName":"Core Java",...}
$ curl -s -i "localhost:8080/?name=Devin"         -> 200 {"id":1,"content":"Hello, Devin!"}
$ curl -X POST   .../topic  {"id":"kotlin",...}   -> 200 ; GET /topic/kotlin -> 200 {"id":"kotlin","subjectName":"Kotlin",...}
$ curl -X PUT    .../topic/kotlin {...Updated}    -> 200 ; GET /topic/kotlin -> {"subjectName":"Kotlin Updated",...}
$ curl -X DELETE .../topic/kotlin                 -> 200 ; GET /topic -> back to 3 original topics
$ curl .../topic/sort, /topic/minimum/length/4, /topic/string/operation, /datetime -> 200
$ curl -s -i localhost:8080/actuator/health       -> 200 {"groups":["liveness","readiness"],"status":"UP"}

topics JSON in Chrome

actuator health in Chrome

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/6e5668cfa0694943861c66ec8c141646
Open in Devin Desktop: https://app.devin.ai/desktop/session/6e5668cfa0694943861c66ec8c141646?variant=devin
Requested by: @clivingston-cognition


Note

Devin errored when opening this Pull Request as clivingston-cognition.
As a fallback, Devin opened this PR as itself.

devin-ai-integration Bot and others added 19 commits September 3, 2026 18:34
…nd an executable jar is produced

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
…ternal quote service is unreachable

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
…dd spring-boot-starter-actuator for health checks

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
…apper) with varargs form for Spring Framework 7

Co-Authored-By: Chris Livingston <chris.livingston@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Author

Runtime test of Spring Boot 4.1.1 / Java 17 upgrade

Built with JDK 17 (mvn -B clean verify passes) and ran the jar; exercised all endpoints via curl and Chrome (recorded).

Result: all endpoints work on 4.1.1. Startup banner shows (v4.1.1), H2 seed + varargs JdbcTemplate.query logs the two Josh customers, the quote fetch fails gracefully with a WARN only.

/topic in Chrome /actuator/health
topics health
Endpoint results
  • GET /topic → 3 topics; GET /topic/java → Core Java
  • POST/PUT/DELETE /topic/kotlin round trip → 200s, list back to 3
  • GET /?name=Devin → {"id":n,"content":"Hello, Devin!"}, id increments
  • /topic/sort, /topic/minimum/length/4, /topic/string/operation, /topic/file/operation, /datetime → 200
  • /actuator/health → {"status":"UP"}
  • Malformed JSON POST → 400; PUT nonexistent → 200 no-op; double DELETE → 200
  • GET /topic/{unknown} → 500 (findFirst().get() NoSuchElementException in TopicService.getTopicWithId) — pre-existing on master, not introduced by this PR

Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants