-
Notifications
You must be signed in to change notification settings - Fork 89
Reusable Execution Context #792
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
Merged
fabapp2
merged 77 commits into
spring-projects-experimental:main
from
sanagaraj-pivotal:786-reusable-execution-context
May 26, 2023
Merged
Reusable Execution Context #792
fabapp2
merged 77 commits into
spring-projects-experimental:main
from
sanagaraj-pivotal:786-reusable-execution-context
May 26, 2023
Conversation
This file contains hidden or 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
- Learning: Recipe scope is not enough! The ExecutionContext might be required during condition evaluation too which happens outside of a recipe-run - Test would need improvement but sysout shows its working
. Reworking the TestProjectContext to build the context with real Spring beans
…ManagedDependencies
…uildFileRefactoring
…imalPomXml and OpenRewriteMavenBuildFile
…ojectContext and BuildFileResourceWrapper
…enciesChangedEventHandler
…enciesChangedEventHandler
…writeJavaSource and others
…writeRecipeJavaSearch
…lasses - ArchUnit test succeeds -> no ExecutionContext creations in main
…rsing - ExecutionContext in TestProjectContext is retrieved from ApplicationContext - SpringBeanProvider has a new method that allows passing replacements for beans - RewriteExecutionContext delegates to InMemoryExecutionContext now - Test resources are parsed one by one to not fail on first error
…can't be mocked anymore
…estProjectContext
1 task
fabapp2
added a commit
that referenced
this pull request
May 26, 2023
* It removes all programmatically created instances of ExecutionContext in main code. * The ExecutionContext is now a Spring bean with @ExecutionScope * execution scope and ends with a successful recipe run * TestProjectContext uses Spring and components scan now to create the ProjectConetxtInitializer * A new test helper ActionTest was created which allows testing actions that require the ExecutionContext that is now created together with beans to create a ProjectConetxtInitializer instance * The execution times of tests might have become even worse as potential too many beans are created when org.springframework.sbm is scanned * An ArchUnit test was introduced to flag invalid instance creations of any class implementing ExecutionContext. --------- Co-authored-by: Fabian Krüger <[email protected]> Co-authored-by: Fabian Krüger <[email protected]>
fabapp2
added a commit
that referenced
this pull request
May 26, 2023
* It removes all programmatically created instances of ExecutionContext in main code. * The ExecutionContext is now a Spring bean with @ExecutionScope * execution scope and ends with a successful recipe run * TestProjectContext uses Spring and components scan now to create the ProjectConetxtInitializer * A new test helper ActionTest was created which allows testing actions that require the ExecutionContext that is now created together with beans to create a ProjectConetxtInitializer instance * The execution times of tests might have become even worse as potential too many beans are created when org.springframework.sbm is scanned * An ArchUnit test was introduced to flag invalid instance creations of any class implementing ExecutionContext. --------- Co-authored-by: Fabian Krüger <[email protected]> Co-authored-by: Fabian Krüger <[email protected]>
25 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 includes some heavy refactoring.
ExecutionContext
in main code.ExecutionContext
is now a Spring bean with@ExecutionScope
ProjectConetxtInitializer
ActionTest
was created which allows testing actions that require theExecutionContext
that is now created together with beans to create aProjectConetxtInitializer
instanceorg.springframework.sbm
is scannedExecutionContext
.