-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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 #6017
Conversation
...engine/src/main/java/io/seata/saga/engine/pcext/interceptors/LoopTaskHandlerInterceptor.java
Outdated
Show resolved
Hide resolved
} else { | ||
elContext = context.getVariables(); | ||
elContext = context.getVariable(DomainConstants.VAR_NAME_OUTPUT_PARAMS); |
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.
需要测试下这里是否兼容
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## 2.x #6017 +/- ##
============================================
- Coverage 49.56% 48.70% -0.87%
- Complexity 4748 4762 +14
============================================
Files 907 914 +7
Lines 31284 31857 +573
Branches 3770 3862 +92
============================================
+ Hits 15506 15515 +9
- Misses 14246 14811 +565
+ Partials 1532 1531 -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.
I think @wt-better have done a really fantastic refactoring job! The changes are HHHUGE though ;)
@@ -373,4 +372,22 @@ public static boolean hasUpperCase(String str) { | |||
return false; | |||
} | |||
|
|||
public static boolean hasText(String str) { |
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.
I think hasText
and containsText
are redundant, as it completely identical to isNotBlank
.
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.
this named with history spring naming, for less change. It can also be changed to ‘ containsText’
/** | ||
* Init StateLogStore by subClass | ||
* | ||
* @return StateLogStore | ||
*/ | ||
public abstract StateLangStore initStateLogStoreStore() throws Exception; | ||
|
||
/** | ||
* Init StateLogStore by subClass | ||
* | ||
* @return StateLogStore | ||
*/ | ||
public abstract StateLogStore initStateLogStore() throws Exception; | ||
|
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.
I dont get the point of having these two abstract methods. I see the only implementation to these two methods merely return null.
P.S., there is a typo. Should change initStateLogStoreStore
to initStateLangStore
in method signature and code comments
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.
This is redundant
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.
I see we remove seata-saga-engine-store module, and replace it to seata-saga-engine/store/db. I'd like to know the underlying reasons.
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.
- seata-saga-engine-store module was engine strongly relevant.
- less module can reduce complexity
@@ -15,6 +15,7 @@ | |||
*/ | |||
package io.seata.saga.engine.pcext.handlers; | |||
|
|||
import io.seata.common.util.StringUtils; |
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.
This import is misplaced.
@@ -15,6 +15,7 @@ | |||
*/ | |||
package io.seata.saga.engine.pcext.interceptors; | |||
|
|||
import io.seata.saga.engine.pcext.handlers.ServiceTaskStateHandler; |
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.
There are more misplaced imports, please check.
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.
It looks like this file is copied from spring-framework, right? I wonder if there is a copyright issue.
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.
this was fixed to jre uuid
@@ -52,14 +50,13 @@ public void testParser() throws IOException { | |||
System.out.println(fastjsonOutputJson); | |||
|
|||
Assertions.assertEquals("simpleTestStateMachine", stateMachine.getName()); | |||
Assertions.assertTrue(stateMachine.getStates().size() > 0); | |||
Assertions.assertFalse(stateMachine.getStates().isEmpty()); |
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.
I think we should avoid these non-related changes so to reduce CR complexity
…ring # Conflicts: # common/src/main/java/io/seata/common/util/StringUtils.java # saga/seata-saga-engine-store/pom.xml # saga/seata-saga-engine/src/main/java/io/seata/saga/engine/config/AbstractStateMachineConfig.java # saga/seata-saga-engine/src/main/java/io/seata/saga/engine/repo/StateMachineRepository.java # saga/seata-saga-engine/src/main/java/io/seata/saga/engine/store/db/DbStateLogStore.java # saga/seata-saga-spring/src/test/java/io/seata/saga/util/ResourceUtilTests.java # saga/seata-saga-statelang/src/test/java/io/seata/saga/statelang/parser/StateParserTests.java # saga/seata-saga-tm/pom.xml # test/src/test/resources/saga/spring/statemachine_engine_db_mockserver_test.xml # test/src/test/resources/saga/spring/statemachine_engine_db_test.xml # test/src/test/resources/saga/spring/statemachine_engine_test.xml
Ⅰ. Describe what this PR did
Seata saga current is strong dependency on spring. such as:
This is not conducive to saga's multilanguage building, so I has decouple saga with spring.
To ensure code compatibility, make new module named 'seata-saga-spring' and move related classes(not modified path) to this module.
'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.
'seata-saga-engine-store' was removed, because It is the core function of the engine ,should not be separated.
'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.so the architecture will be:
history architecture was: