feature: console/namingserver: spring-boot upgrade to 4.0.6#8054
Open
xuxiaowei-com-cn wants to merge 38 commits into
Open
feature: console/namingserver: spring-boot upgrade to 4.0.6#8054xuxiaowei-com-cn wants to merge 38 commits into
xuxiaowei-com-cn wants to merge 38 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #8054 +/- ##
============================================
+ Coverage 72.81% 72.83% +0.02%
Complexity 1141 1141
============================================
Files 1151 1151
Lines 42272 42272
Branches 5045 5045
============================================
+ Hits 30781 30790 +9
+ Misses 9013 9008 -5
+ Partials 2478 2474 -4 🚀 New features to boost your workflow:
|
b13848a to
08445e9
Compare
de2a3ce to
7677556
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the server / console / namingserver modules to newer Spring Boot / Spring Framework generations and adjusts affected code (Jakarta annotations, Spring Boot API package moves, and related test infrastructure) to keep these modules compiling and running under the newer stack.
Changes:
- Bump Spring Boot / Spring Framework versions in module POMs and update affected imports/APIs (e.g.,
ServerProperties,WebServerInitializedEvent,javax.annotation→jakarta.annotation). - Update Redis/Jedis pooling abstractions and Redis-related tests to match newer Jedis APIs.
- Update test infrastructure for the new Spring stack (e.g.,
@MockBean→@MockitoBean, MockMvc test artifact changes), plus minor CI adjustments.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/test/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManagerTest.java | Updates Redis sorted-set query result types in tests. |
| server/src/test/java/org/apache/seata/server/storage/redis/JedisPooledFactoryTest.java | Updates pool abstraction usage in Jedis pool tests. |
| server/src/test/java/org/apache/seata/server/session/redis/RedisQueryConsolTest.java | Migrates @Resource import to jakarta.annotation. |
| server/src/test/java/org/apache/seata/server/session/FileSessionManagerTest.java | Migrates @Resource import to jakarta.annotation. |
| server/src/test/java/org/apache/seata/server/logging/AppenderTest.java | Modifies Logback context access and disables the test method. |
| server/src/test/java/org/apache/seata/server/lock/LockManagerTest.java | Migrates @Resource import to jakarta.annotation. |
| server/src/test/java/org/apache/seata/server/instance/RaftServerInstanceStrategyTest.java | Updates ServerProperties import for newer Spring Boot. |
| server/src/test/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImplTest.java | Replaces @MockBean with @MockitoBean. |
| server/src/test/java/org/apache/seata/server/console/impl/db/GlobalLockDBServiceImplTest.java | Replaces @MockBean with @MockitoBean. |
| server/src/test/java/org/apache/seata/server/console/impl/db/BranchSessionDBServiceImplTest.java | Replaces @MockBean with @MockitoBean. |
| server/src/test/java/org/apache/seata/server/LoaderConfTest.java | Minor assertion style adjustment (static assertEquals). |
| server/src/main/java/org/apache/seata/server/storage/redis/store/RedisTransactionStoreManager.java | Updates Redis sorted-set query result types for newer Jedis APIs. |
| server/src/main/java/org/apache/seata/server/storage/redis/JedisPooledFactory.java | Switches Jedis pool type to Pool<Jedis> and updates factory signature. |
| server/src/main/java/org/apache/seata/server/instance/RaftServerInstanceStrategy.java | Migrates @Resource import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/instance/AbstractSeataInstanceStrategy.java | Migrates lifecycle/resource annotations to jakarta.annotation and updates ServerProperties import. |
| server/src/main/java/org/apache/seata/server/controller/ClusterController.java | Migrates @Resource import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/console/impl/db/GlobalSessionDBServiceImpl.java | Migrates @Resource import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/console/controller/GlobalSessionController.java | Migrates @Resource import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/console/controller/GlobalLockController.java | Migrates @Resource import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/console/controller/BranchSessionController.java | Migrates @Resource import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/config/ServerConfig.java | Updates ServerProperties import for newer Spring Boot. |
| server/src/main/java/org/apache/seata/server/cluster/raft/context/SeataClusterContext.java | Migrates nullability annotations to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/cluster/manager/ClusterWatcherManager.java | Migrates @PostConstruct import to jakarta.annotation. |
| server/src/main/java/org/apache/seata/server/ServerRunner.java | Migrates @Resource and updates WebServerInitializedEvent import. |
| server/src/main/java/org/apache/seata/server/Server.java | Migrates @Resource import to jakarta.annotation. |
| server/pom.xml | Upgrades Spring Boot / Framework versions and adds a Spring Boot web-server dependency. |
| namingserver/src/test/java/org/apache/seata/namingserver/AuthControllerWithRandomPasswordTest.java | Updates MockMvc auto-config import and ObjectMapper package. |
| namingserver/src/test/java/org/apache/seata/namingserver/AuthControllerWithCustomPropertiesTest.java | Updates MockMvc auto-config import and ObjectMapper package. |
| namingserver/src/main/java/org/apache/seata/namingserver/service/ConsoleLocalServiceImpl.java | Switches ObjectMapper package and simplifies namespace serialization logic. |
| namingserver/src/main/java/org/apache/seata/namingserver/config/WebConfig.java | Replaces OkHttp-based RestTemplate factory with JDK HttpClient-based factory. |
| namingserver/pom.xml | Upgrades Spring Boot / Framework versions and adds webmvc-test dependency (test scope). |
| console/src/main/java/org/apache/seata/mcp/tools/NameSpaceTools.java | Switches to Jackson 3 (tools.jackson) and removes JSON parse exception handling. |
| console/src/main/java/org/apache/seata/mcp/tools/GlobalSessionTools.java | Switches to Jackson 3 (tools.jackson) and removes JSON parse exception handling. |
| console/src/main/java/org/apache/seata/mcp/tools/GlobalLockTools.java | Switches to Jackson 3 (tools.jackson) and removes JSON parse exception handling. |
| console/src/main/java/org/apache/seata/mcp/service/impl/ConsoleRemoteServiceImpl.java | Switches ObjectMapper import to Jackson 3 (tools.jackson). |
| console/src/main/java/org/apache/seata/mcp/core/utils/UrlUtils.java | Switches Jackson imports to Jackson 3 (tools.jackson). |
| console/src/main/java/org/apache/seata/console/config/WebSecurityConfig.java | Updates Security matcher construction for newer Spring Security APIs. |
| console/src/main/java/org/apache/seata/console/config/JacksonConfig.java | Replaces Jackson2 builder customizer with a Jackson 3 SimpleModule serializer. |
| console/pom.xml | Upgrades Spring Boot / Framework versions and bumps Tomcat embed version. |
| changes/zh-cn/2.x.md | Adds changelog entry for this upgrade. |
| changes/en-us/2.x.md | Adds changelog entry for this upgrade. |
| .github/workflows/build.yml | Excludes server from the Java 8 job build list. |
Comments suppressed due to low confidence (1)
server/pom.xml:108
- With the Spring Boot 4 / Spring Framework 7 upgrade in this module, the server should be consistently on the
jakarta.*servlet APIs.server/pom.xmlstill declares a dependency onjavax.servlet:javax.servlet-api(later in the dependencies list), which will conflict with the Jakarta-based web stack and can lead to compilation/type-mismatch issues. Please switch the servlet API dependency to the appropriatejakarta.servletartifact (or remove it if it’s no longer needed).
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-web-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
…ix objectMapper.readValue
…ix objectMapper.readTree
…ix objectMapper.writeValueAsString
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md # console/pom.xml # namingserver/pom.xml
# Conflicts: # changes/en-us/2.x.md # changes/zh-cn/2.x.md
Contributor
Author
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+97
to
99
| } catch (JacksonException e) { | ||
| logger.error(e.getMessage()); | ||
| } |
Comment on lines
+182
to
185
| } catch (JacksonException e) { | ||
| LOGGER.error("Get NameSpace failed: {}", e.getMessage()); | ||
| return "Failed to get namespace"; | ||
| } |
Comment on lines
103
to
+107
| String result = mcpRPCService.getCallTC( | ||
| nameSpaceDetail, RPCConstant.GLOBAL_SESSION_BASE_URL + "/query", param, null, null); | ||
| try { | ||
| pageResult = objectMapper.readValue(result, new TypeReference<PageResult<McpGlobalSessionVO>>() {}); | ||
| } catch (JsonProcessingException e) { | ||
| } catch (JacksonException e) { |
Comment on lines
93
to
+97
| String response = mcpRPCService.getCallTC( | ||
| nameSpaceDetail, RPCConstant.GLOBAL_LOCK_BASE_URL + "/query", param, null, null); | ||
| try { | ||
| result = objectMapper.readValue(response, new TypeReference<PageResult<McpGlobalLockVO>>() {}); | ||
| } catch (JsonProcessingException e) { | ||
| } catch (JacksonException e) { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
https://github.com/redis/jedis/blob/master/docs/migration-guides/v3-to-v4.md
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
#8053
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews