-
Notifications
You must be signed in to change notification settings - Fork 15
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
Replace block executor registry with dependency injection #532
Merged
Conversation
This file contains 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
georg-schwarz
changed the title
Replace block executor registry by dependency injection
Replace block executor registry with dependency injection
Feb 16, 2024
georg-schwarz
commented
Feb 16, 2024
joluj
approved these changes
Feb 16, 2024
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.
The circular dependencies can lead to problems. However, I could find a better way.
I've found these circular dependencies. Some of these were not introduced by this PR.
$ npx madge --circular --extensions ts ./
Processed 72 files (422ms) (25 warnings)
✖ Found 10 circular dependencies!
1) src/lib/debugging/debug-configuration.ts > src/lib/execution-context.ts
2) src/lib/blocks/block-executor-class.ts > src/lib/blocks/block-executor.ts > src/lib/debugging/debug-configuration.ts > src/lib/execution-context.ts > src/lib/extension.ts
3) src/lib/types/io-types/filesystem-node-file-binary.ts > src/lib/types/io-types/io-type-implementation.ts
4) src/lib/types/io-types/io-type-implementation.ts > src/lib/types/io-types/filesystem-node-file-text.ts
5) src/lib/types/io-types/io-type-implementation.ts > src/lib/types/io-types/filesystem.ts
6) src/lib/types/io-types/io-type-implementation.ts > src/lib/types/io-types/none.ts
7) src/lib/types/io-types/io-type-implementation.ts > src/lib/types/io-types/sheet.ts
8) src/lib/types/io-types/io-type-implementation.ts > src/lib/types/io-types/table.ts
9) src/lib/types/io-types/io-type-implementation.ts > src/lib/types/io-types/workbook.ts
10) src/lib/blocks/block-execution-util.ts > src/lib/blocks/block-executor-registry.ts > src/lib/blocks/composite-block-executor.ts
rhazn
approved these changes
Feb 21, 2024
georg-schwarz
commented
Mar 1, 2024
joluj
approved these changes
Mar 4, 2024
rhazn
approved these changes
Mar 4, 2024
rhazn
force-pushed
the
execution-remove-block-executor-registry
branch
from
March 4, 2024 09:33
b429e51
to
0cea216
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR solves an issue where the parallel execution of multiple Jayvee models led to side effects: an error by duplicate block executor registration.
Injecting the list of executors wrapped by a
JayveeExecExtension
to theExecutionContext
instead of the registry should solve that issue.Additionally, the executors were registered for model parsing. I think this is not necessary anymore as their structure now comes from
jv
files instead, so we should only use executors when interpreting the model.The changes led to a weird trace of dependency cycles that I still struggle with. Let me know if you see an easy way to resolve this :)