Skip to content

Commit

Permalink
[WINDUPRULE-1043][WINDUPRULE-1044] EAP XP5 rules wrt MP Metrics and O…
Browse files Browse the repository at this point in the history
…penTracing support removal
  • Loading branch information
emmartins committed Mar 5, 2024
1 parent 8d5aa62 commit 76e292b
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="eapxp_microprofile_metrics_not_supported"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>This ruleset identifies JBoss EAP XP 3.x/4.x applications that uses MicroProfile Metrics, which is not supported on JBoss EAP XP 5.x or later.</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final" />
</dependencies>
<sourceTechnology id="eapxp" versionRange="(3,4)" />
<targetTechnology id="eapxp" versionRange="[5,)" />
<tag>JBossEAP</tag>
<tag>EAPXP</tag>
</metadata>
<rules>
<!-- https://issues.redhat.com/browse/WINDUPRULE-1043 -->
<rule id="eapxp_microprofile_metrics_not_supported-00001">
<when>
<or>
<project>
<artifact groupId="org.eclipse.microprofile.metrics" artifactId="microprofile-metrics-api"/>
</project>
<javaclass references="org.eclipse.microprofile.metric.{*}">
<location>IMPORT</location>
</javaclass>
</or>
</when>
<perform>
<hint title="MicroProfile Metrics not supported" effort="1" category-id="mandatory">
<message>If you migrate your application to JBoss EAP XP 5.0 (or later), please note that MicroProfile Metrics is not supported.</message>
<!--
FIXME uncomment this link when XP5 docs are published
<link title="JBoss EAP XP upgrade and migration guide: MicroProfile Metrics not supported" href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/8.0/html-single/jboss_eap_xp_upgrade_and_migration_guide/index#microprofile_metrics_not_supported"/>
-->
<tag>EAPXP</tag>
</hint>
</perform>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="eapxp_microprofile_opentracing_not_supported"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>This ruleset identifies JBoss EAP XP 3.x/4.x applications that uses MicroProfile OpenTracing, which is not supported on JBoss EAP XP 5.x or later.</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final" />
</dependencies>
<sourceTechnology id="eapxp" versionRange="(3,4)" />
<targetTechnology id="eapxp" versionRange="[5,)" />
<tag>JBossEAP</tag>
<tag>EAPXP</tag>
</metadata>
<rules>
<!-- https://issues.redhat.com/browse/WINDUPRULE-1044 -->
<rule id="eapxp_microprofile_opentracing_not_supported-00001">
<when>
<or>
<project>
<artifact groupId="org.eclipse.microprofile.opentracing" artifactId="microprofile-opentracing-api"/>
</project>
<javaclass references="org.eclipse.microprofile.opentracing.{*}"/>
</or>
</when>
<perform>
<hint title="MicroProfile OpenTracing not supported" effort="1" category-id="mandatory">
<message>If you migrate your application to JBoss EAP XP 5.0 (or later), please note that MicroProfile OpenTracing is not supported.</message>
<!--
FIXME uncomment this link when XP5 docs are published
<link title="JBoss EAP XP upgrade and migration guide: MicroProfile OpenTracing not supported" href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/8.0/html-single/jboss_eap_xp_upgrade_and_migration_guide/index#microprofile_opentracing_not_supported"/>
-->
<tag>EAPXP</tag>
</hint>
</perform>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.jboss.eap.xp.test;

import org.eclipse.microprofile.metric.*;
public class MicroProfileApplication {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jboss.windup.rules.test</groupId>
<artifactId>windup-rulesets-test-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>eapxp_application</artifactId>

<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.metrics</groupId>
<artifactId>microprofile-metrics-api</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.jboss.eap.xp.test;

import org.eclipse.microprofile.opentracing.*;

public class MicroProfileApplication {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jboss.windup.rules.test</groupId>
<artifactId>windup-rulesets-test-pom</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>eapxp_application</artifactId>

<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<ruletest xmlns="http://windup.jboss.org/schema/jboss-ruleset"
id="eapxp_microprofile_metrics_not_supported-test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<testDataPath>data/data-eapxp_microprofile_metrics_not_supported/</testDataPath>
<rulePath>../eapxp_microprofile_metrics_not_supported.mta.xml</rulePath>
<ruleset>
<rules>
<rule id="eapxp_microprofile_metrics_not_supported-00001-test">
<when>
<not>
<iterable-filter size="2">
<hint-exists message="If you migrate your application to JBoss EAP XP 5.0 \(or later\), please note that MicroProfile Metrics is not supported." />
</iterable-filter>
</not>
</when>
<perform>
<fail message="[eapxp_microprofile_metrics_not_supported-00001] The hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<ruletest xmlns="http://windup.jboss.org/schema/jboss-ruleset"
id="eapxp_microprofile_opentracing_not_supported-test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<testDataPath>data/data-eapxp_microprofile_opentracing_not_supported/</testDataPath>
<rulePath>../eapxp_microprofile_opentracing_not_supported.mta.xml</rulePath>
<ruleset>
<rules>
<rule id="eapxp_microprofile_opentracing_not_supported-00001-test">
<when>
<not>
<iterable-filter size="2">
<hint-exists message="If you migrate your application to JBoss EAP XP 5.0 \(or later\), please note that MicroProfile OpenTracing is not supported." />
</iterable-filter>
</not>
</when>
<perform>
<fail message="[eapxp_microprofile_opentracing_not_supported-00001] The hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>

0 comments on commit 76e292b

Please sign in to comment.