Skip to content
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

optimize: spring boot compatible with file.conf and registry.conf (#6811) #6828

Open
wants to merge 13 commits into
base: 2.x
Choose a base branch
from

Conversation

lyl2008dsg
Copy link
Contributor

@lyl2008dsg lyl2008dsg commented Sep 7, 2024

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

This PR implements a new class SeataFileConfigurationProvider in the seata-spring-autoconfigure-core module. This change ensures that both seata-spring-boot-starter and seata-spring-autoconfigure-server can read legacy configuration files (file.conf and registry.conf), addressing an issue where users upgrading from Spring to Spring Boot would only have their configuration loaded, causing confusion.

Ⅱ. Does this pull request fix one issue?

fixed #6811

This PR addresses the issue where seata-spring-boot-starter fails to load file.conf and registry.conf when users upgrade from Spring to Spring Boot.

Ⅲ. Why don't you add test cases (unit test/integration test)?

org.apache.seata.spring.boot.autoconfigure.SeataCoreAutoConfigurationTest

Ⅳ. Describe how to verify it

  1. Use the seata-spring-boot-starter in a Spring Boot application.
  2. Ensure that configurations from file.conf and registry.conf are correctly loaded alongside configurations.
  3. Verify the behavior in both seata-spring-boot-starter and seata-spring-autoconfigure-server environments.

Ⅴ. Special notes for reviews

  • This change is backward-compatible and allows users upgrading from Spring to Spring Boot to continue using their legacy configuration files without disruption.
  • It would be helpful to review the relocation of SeataPropertiesLoader to the seata-spring-autoconfigure-core module, ensuring that legacy configuration files (file.conf and registry.conf) are still properly loaded in both seata-spring-boot-starter and seata-spring-autoconfigure-server environments. Additionally, please verify that this change maintains backward compatibility and ensures a smooth transition for users moving from Spring to Spring Boot.

@lyl2008dsg lyl2008dsg changed the title compatible with file.conf and registry.conf (#6811) spring 吧、oot compatible with file.conf and registry.conf (#6811) Sep 7, 2024
@lyl2008dsg lyl2008dsg changed the title spring 吧、oot compatible with file.conf and registry.conf (#6811) spring boot compatible with file.conf and registry.conf (#6811) Sep 7, 2024
Copy link

codecov bot commented Sep 8, 2024

Codecov Report

Attention: Patch coverage is 16.41791% with 56 lines in your changes missing coverage. Please review.

Project coverage is 51.75%. Comparing base (66bd3a4) to head (cda9a19).

Files with missing lines Patch % Lines
...n/java/org/apache/seata/common/store/LockMode.java 0.00% 16 Missing ⚠️
...ava/org/apache/seata/common/store/SessionMode.java 0.00% 16 Missing ⚠️
...ot/autoconfigure/loader/SeataPropertiesLoader.java 20.00% 12 Missing ⚠️
...org/apache/seata/server/session/SessionHolder.java 44.44% 4 Missing and 1 partial ⚠️
...he/seata/server/cluster/raft/RaftStateMachine.java 33.33% 2 Missing ⚠️
...e/seata/server/coordinator/DefaultCoordinator.java 33.33% 0 Missing and 2 partials ⚠️
...gure/provider/SpringBootConfigurationProvider.java 50.00% 0 Missing and 1 partial ⚠️
...ache/seata/server/coordinator/RaftCoordinator.java 0.00% 1 Missing ⚠️
...apache/seata/server/lock/LockerManagerFactory.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6828      +/-   ##
============================================
- Coverage     52.52%   51.75%   -0.78%     
+ Complexity     6542     6475      -67     
============================================
  Files          1122     1124       +2     
  Lines         39857    39865       +8     
  Branches       4668     4668              
============================================
- Hits          20936    20632     -304     
- Misses        16925    17270     +345     
+ Partials       1996     1963      -33     
Files with missing lines Coverage Δ
...e/seata/server/cluster/raft/RaftServerManager.java 86.13% <100.00%> (ø)
...org/apache/seata/server/session/SessionHelper.java 49.37% <ø> (ø)
...ava/org/apache/seata/server/store/StoreConfig.java 65.78% <ø> (-9.54%) ⬇️
...gure/provider/SpringBootConfigurationProvider.java 11.36% <50.00%> (+11.36%) ⬆️
...ache/seata/server/coordinator/RaftCoordinator.java 0.00% <0.00%> (ø)
...apache/seata/server/lock/LockerManagerFactory.java 84.21% <0.00%> (ø)
...he/seata/server/cluster/raft/RaftStateMachine.java 14.28% <33.33%> (-18.75%) ⬇️
...e/seata/server/coordinator/DefaultCoordinator.java 43.21% <33.33%> (-2.53%) ⬇️
...org/apache/seata/server/session/SessionHolder.java 52.63% <44.44%> (-1.32%) ⬇️
...ot/autoconfigure/loader/SeataPropertiesLoader.java 62.85% <20.00%> (ø)
... and 2 more

... and 34 files with indirect coverage changes

@funky-eyes funky-eyes changed the title spring boot compatible with file.conf and registry.conf (#6811) optimize: spring boot compatible with file.conf and registry.conf (#6811) Sep 9, 2024
@funky-eyes funky-eyes added this to the 2.3.0 milestone Sep 24, 2024
@lyl2008dsg lyl2008dsg closed this Oct 13, 2024
@lyl2008dsg lyl2008dsg reopened this Oct 13, 2024
@lyl2008dsg lyl2008dsg closed this Oct 13, 2024
@lyl2008dsg lyl2008dsg reopened this Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seata-spring-boot-starter compatible with file.conf and registry.conf configurations
3 participants