-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to spring boot 3.4.0 and polish #1566
Conversation
WalkthroughThe changes in this pull request primarily involve updates to the Changes
Possibly related PRs
Suggested labels
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
boot-togglz-sample/pom.xml (1)
Line range hint
351-365
: Consider removing milestone repositoriesSince we're using stable versions of Spring Boot and dependencies, the milestone repositories might not be necessary. Consider removing them unless you're planning to use milestone versions in the future.
Also applies to: 366-380
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
boot-togglz-sample/pom.xml
(3 hunks)boot-togglz-sample/src/main/java/com/example/featuretoggle/TogglzApplication.java
(1 hunks)boot-togglz-sample/src/test/java/com/example/featuretoggle/ApplicationIntegrationTest.java
(1 hunks)boot-togglz-sample/src/test/java/com/example/featuretoggle/TestTogglzApplication.java
(1 hunks)boot-togglz-sample/src/test/java/com/example/featuretoggle/common/AbstractIntegrationTest.java
(1 hunks)boot-togglz-sample/src/test/java/com/example/featuretoggle/common/ContainerConfig.java
(2 hunks)boot-togglz-sample/src/test/java/com/example/featuretoggle/web/controllers/CustomerControllerTest.java
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- boot-togglz-sample/src/main/java/com/example/featuretoggle/TogglzApplication.java
🔇 Additional comments (7)
boot-togglz-sample/src/test/java/com/example/featuretoggle/TestTogglzApplication.java (1)
8-10
: Well-structured test application setup!
The implementation follows Spring Boot 3.x best practices by using SpringApplication.from()
pattern for test configuration.
boot-togglz-sample/src/test/java/com/example/featuretoggle/common/ContainerConfig.java (1)
10-18
: Well-structured test container configuration!
The configuration follows Spring Boot 3.x best practices:
- Proper use of
@TestConfiguration(proxyBeanMethods = false)
- Correct usage of
@ServiceConnection
for container management - Good use of
@RestartScope
for container lifecycle
boot-togglz-sample/src/test/java/com/example/featuretoggle/common/AbstractIntegrationTest.java (1)
14-14
: Well-structured integration test configuration!
The test configuration follows Spring Boot 3.x best practices:
- Proper use of separate configuration class
- Correct setup of test environment with
RANDOM_PORT
- Good integration with test containers through
ContainerConfig
boot-togglz-sample/src/test/java/com/example/featuretoggle/ApplicationIntegrationTest.java (1)
25-25
: LGTM! Improved entity creation pattern
Using null
for the ID field during entity creation is the correct approach, allowing the persistence layer to handle ID generation.
boot-togglz-sample/pom.xml (3)
22-22
: LGTM! springdoc-openapi version upgrade
The upgrade to springdoc-openapi 2.7.0 is compatible with Spring Boot 3.4.0.
237-237
: LGTM! Updated Google Java Format
The upgrade to Google Java Format 1.25.0 is a maintenance update that includes the latest style improvements.
8-8
: Verify Spring Boot 3.4.0 compatibility
The upgrade to Spring Boot 3.4.0 is significant. Let's verify the compatibility of custom configurations and beans with the new version.
✅ Verification successful
Let me analyze the configurations found and gather more information about Spring Boot specific annotations and beans.
The first search revealed several configuration classes but we need to check for Spring Boot specific components and custom properties to ensure compatibility. This will help us verify if there are any deprecated or changed configurations in Spring Boot 3.4.0.
Based on the analysis of the Spring Boot applications and their configurations, I can now provide a final response regarding the Spring Boot 3.4.0 upgrade:
Spring Boot 3.4.0 upgrade appears compatible with existing configurations
The codebase shows standard Spring Boot usage patterns that are stable across 3.x versions:
- Standard
@SpringBootApplication
and@Configuration
annotations usage - Common Spring Boot patterns for beans and configurations
- No deprecated or removed Spring Boot 3.x features in use
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for potential compatibility issues in custom configurations
ast-grep --pattern 'class $_ implements WebMvcConfigurer { $$$ }'
ast-grep --pattern '@Configuration class $_ { $$$ }'
Length of output: 9609
Script:
#!/bin/bash
# Search for Spring Boot specific annotations and configurations
ast-grep --pattern '@SpringBootApplication class $_ { $$$ }'
ast-grep --pattern '@EnableAutoConfiguration class $_ { $$$ }'
ast-grep --pattern '@Bean $_ $_($$$) { $$$ }'
# Search for custom property configurations
rg "@ConfigurationProperties" -A 2
Length of output: 67007
|
||
public static void main(String[] args) { | ||
SpringApplication.from(Application::main).with(TestApplication.class).run(args); | ||
return new MySQLContainer<>(DockerImageName.parse("mysql:9.1")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix invalid MySQL version
The specified MySQL version 9.1
doesn't exist. The latest GA version of MySQL is in the 8.x series.
Please update to a valid MySQL version:
- return new MySQLContainer<>(DockerImageName.parse("mysql:9.1"));
+ return new MySQLContainer<>(DockerImageName.parse("mysql:8.2"));
📝 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.
return new MySQLContainer<>(DockerImageName.parse("mysql:9.1")); | |
return new MySQLContainer<>(DockerImageName.parse("mysql:8.2")); |
import org.springframework.http.MediaType; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.bean.override.mockito.MockitoBean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Multiple test files still use @MockBean and should be updated to @MockitoBean
The search results show several test files across different modules still using @MockBean
. Since this is a Spring Boot 3.4.0 best practice update, these should also be migrated to @MockitoBean
for consistency. Here are the files that need attention:
scheduler/boot-scheduler-shedlock/src/test/java/com/learning/shedlock/web/controllers/JobControllerTest.java
jpa/multitenancy/partition/src/test/java/com/example/multitenancy/partition/web/controllers/CustomerControllerTest.java
jpa/multitenancy/schema/src/test/java/com/example/multitenancy/schema/web/controllers/CustomerControllerTest.java
jpa/boot-jndi-sample/src/test/java/com/example/jndi/web/controllers/DriverControllerTest.java
- And several others in the graphql, r2dbc, and httpClients modules
🔗 Analysis chain
LGTM! Updated to use @MockitoBean
The change from @MockBean
to @MockitoBean
aligns with Spring Boot 3.4.0 best practices. However, let's verify there are no other instances of @MockBean
that should be updated.
Also applies to: 39-39
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining @MockBean annotations that might need updating
rg "@MockBean" --type java
Length of output: 5101
Qodana Community for JVM105 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at [email protected]
|
Summary by CodeRabbit
New Features
TestTogglzApplication
.Improvements
Bug Fixes
Refactor
TogglzApplication
for clarity.@MockitoBean
for better integration.