8000 Initial commit of Camel 3/4 upgrade rules - add stepwise upgrade rules by cunningt · Pull Request #935 · windup/windup-rulesets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Initial commit of Camel 3/4 upgrade rules - add stepwise upgrade rules #935

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
merged 7 commits into from
Jun 1, 2023

Conversation

cunningt
Copy link
Contributor

Hi! I'd like to add some camel upgrade rules to help users upgrade to various different camel versions between 3 and 4.

Camel has upgrade guides for each minor version between 3 and 4 -- https://camel.apache.org/manual/camel-3x-upgrade-guide.html - I've tried to create rules based on the information contained in these guides. The rules are a best effort at matching the changes based on severity and on importance in migration - they aren't complete with every change talked about in the guides but we will try to add more.

Additionally, a first effort at Camel 4 migration is included based on https://camel.apache.org/manual/camel-4-migration-guide.html. Camel 4 is not final yet, and I do not think the migration steps are final either, so the guide may change and we will try to add / change rules based on changes.

@cunningt cunningt changed the title Initial commit of Camel 3/4 upgrade rules - add stepwise upgrade rule… Initial commit of Camel 3/4 upgrade rules - add stepwise upgrade rules Apr 28, 2023
@cunningt cunningt force-pushed the camelupgraderulesets branch 2 times, most recently from 2511be3 to c1b6fa8 Compare May 1, 2023 12:43
@PhilipCattanach
Copy link
Contributor

@cunningt Thanks so much for your contribution Tom.
I appreciate that this PR is a work in progress. But I'll review it and provide some feedback.
What are the timescales for Camel 4 as I would like to raise the profile of this ruleset within the Migration Toolkit.

@cunningt
Copy link
Contributor Author
cunningt commented May 3, 2023

Hi @PhilipCattanach - https://camel.apache.org/blog/2023/01/camel4roadmap/ shows the roadmap for Camel 4 - there's a vote going on right now for the third milestone release which will probably be this week. If the schedule posted is correct, 4.0 probably is released in a May/June timeframe.

@PhilipCattanach
Copy link
Contributor

@cunningt - Just some feedback on camel3/camel2/xml-31-changes.windup.xml
The ruleset filename, ruleset id, rule ids, description, sourceTechnology and targetTechnology are all spot on and intuitive.

When dealing with Java classes Windup is far, far more efficient when executing rules that use the javaclass references when criteria. Rather than the filecontent pattern= , filename={*}.java

Rule: classes-removed-camel31-00001
Please use javaclass references when criteria
The title of the link is
Camel 3 - Migration Guide: Spring Boot Starters
I would suggest
UPGRADING CAMEL 3.0 TO 3.1
As per the heading in the Migration Guide.

Rule: xml-removed-camel31-00001
I would suggest the link URL should be more specific
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_1.html#_camel_core_engine_and_camel_jaxp
And the link title
CAMEL-CORE-ENGINE and CAMEL-JAXP

Rule:xml-removed-camel31-00002
I would suggest the link URL should be more specific
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_1.html#_spring_boot_jmx
And the link title
SPRING BOOT JMX

Rule:xml-moved-camel31-00001
Please use javaclass references when criteria
I would suggest the link URL should be more specific
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_1.html#_cookies
And the link title
COOKIES

Rule:xml-moved-camel31-00002
Please use javaclass references when criteria
I would suggest the link URL should be more specific
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_1.html#_jsonschemahelper_removed
And the link title
JSONSCHEMAHELPER REMOVED

Rule:xml-moved-camel31-00002
Please use javaclass references when criteria
I would suggest the link URL should be more specific
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_1.html#_jsonschemahelper_removed
And the link title
JSONSCHEMAHELPER REMOVED

Rule:xml-moved-camel31-00003
Please use javaclass references when criteria
I would suggest the link URL should be more specific
https://camel.apache.org/manual/camel-3x-upgrade-guide-3_1.html#_camel_xml_jaxp
And the link title
CAMEL-XML-JAXP

All windup.xml rules files need a corresponding windup.text.xml in the tests sub-folder.
All tests need a data sub-folder containing the java classes, properties files, etc. that will cause the rules to fire.

@cunningt cunningt force-pushed the camelupgraderulesets branch from c1b6fa8 to 9ff0c13 Compare May 4, 2023 13:14
@cunningt
Copy link
Contributor Author
cunningt commented May 4, 2023

@PhilipCattanach Thank you! I've gone ahead and changed all of the filecontent looking for *.java -> javaclass and changed all of the links to include the respective anchors to make them more specific. I'm working through creating the required test elements and it will probably take me a day or two more to supply them.

The one question I have is on the link titles - I'd like to keep the link titles in a somewhat consistent format with the already-existing migration rules existing for camel 2-> 3 because I can see scenarios where someone wants to upgrade from Camel 2-> Camel 4, and I tried to mirror that (see : https://github.com/windup/windup-rulesets/blob/master/rules/rules-reviewed/camel3/camel2/component-changes.windup.xml#L36 for an example). Are the upper case link titles necessary?

@PhilipCattanach
Copy link
Contributor

Hi @cunningt
I suggested the uppercase titles just to be consistent with the the linked page.
As you say keeping them consistent with the existing Camel rules is the right thing to do, and they will look better TBH.
Thanks again for the workk you are doing on these rules. It is very much appreciated.

@cunningt
Copy link
Contributor Author
cunningt commented May 6, 2023

Added windup.test.xml for each windup.xml, tests for every rule, and data subfolders including .java / .properties / pom.xml files that will cause the rules to fire. Tested each rules file separately (example : mvn -DrunTestsMatching=xml-40-changes test), and all tests are passing locally.

@PhilipCattanach
Copy link
Contributor

@cunningt - Thanks so much for this substantive contribution to Windup. Awesome!
Leave it with us to review it, provide feedback and hopefully get it merged to master. I also want to make some changes to our Web Ui application to raise the profile of this new migration target.

@jmle jmle self-requested a review May 18, 2023 09:25
@jmle
Copy link
Contributor
jmle commented May 18, 2023

@cunningt thanks for the contribution! Regarding naming, it would be good if you could make a couple changes so that it fits a bit more with the conventions that we generally use:

  • File names: I see that the naming pattern you used was xml-(version)-changes.windup(.test)?.xml. We usually mention the technology itself in the filename, and it's implied that if there is a migration going on, there will be changes, so maybe something like camel-(version).windup(.test)?.xml` could be better (also, no need to specify that the rules are in XML format, since the file format already defines that).
  • Rule names: we usually use the first part of the name of the file plus a 5 digit number, which increases with every rule. For the tests, the same, but appending test at the end. There are many examples of this, you can take a look at the hibernate6.windup.xml rule and its tests for instance.

Copy link
Contributor
@jmle jmle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cunningt, I have done a preliminary review. There are quite a few general things that need to be changed, in case you want to start with those. I'll take a look again when you go through these 👍

@cunningt cunningt requested a review from jmle May 23, 2023 02:07
Copy link
Contributor
@jmle jmle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cunningt looks good, I have just left a couple of comments and questions, mostly:

  • Property rules (filecontent) can be simplified to enhance performance
  • Wondering about some 7-pointers - you are the subject matter expert, so I'll leave it to you, I was just wondering if some of those rules really require a rearchitecture.

8000
@jmle jmle merged commit e37e134 into windup:master Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0