-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add migration tests and recipes for Spring Batch #686
Conversation
main - Add migration tests and recipes for Spring Batch Add tests and migration recipes to support Spring Batch 5 updates: - Implement `MigrateJobParameterToStringTest` to verify migration of `JobParameter.toString()` to `JobParameter.getValue().toString()`. - Implement `MigrateMethodAnnotatedByBatchAPITest` to test migration of methods annotated by Spring Batch API. - Add `MigrateJobParameterTest` to ensure job parameters are correctly parameterized. - Create `ConvertReceiveTypeWhenCallStepExecutionMethodTest` to test conversion of receive types in StepExecution method calls. Add corresponding migration recipes: - `JobParameterToString`: Migrate `JobParameter.toString()` to `JobParameter.getValue().toString()`. - `MigrateMethodAnnotatedByBatchAPI`: Update methods annotated by Spring Batch API. - `MigrateJobParameter`: Ensure job parameters are parameterized. - `ConvertReceiveTypeWhenCallStepExecutionMethod`: Convert receive types in StepExecution method calls. ```
Add new migration recipes to the Spring Batch 5.0 configuration: - ConvertReceiveTypeWhenCallStepExecutionMethod - JobParameterToString - MigrateJobParameter - MigrateMethodAnnotatedByBatchAPI These updates enhance the migration process by ensuring compatibility with the latest Spring Batch API changes.
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
src/testWithSpringBoot_3_0/java/org/openrewrite/java/spring/batch/MigrateJobParameterTest.java
Outdated
Show resolved
Hide resolved
...thSpringBoot_3_0/java/org/openrewrite/java/spring/batch/MigrateJobParameterToStringTest.java
Outdated
Show resolved
Hide resolved
...thSpringBoot_3_0/java/org/openrewrite/java/spring/batch/MigrateJobParameterToStringTest.java
Outdated
Show resolved
Hide resolved
...ingBoot_3_0/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPITest.java
Show resolved
Hide resolved
...ingBoot_3_0/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPITest.java
Outdated
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
...in/java/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethod.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPI.java
Outdated
Show resolved
Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Correct inconsistencies in the use of context parameters across Spring Batch migration recipes. Ensure uniformity by replacing `executionContext` with `ctx` where applicable. This change improves code readability and maintains consistency in method signatures, facilitating easier maintenance and understanding of the migration logic.
src/main/java/org/openrewrite/java/spring/batch/JobParameterToString.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/JobParameterToString.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateJobParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateJobParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateJobParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateJobParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateJobParameter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPI.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPI.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPI.java
Outdated
Show resolved
Hide resolved
hi @timtebeek , do you know why ci build failed ? I can build in my local with the latest commit. I check the log , most likely it is not relevant to the new recipe. |
It looks like this test failed in a way I hadn't see before 🤔
|
@timtebeek How to try rerun the CI. I push the fix commit. |
Thanks! I've triggered the CI builds again; that should only be an issue for your first contribution; after that they should start automatically. |
src/testWithSpringBoot_3_0/java/org/openrewrite/java/spring/batch/JobParameterToStringTest.java
Outdated
Show resolved
Hide resolved
Thanks @timtebeek . I saw your commit which helped me refine the code. I check the CI log info summary is below. I think it was irrelevant to this PR . Is it helpful if i sync the code with
Detail
|
Thanks for the ping @qwtfps ! I was out for a few days, but trying to catch up now. The latest failures now are:
|
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.
Great to see these! I've pushed some minor polish already, but need to find time to rework the missing types before we can confidently merge these recipes.
...ava/org/openrewrite/java/spring/batch/ConvertReceiveTypeWhenCallStepExecutionMethodTest.java
Outdated
Show resolved
Hide resolved
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.
Great to have these additional steps covered for Spring Batch; I hope they help you migrate there!
...ingBoot_3_0/java/org/openrewrite/java/spring/batch/MigrateMethodAnnotatedByBatchAPITest.java
Outdated
Show resolved
Hide resolved
…tch/MigrateMethodAnnotatedByBatchAPITest.java Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
What's changed?
Add corresponding migration recipes:
JobParameterToString
: MigrateJobParameter.toString()
toJobParameter.getValue().toString()
.MigrateMethodAnnotatedByBatchAPI
: Update methods annotated by Spring Batch API.MigrateJobParameter
: Ensure job parameters are parameterized.ConvertReceiveTypeWhenCallStepExecutionMethod
: Convert receive types in StepExecution method calls.What's your motivation?
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist