Refactoring. Split interface/implementation for Shard/Workflow Context #7443
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.
What changed?
Main changes:
This effectively splits interface/implementation for both of those contexts.
Also again remove LOTS of dependencies. More to come.
Why?
Previous PR
Part of bigger refactoring efforts.
Goal is to reduce code entanglement, by separating interfaces and implementation, for some major components.
Currently, in lots of cases, interface and implementation are in a single file. This bloats the dependency graph, and introduce bad practices when dealing with "module cyclic dependency" error.
Nearest goal will be to split/move the following interfaces:
Once moving interfaces is complete:
add "GetOrCreateContext" to shard context. It will receive cache as a parameter
change s.workflowCache.GetOrCreateWorkflowExecution(s.hardContext, ...) to s.hardContext.GetOrCreateContext(...)
add "cache" to shard context ->IMPLEMENTATION<- (this is important - there is (I hope) no need to actually expose workflow cache from shard context)
remove cache as a parameter from GetOrCreateContext
remove workflwCacha wcache from all those structures/calles/etc, where it is "bundled" with
This will open the way to other improvements - introducing ServiceLocator and easier tests/code structure.
How did you test it?
Existing tests.
Potential risks
Can require changes in saas-temporal and CDS.
Is hotfix candidate?
No