-
Notifications
You must be signed in to change notification settings - Fork 18
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
Recipes for camel-quarkus #46
Conversation
There are 4 minor TODOs in the PR, which does not affect functionality. |
My understanding is that your problem is with tests? If so, I think you should have different projects that you upgrade in separate modules.
As mentioned in the review, maybe let's separate the projects? Also let's make sure the release target of the update jar is 11?
Unfortunately not. They removed a feature that is critical to us. We discussed with the OpenRewrite team and we hope at some point they will reintroduce it. |
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.
Added some comments.
recipes/pom.xml
Outdated
@@ -13,7 +13,7 @@ | |||
<name>Quarkus Updates - Recipes</name> | |||
|
|||
<properties> | |||
<maven.compiler.release>11</maven.compiler.release> | |||
<maven.compiler.release>17</maven.compiler.release> |
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.
That won't fly. We need the jar to be compatible with Java 11 as you can upgrade a Java 11 project.
Would it be possible to move the tests to a separate module?
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.
If J11 is the only possible option, moving tests to a separate module is a solution, which allow us to use J17 for the tests.
I'll search for a guide in codestarts
(@ia3andy if you can share some thoughts on the separation, that would be helpful)
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.
temporary solution implemented
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 don't see how this relates to codestarts?
recipes/pom.xml
Outdated
<dependency> | ||
<groupId>org.apache.camel</groupId> | ||
<artifactId>camel-api</artifactId> | ||
<version>${camel.version}</version> |
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.
Shouldn't all the Camel dependencies be of scope test?
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.
We are referencing them in the recipes (like using *.class.getCanonicalName()
and similar). If we agree, that the camel dependencies have to stay in test scope only (which is probably the right decision), we will refactor recipes.
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.
fixed
Hi @gsmet ,
Once the (final/general) separation is prepared, the tests from the temporary project would be refactored to use the final solution. This approach would allow to keep recipes + coverage even before the separation is merged (which could take some time, from the glance at the code in codestarts) |
f15befd
to
a6e1eac
Compare
@gsmet we fixed all suggestions as asked. Currently the majority of tests is removed from thisPR
Is this solution ok? |
f4a173c
to
823f0a9
Compare
@@ -22,6 +22,15 @@ | |||
<rewrite-maven-plugin.version>4.46.0</rewrite-maven-plugin.version> | |||
<!-- for now, we don't know where to find compatibility information for the Gradle plugin --> | |||
<rewrite-gradle-plugin.version>5.40.6</rewrite-gradle-plugin.version> | |||
<!-- If version from rewrite-recipe-bom is used, error occures during testing -> |
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.
Weird behavior is happening if the version from BOM is used for rewrite-migrate-java
dependency. NoSuchMethod 'com.fasterxml.jackson.core.util.TextBuffer com.fasterxml.jackson.core.io.IOContext.constructReadConstrainedTextBuffer()'
is thrown during execution of the tests. I forced version to 1.16.0 which does not cause the error. TBH I'm not completely sure why this is happening, BOM should contain compatible versions.
6a0ddf6
to
e45e447
Compare
Small refactor is required |
76754ec
to
732c1c1
Compare
Result of the discussion on upstream chat: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Quarkus.20update.20tool.20.28non-core.29 All tests covering camel-quarkus migration recipes (and skipped execution in non-camel-quarkus projects) are located in I see a limitation of this solution: I think that PR could be merged (and squashed into 1 commit - I kept separated commits to make reviewing easier) @ia3andy FYI |
732c1c1
to
4379592
Compare
@@ -26,6 +26,13 @@ | |||
##### | |||
--- | |||
type: specs.openrewrite.org/v1beta/recipe | |||
name: custom |
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.
@JiriOndrusek is that normal?
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 forgot to write down a name which makes a sense - this was just my "custom" text, I'll fix it during tomorrow
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 added the correct text here
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.
@JiriOndrusek it's still the old text
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 believe at some point you have removed a commit or something, make sure that you have all your changes.
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.
Thanks good catch @ia3andy I renamed it, is it make okay now ?
@JiriOndrusek since we might have other extensions contributing java recipe, it would make sense to have a common package naming. something like |
I agree, I'll refactor the PR |
4379592
to
bc18937
Compare
I refactored the PR to use a package name |
@ia3andy thanks for the hints above. Now it is all fixed. |
I still see |
@ia3andy can you please take a look now? Thanks |
@gsmet could you check? I still see the org.apache packages |
9c56dba
to
d0d60e0
Compare
@ia3andy I think we are good now, could you please take a look ? thanks! |
88d608e
to
f61a48c
Compare
We are waiting for a change in Quarkus core to allow having yaml extension recipes. @svkcemk is on it. |
quarkusio/quarkus#35688 is the dependent PR |
f61a48c
to
e61b447
Compare
@ia3andy, @maxandersen I updated (and tested locally) the PR to reflect changes from quarkusio/quarkus#35910. All succeeded, therefore this PR can be merged. |
recipeList: | ||
- io.quarkus.updates.camel30.CamelQuarkusMigrationRecipe | ||
--- | ||
type: specs.openrewrite.org/v1beta/recipe |
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 found this change, which is probably not needed anymore - I will verify and remove it
e61b447
to
9a1f1d8
Compare
Problem is fixed. the only work to be done is to replace simple java recipes with the yaml ones |
@JiriOndrusek @svkcemk You did an amazing job in all this, thanks for your patience, it was a long journey, but I think having a standardized way for extensions to provide their recipes is awesome! |
9a1f1d8
to
2cfd8ed
Compare
@ia3andy I update PR to reference a yaml recipe from the test. As I thought, all the migrations contains some kind of logic a condition which can not be simulated by easy yaml recipes. Therefore I can not convert any java recipe to yaml. Here is a list with the majority of upgrades + explanation why it can not be done
|
2cfd8ed
to
56f6308
Compare
56f6308
to
3250b8c
Compare
Hi @ia3andy I refactored 3 places to use yaml instead of java recipes (properties, poms & change oftype) From my POV the one jave recipe with todo should be reported in here (or camel-quarkus) fir further investigation, I see an option, that the recipe is not meant for the use in yaml. As it is not documented and the code of the recipe looks differently then the one which works (changeType - works vs changePackage - does not work) |
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.
LGTM
Descripition:
PR introduces a recipe - org.apache.camel.quarkus.update.CamelQuarkusMigrationRecipe - which takes care of the whole camel-quarkus migration process. This main recipe registeres all other recipes via the constructor and
doNext
method. If the migrated project contains any camel-quarkus dependency, the child recipes are executed. There are 4 types of camel recipes so far:Java - recipes migrating java classes. Abstract parent of those recipes detects existence of camel-quarkus import and does nothing if there is no such import
Pom - maven recipes taking care of removed extensions (comments helping users to find replacement are created if possible)
Properties - simple recipe
Yaml - some transformation for YAML DSL feature from Camel
All migration cases are covered by JUnit tests.
Important features:
mvn test
Opened questions:
Limitations:
What do you think @gsmet , @maxandersen, @ia3andy