-
Notifications
You must be signed in to change notification settings - Fork 74
check java version for azure #957
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
check java version for azure #957
Conversation
@PhilipCattanach Hi Philip, in this commit I encountered a issue of xmlfile match not working. I also tested many other xmlfile matching patterns but all didn't work. Could you help me with this issue? Thank you! |
Hi @KaiqianYang |
…/KaiqianYang/windup-rulesets into KaiqianYang-add-java-version-check-for-azure
Created https://issues.redhat.com/browse/WINDUPRULE-995 to manage this change |
…ersion-check-for-azure Philipcattanach add java version check for azure
Hi @PhilipCattanach , thanks for your help! I've merged your commit into this pr. Based on your version, I made an update to further simplify the rule pattern by utilizing windup:matches(). Manual test results are now as expected. I noticed that a key change you introduced was using Additionally, is including Thank you. |
@KaiqianYang - thanks for the feedback. I'll take another look. I may have made a mistake. |
@KaiqianYang - I'll ask one of my Engineers to get involved as their technical skills are so much better than my own. Hi @jmle Can I ask you to review this PR please. I have tried to help but my technical skills have been found wanting. |
Hey @KaiqianYang, the Therefore, if you don't know whether the XML to analyse will have namespace information or not, the best might be to do something like this:
This way, you will make sure that the condition is triggered regardless of whether the XML is "namespaced" or not. |
Hi @PhilipCattanach , could you help to merge this PR since it's tested successfully |
@jmle Thanks for your information. And I wanted to confirm that in Windup rule XML path expressions, the working pattern is |
@KaiqianYang the namespace in the condition is necessary when the "target" XML has namespace information. If no namespace information is present in the XML, the namespace must be removed from the condition:
Therefore, if you don't know if the XMLs you're targetting will or will not have the namespace information on them, the best you can do is to |
Yes, your response is quite clear. Thank you. |
<rule id="azure-java-version-01000"> | ||
<when> | ||
<xmlfile matches="//m:java.version[windup:matches(text(), '{v}')]" in="pom.xml" as="result"> | ||
<namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0"/> |
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.
Continuing with my comments, in this case, this
8000
is correct, since the POM files in the test folders have namespace information, although it is possible to find POM files without namespace information that build correctly. If you want to capture those edge cases, you will have to <or>
this condition with an additional one without the namespace
element.
@KaiqianYang I was taking a look at this again. After my clarification, is there something you want to change or are you waiting for it to get merged? |
Hi @jmle , I think it's fine now. Waiting for it to get merged. |
* Lombok <1.18.22 is not compatible with JDK 17 * Overriding rules * [WINDUPRULE-1005]-JWS: Upgrade direct dependencies that belong to the groupId org.apache.tomcat (#972) * Add tomcat target and dependencies rule * Add Tomcat direct dependency check rules * Change toVersion * check java version for azure (#957) * check java version for azure * Azure java version identification * use winup:matches --------- Co-authored-by: kaiqianyang <kaiqianyang@microsoftcom> Co-authored-by: PhilipCattanach <pcattana@redhat.com> * Enabled 'rules-overridden-azure' testing on GH --------- Co-authored-by: Carlos E. Feria Vila <carlosthe19916@gmail.com> Co-authored-by: KaiqianYang <89442934+KaiqianYang@users.noreply.github.com> Co-authored-by: kaiqianyang <kaiqianyang@microsoftcom> Co-authored-by: PhilipCattanach <pcattana@redhat.com> Co-authored-by: mrizzi <mrizzi@redhat.com>
No description provided.