✨ Add Spring Boot 2.x to 3.0 migration rules#340
✨ Add Spring Boot 2.x to 3.0 migration rules#340dymurray wants to merge 1 commit intokonveyor:mainfrom
Conversation
This PR adds comprehensive rules to assist with migrating from Spring Boot 2.x to 3.0, addressing all 17 open issues with spring-boot-migration/3.0 label. ## New Rule Files Created - spring-boot-2.x-to-3.0-actuator.yaml (4 rules) - spring-boot-2.x-to-3.0-micrometer.yaml (4 rules) ## Rules Added to Existing Files ### Core Changes (spring-boot-2.x-to-3.0-core-changes.yaml) - 00040: Configuration properties migrator recommendation - 00050: Logging date format change (ISO-8601) - 00060: Jakarta EE 9+ requirement ### Web Application Changes (spring-boot-2.x-to-3.0-webapp-changes.yaml) - 00020: Jetty 11+ requirement - 00030: Path matching strategy changes - 00040: ErrorController implementation updates ### Security (spring-boot-2.x-to-3.0-security.yaml) - 00020: WebSecurityConfigurerAdapter removal - 00030: authorizeRequests() deprecated - 00040: Lambda DSL migration - 00050: @secured annotation review ### Session (spring-boot-2.x-to-3.0-session.yaml) - 00010: Spring Session 3.0 requirement - 00020: Configuration property review ### Datasource (spring-boot-2.x-to-3.0-datasource.yaml) - 00070: MySQL JDBC driver coordinates changed ### Dependencies (spring-boot-2.x-to-3.0-dependencies.yaml) - 00020: Spring Boot parent version check - 00021: Hazelcast 5.x requirement ## Issues Addressed Fixes konveyor#180, konveyor#181, konveyor#183, konveyor#184, konveyor#185, konveyor#186, konveyor#187, konveyor#188, konveyor#189, konveyor#190, konveyor#208, konveyor#215, konveyor#217, konveyor#218, konveyor#219, konveyor#227, konveyor#233 Signed-off-by: Dylan Murray <dymurray@redhat.com>
📝 WalkthroughWalkthroughA new documentation file summarizing Spring Boot 3.0 migration rule implementations. The document enumerates 17 addressed issues, identifies two new rule files created for Actuator and Micrometer migrations, and categorizes all new rules across eight implementation areas. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@SPRING_BOOT_MIGRATION_SUMMARY.md`:
- Around line 5-8: Change the absolute claim under the heading "## Issues
Addressed (17)" to a tentative phrasing; replace "All issues with the
`spring-boot-migration/3.0` label have been addressed:" with a softer statement
such as "This PR aims to address issues labeled `spring-boot-migration/3.0`:"
(or "Attempted to address...") so the document no longer asserts guaranteed
closure.
- Around line 9-27: The table uses abbreviated rule filenames (e.g.,
"dependencies.yaml", "security.yaml", "actuator.yaml", "micrometer.yaml");
update each entry to the full rule filenames used in the repo (e.g.,
"spring-boot-2.x-to-3.0-dependencies.yaml",
"spring-boot-2.x-to-3.0-security.yaml", "spring-boot-2.x-to-3.0-actuator.yaml",
"spring-boot-2.x-to-3.0-micrometer.yaml") for all affected rows (referenced by
Issue IDs like `#180`, `#181`, `#187`, `#188`, `#217`, `#218`, `#219`, etc.), ensuring the
full filenames replace the short names consistently across the table so there is
no ambiguity.
| ## Issues Addressed (17) | ||
|
|
||
| All issues with the `spring-boot-migration/3.0` label have been addressed: | ||
|
|
There was a problem hiding this comment.
Avoid absolute “all issues addressed” phrasing unless confirmed.
If issue closure isn’t guaranteed at doc time, consider softer wording like “This PR aims to address…” to prevent over-claiming.
Suggested tweak
-All issues with the `spring-boot-migration/3.0` label have been addressed:
+This PR aims to address all issues with the `spring-boot-migration/3.0` label:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Issues Addressed (17) | |
| All issues with the `spring-boot-migration/3.0` label have been addressed: | |
| ## Issues Addressed (17) | |
| This PR aims to address all issues with the `spring-boot-migration/3.0` label: | |
🤖 Prompt for AI Agents
In `@SPRING_BOOT_MIGRATION_SUMMARY.md` around lines 5 - 8, Change the absolute
claim under the heading "## Issues Addressed (17)" to a tentative phrasing;
replace "All issues with the `spring-boot-migration/3.0` label have been
addressed:" with a softer statement such as "This PR aims to address issues
labeled `spring-boot-migration/3.0`:" (or "Attempted to address...") so the
document no longer asserts guaranteed closure.
| | Issue | Title | Rule File | Rule ID(s) | | ||
| |-------|-------|-----------|------------| | ||
| | #180 | Dependency review | dependencies.yaml | 00020, 00021 | | ||
| | #181 | Spring Security 6.0 migration | security.yaml | 00020-00050 | | ||
| | #183 | Configuration properties migrator | core-changes.yaml | 00040 | | ||
| | #184 | JakartaEE requirements | core-changes.yaml | 00060 | | ||
| | #185 | Core changes | core-changes.yaml | 00040-00060 | | ||
| | #186 | Web application changes | webapp-changes.yaml | 00020-00040 | | ||
| | #187 | Actuator changes | actuator.yaml (new) | 00010-00040 | | ||
| | #188 | Micrometer and metrics changes | micrometer.yaml (new) | 00010-00040 | | ||
| | #189 | Spring Security changes | security.yaml | 00020-00050 | | ||
| | #190 | Session changes | session.yaml | 00010-00020 | | ||
| | #208 | Logging date format | core-changes.yaml | 00050 | | ||
| | #215 | Jetty | webapp-changes.yaml | 00020 | | ||
| | #217 | Micrometer deprecation | micrometer.yaml | 00010, 00030 | | ||
| | #218 | Tag providers migration | micrometer.yaml | 00010 | | ||
| | #219 | JvmInfoMetrics auto-config | micrometer.yaml | 00020 | | ||
| | #227 | MySQL JDBC Driver | datasource.yaml | 00070 | | ||
| | #233 | Gradle and Maven session | session.yaml | 00010-00020 | |
There was a problem hiding this comment.
Use full rule filenames for clarity and consistency.
The table lists shortened filenames (e.g., dependencies.yaml, security.yaml, actuator.yaml, micrometer.yaml), but the actual files appear to be spring-boot-2.x-to-3.0-*.yaml. Using the full filenames avoids ambiguity and aligns with the rest of the PR context.
Proposed edit
-| `#180` | Dependency review | dependencies.yaml | 00020, 00021 |
-| `#181` | Spring Security 6.0 migration | security.yaml | 00020-00050 |
-| `#183` | Configuration properties migrator | core-changes.yaml | 00040 |
-| `#184` | JakartaEE requirements | core-changes.yaml | 00060 |
-| `#185` | Core changes | core-changes.yaml | 00040-00060 |
-| `#186` | Web application changes | webapp-changes.yaml | 00020-00040 |
-| `#187` | Actuator changes | actuator.yaml (new) | 00010-00040 |
-| `#188` | Micrometer and metrics changes | micrometer.yaml (new) | 00010-00040 |
-| `#189` | Spring Security changes | security.yaml | 00020-00050 |
-| `#190` | Session changes | session.yaml | 00010-00020 |
-| `#208` | Logging date format | core-changes.yaml | 00050 |
-| `#215` | Jetty | webapp-changes.yaml | 00020 |
-| `#217` | Micrometer deprecation | micrometer.yaml | 00010, 00030 |
-| `#218` | Tag providers migration | micrometer.yaml | 00010 |
-| `#219` | JvmInfoMetrics auto-config | micrometer.yaml | 00020 |
-| `#227` | MySQL JDBC Driver | datasource.yaml | 00070 |
-| `#233` | Gradle and Maven session | session.yaml | 00010-00020 |
+| `#180` | Dependency review | spring-boot-2.x-to-3.0-dependencies.yaml | 00020, 00021 |
+| `#181` | Spring Security 6.0 migration | spring-boot-2.x-to-3.0-security.yaml | 00020-00050 |
+| `#183` | Configuration properties migrator | spring-boot-2.x-to-3.0-core-changes.yaml | 00040 |
+| `#184` | JakartaEE requirements | spring-boot-2.x-to-3.0-core-changes.yaml | 00060 |
+| `#185` | Core changes | spring-boot-2.x-to-3.0-core-changes.yaml | 00040-00060 |
+| `#186` | Web application changes | spring-boot-2.x-to-3.0-webapp-changes.yaml | 00020-00040 |
+| `#187` | Actuator changes | spring-boot-2.x-to-3.0-actuator.yaml (new) | 00010-00040 |
+| `#188` | Micrometer and metrics changes | spring-boot-2.x-to-3.0-micrometer.yaml (new) | 00010-00040 |
+| `#189` | Spring Security changes | spring-boot-2.x-to-3.0-security.yaml | 00020-00050 |
+| `#190` | Session changes | spring-boot-2.x-to-3.0-session.yaml | 00010-00020 |
+| `#208` | Logging date format | spring-boot-2.x-to-3.0-core-changes.yaml | 00050 |
+| `#215` | Jetty | spring-boot-2.x-to-3.0-webapp-changes.yaml | 00020 |
+| `#217` | Micrometer deprecation | spring-boot-2.x-to-3.0-micrometer.yaml | 00010, 00030 |
+| `#218` | Tag providers migration | spring-boot-2.x-to-3.0-micrometer.yaml | 00010 |
+| `#219` | JvmInfoMetrics auto-config | spring-boot-2.x-to-3.0-micrometer.yaml | 00020 |
+| `#227` | MySQL JDBC Driver | spring-boot-2.x-to-3.0-datasource.yaml | 00070 |
+| `#233` | Gradle and Maven session | spring-boot-2.x-to-3.0-session.yaml | 00010-00020 |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Issue | Title | Rule File | Rule ID(s) | | |
| |-------|-------|-----------|------------| | |
| | #180 | Dependency review | dependencies.yaml | 00020, 00021 | | |
| | #181 | Spring Security 6.0 migration | security.yaml | 00020-00050 | | |
| | #183 | Configuration properties migrator | core-changes.yaml | 00040 | | |
| | #184 | JakartaEE requirements | core-changes.yaml | 00060 | | |
| | #185 | Core changes | core-changes.yaml | 00040-00060 | | |
| | #186 | Web application changes | webapp-changes.yaml | 00020-00040 | | |
| | #187 | Actuator changes | actuator.yaml (new) | 00010-00040 | | |
| | #188 | Micrometer and metrics changes | micrometer.yaml (new) | 00010-00040 | | |
| | #189 | Spring Security changes | security.yaml | 00020-00050 | | |
| | #190 | Session changes | session.yaml | 00010-00020 | | |
| | #208 | Logging date format | core-changes.yaml | 00050 | | |
| | #215 | Jetty | webapp-changes.yaml | 00020 | | |
| | #217 | Micrometer deprecation | micrometer.yaml | 00010, 00030 | | |
| | #218 | Tag providers migration | micrometer.yaml | 00010 | | |
| | #219 | JvmInfoMetrics auto-config | micrometer.yaml | 00020 | | |
| | #227 | MySQL JDBC Driver | datasource.yaml | 00070 | | |
| | #233 | Gradle and Maven session | session.yaml | 00010-00020 | | |
| | Issue | Title | Rule File | Rule ID(s) | | |
| |-------|-------|-----------|------------| | |
| | `#180` | Dependency review | spring-boot-2.x-to-3.0-dependencies.yaml | 00020, 00021 | | |
| | `#181` | Spring Security 6.0 migration | spring-boot-2.x-to-3.0-security.yaml | 00020-00050 | | |
| | `#183` | Configuration properties migrator | spring-boot-2.x-to-3.0-core-changes.yaml | 00040 | | |
| | `#184` | JakartaEE requirements | spring-boot-2.x-to-3.0-core-changes.yaml | 00060 | | |
| | `#185` | Core changes | spring-boot-2.x-to-3.0-core-changes.yaml | 00040-00060 | | |
| | `#186` | Web application changes | spring-boot-2.x-to-3.0-webapp-changes.yaml | 00020-00040 | | |
| | `#187` | Actuator changes | spring-boot-2.x-to-3.0-actuator.yaml (new) | 00010-00040 | | |
| | `#188` | Micrometer and metrics changes | spring-boot-2.x-to-3.0-micrometer.yaml (new) | 00010-00040 | | |
| | `#189` | Spring Security changes | spring-boot-2.x-to-3.0-security.yaml | 00020-00050 | | |
| | `#190` | Session changes | spring-boot-2.x-to-3.0-session.yaml | 00010-00020 | | |
| | `#208` | Logging date format | spring-boot-2.x-to-3.0-core-changes.yaml | 00050 | | |
| | `#215` | Jetty | spring-boot-2.x-to-3.0-webapp-changes.yaml | 00020 | | |
| | `#217` | Micrometer deprecation | spring-boot-2.x-to-3.0-micrometer.yaml | 00010, 00030 | | |
| | `#218` | Tag providers migration | spring-boot-2.x-to-3.0-micrometer.yaml | 00010 | | |
| | `#219` | JvmInfoMetrics auto-config | spring-boot-2.x-to-3.0-micrometer.yaml | 00020 | | |
| | `#227` | MySQL JDBC Driver | spring-boot-2.x-to-3.0-datasource.yaml | 00070 | | |
| | `#233` | Gradle and Maven session | spring-boot-2.x-to-3.0-session.yaml | 00010-00020 | |
🤖 Prompt for AI Agents
In `@SPRING_BOOT_MIGRATION_SUMMARY.md` around lines 9 - 27, The table uses
abbreviated rule filenames (e.g., "dependencies.yaml", "security.yaml",
"actuator.yaml", "micrometer.yaml"); update each entry to the full rule
filenames used in the repo (e.g., "spring-boot-2.x-to-3.0-dependencies.yaml",
"spring-boot-2.x-to-3.0-security.yaml", "spring-boot-2.x-to-3.0-actuator.yaml",
"spring-boot-2.x-to-3.0-micrometer.yaml") for all affected rows (referenced by
Issue IDs like `#180`, `#181`, `#187`, `#188`, `#217`, `#218`, `#219`, etc.), ensuring the
full filenames replace the short names consistently across the table so there is
no ambiguity.
| or: | ||
| - builtin.filecontent: | ||
| pattern: "management.endpoints.jmx.exposure" | ||
| filePattern: "application*.properties" |
There was a problem hiding this comment.
I would say let's change this filePattern and the one right below to .*\.properties (we also need to escape the dot)
| url: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#actuator-changes | ||
|
|
||
| - ruleID: spring-boot-2.x-to-3.0-actuator-00020 | ||
| category: mandatory |
There was a problem hiding this comment.
This would be potential according to the title
| management.endpoint.health.group.custom.include=customHealthIndicator | ||
| management.endpoint.health.group.custom.show-details=always | ||
| ``` | ||
| links: |
There was a problem hiding this comment.
Missing the migration guide link here
| location: IMPLEMENTS_TYPE | ||
| - java.referenced: | ||
| pattern: org.springframework.boot.actuate.health.AbstractHealthIndicator | ||
| description: HealthIndicator implementation updates for Spring Boot 3.0 |
There was a problem hiding this comment.
This is the only mention I find of the health indicator in the guide, but it's related to MongoDB... Wondering if this is right? Could you double check?
There was a problem hiding this comment.
Yeah it looks like this was hallucination, thinking I should remove
| when: | ||
| builtin.filecontent: | ||
| pattern: "management.server.base-path" | ||
| filePattern: "application*.properties" |
There was a problem hiding this comment.
Change pattern, similar to previous comment
| - Better integration with distributed tracing | ||
| links: | ||
| - title: 'Micrometer Observation' | ||
| url: https://micrometer.io/docs/observation |
| link: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#saml2-relying-party-configuration No newline at end of file | ||
| url: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#saml2-relying-party-configuration | ||
|
|
||
| - ruleID: spring-boot-2.x-to-3.0-security-00020 |
There was a problem hiding this comment.
All these new rules in this file belong in the Spring Framework 5 to 6 path, not here
| description: Jetty must be upgraded to version 11+ for Spring Boot 3.0 | ||
| message: | | ||
| Spring Boot 3.0 requires Jetty 11 or later. Jetty 11 is the first version to support | ||
| Jakarta EE 9 (Servlet 5.0 API with `jakarta.servlet` namespace). |
There was a problem hiding this comment.
Wondering where this came from? This is what the migration guide says:
Jetty does not yet support Servlet 6.0. To use Jetty with Spring Boot 3.0, you will have to downgrade the Servlet API to 5.0. You can use the jakarta-servlet.version property to do so.
There was a problem hiding this comment.
Looking online it appears that Jetty 11 is the suggested version for 3.0. I don't know if this is a hard and fast rule or not.
| filePattern: "application*.properties" | ||
| - builtin.filecontent: | ||
| pattern: "pathmatch" | ||
| filePattern: "application*.yml" |
There was a problem hiding this comment.
Again, we need to fix the filePattern fields above with .*\.properties. We also need to add both yml and yaml, or use a regex there (I guess y[a]*ml should work?)
| java.referenced: | ||
| pattern: org.springframework.boot.web.servlet.error.ErrorController | ||
| location: IMPLEMENTS_TYPE | ||
| description: ErrorController implementations may need updates |
There was a problem hiding this comment.
I'm trying to find where this comes from, but can't find it in the guide...
This PR adds comprehensive rules to assist with migrating from Spring Boot 2.x to 3.0, addressing all 17 open issues with spring-boot-migration/3.0 label.
New Rule Files Created
Rules Added to Existing Files
Core Changes (spring-boot-2.x-to-3.0-core-changes.yaml)
Web Application Changes (spring-boot-2.x-to-3.0-webapp-changes.yaml)
Security (spring-boot-2.x-to-3.0-security.yaml)
Session (spring-boot-2.x-to-3.0-session.yaml)
Datasource (spring-boot-2.x-to-3.0-datasource.yaml)
Dependencies (spring-boot-2.x-to-3.0-dependencies.yaml)
Issues Addressed
Fixes #180, #181, #183, #184, #185, #186, #187, #188, #189, #190, #208, #215, #217, #218, #219, #227, #233
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.