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

feature: saga-remove spring #6370

Merged
merged 9 commits into from
Feb 29, 2024

Conversation

wt-better
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Seata saga current is strong dependency on spring. such as:

  1. code was dependency spring beans (InitializingBean ..etc)
  2. expression evaluation dependency spring el
  3. spring bean service Task dependency spring ioc

This is not conducive to saga's multilanguage building, so I has decouple saga with spring.

  1. To ensure code compatibility, make new module named 'seata-saga-spring' and move related classes(not modified path) to this module.

  2. 'seata-saga-tm' has spring dependency, this module is not necessary. First I removed this module and move class to 'seata-saga-spring' , I will sink TM's core capabilities ‘seata-saga-engine’ module later pr.

  3. 'seata-saga-engine-store' remove the implementation of serialization and make it more pure

  4. 'seata-saga-rm' has class named StateMachineEngineHolder, i moved to ‘seata-saga-engine’ module, and package name change, it`s not compatible. why ? I think it is inner use, users rarely use it.

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code style need change

Comment on lines 50 to 54
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.seata.common.exception.FrameworkErrorCode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.apache.seata.common.exception.FrameworkErrorCode;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.seata.common.exception.FrameworkErrorCode;

Comment on lines 42 to 46

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.seata.common.exception.FrameworkErrorCode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.apache.seata.common.exception.FrameworkErrorCode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.seata.common.exception.FrameworkErrorCode;

Comment on lines 40 to 44

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import java.sql.DatabaseMetaData;
import java.sql.SQLException;

import org.apache.seata.common.ConfigurationKeys;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.apache.seata.common.ConfigurationKeys;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import org.apache.seata.common.ConfigurationKeys;

Comment on lines 31 to 32
import java.io.IOException;
import java.io.InputStream;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.io.IOException;
import java.io.InputStream;

*/
package org.apache.seata.saga.engine.impl;

import org.apache.seata.saga.engine.config.AbstractStateMachineConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.apache.seata.saga.engine.config.AbstractStateMachineConfig;
import java.io.IOException;
import java.io.InputStream;
import org.apache.seata.saga.engine.config.AbstractStateMachineConfig;

Comment on lines 26 to 29
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Map;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Map;

@@ -16,29 +16,27 @@
*/
package org.apache.seata.saga.statelang.parser;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.Map;

@funky-eyes funky-eyes added this to the 2.1.0 milestone Feb 28, 2024
@funky-eyes funky-eyes added type: feature Category issues or prs related to feature request. module/saga saga module labels Feb 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 5.55556% with 51 lines in your changes are missing coverage. Please review.

Project coverage is 51.06%. Comparing base (87b6e5f) to head (21822f0).
Report is 1 commits behind head on 2.x.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6370      +/-   ##
============================================
- Coverage     52.39%   51.06%   -1.33%     
- Complexity     5242     5262      +20     
============================================
  Files           924      934      +10     
  Lines         32068    33029     +961     
  Branches       3833     4002     +169     
============================================
+ Hits          16801    16866      +65     
- Misses        13611    14495     +884     
- Partials       1656     1668      +12     
Files Coverage Δ
...tion/tx/api/interceptor/InvocationHandlerType.java 100.00% <100.00%> (ø)
...aga/engine/expression/spel/SpringELExpression.java 0.00% <ø> (ø)
.../engine/invoker/impl/SpringBeanServiceInvoker.java 0.00% <ø> (ø)
...ga/engine/store/db/DbAndReportTcStateLogStore.java 0.00% <ø> (ø)
...g/apache/seata/saga/engine/utils/ResourceUtil.java 66.66% <100.00%> (ø)
...ser/impl/CompensateSubStateMachineStateParser.java 66.66% <ø> (ø)
...a/statelang/parser/impl/SubStateMachineParser.java 90.90% <ø> (ø)
...tatelang/parser/utils/DesignerJsonTransformer.java 54.65% <ø> (ø)
...boot/autoconfigure/SeataSagaAutoConfiguration.java 0.00% <0.00%> (ø)
...ga/engine/tm/DefaultSagaTransactionalTemplate.java 0.00% <0.00%> (ø)
... and 4 more

... and 9 files with indirect coverage changes

@wt-better
Copy link
Contributor Author

code style need change

i think not need change, history layout is not standard.

standard layout
image

seata-core etc .. other moudle also keep this layout

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes funky-eyes merged commit 709bd30 into apache:2.x Feb 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/saga saga module type: feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants