8000 Spring boot to azure cache by agoncal · Pull Request #698 · windup/windup-rulesets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Spring boot to azure cache #698

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 4 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<ruleset id="spring-boot-to-azure-cache"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
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>
Identify any external caches in use.
</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final" />
</dependencies>
<sourceTechnology id="springboot"/>
<targetTechnology id="azure-appservice"/>
<targetTechnology id="azure-aks"/>
<tag>cache</tag>
</metadata>
<rules>
<rule id="spring-boot-to-azure-cache-redis-01000">
<when>
<or>
<project>
<artifact groupId="org.springframework.boot" artifactId="spring-boot-starter-data-redis"/>
</project>
<project>
<artifact groupId="org.springframework.data" artifactId="spring-data-redis"/>
</project>
<project>
<artifact groupId="org.springframework.session" artifactId="spring-session-data-redis"/>
</project>
<project>
<artifact groupId="org.springframework.integration" artifactId="spring-integration-redis"/>
</project>
</or>
</when>
<perform>
<hint title="Redis Cache found in the application" category-id="information" effort="0">
<message>
<![CDATA[
The application uses a Redis Cache.

Checkout Azure Cache for Redis for a fully managed cache on Azure.
]]>
</message>
<link title="Redis Cache found in the application" href="https://docs.microsoft.com/en-us/azure/developer/java/migration/migrate-spring-boot-to-app-service#identify-external-caches"/>
<link title="Azure Cache for Redis" href="https://azure.microsoft.com/services/cache"/>
<link title="Spring Data Redis" href="https://spring.io/projects/spring-data-redis"/>
<tag>redis</tag>
</hint>
</perform>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?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>

<groupId>org.jboss.windup.rules.test</groupId>
<artifactId>spring-boot-to-azure-jms-broker</artifactId>
<version>4.2.1_SNAPSHOT</version>
<name>Determine whether application relies on a message broker.</name>

<dependencies>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>not-tested</groupId>
<artifactId>spring-integration-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>not-tested</artifactId>
<version>5.0.10.Final</version>
</dependency>

<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>not-tested</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>not-tested</artifactId>
<version>5.0.10.Final</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>not-tested</groupId>
<artifactId>spring-data-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>not-tested</artifactId>
<version>5.0.10.Final</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>not-tested</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>5.0.10.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>not-tested</artifactId>
<version>5.0.10.Final</version>
</dependency>

</dependencies>
</project>
10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<ruletest id="spring-boot-to-azure-cache-test" xmlns="http://windup.jboss.org/schema/jboss-ruleset" 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/spring-boot-to-azure-cache</testDataPath>
<rulePath>../spring-boot-to-azure-cache.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="spring-boot-to-azure-cache-redis-test-01000">
<when>
<not>
<iterable-filter size="4">
<hint-exists message="The application uses a Redis Cache." />
</iterable-filter>
</not>
</when>
<perform>
<fail message="Redis Cache hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>
Original file line number Diff line number Diff line change
Expand Up @@ -1050,5 +1050,19 @@
</technology-identified>
</perform>
</rule>
<rule id="embedded-framework-embedded-framework-08950">
<when>
<graph-query discriminator="TechnologyTagModel">
<property name="name">Redis</property>
</graph-query>
</when>
<perform>
<technology-identified name="Redis">
<tag name="Store"/>
<tag name="Embedded"/>
<tag name="Caching"/>
</technology-identified>
</perform>
</rule>
</rules>
</ruleset>
11 changes: 11 additions & 0 deletions rules-reviewed/technology-usage/embedded-framework.windup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,17 @@
<technology-tag level="INFORMATIONAL">Quartz</technology-tag>
</perform>
</rule>
<rule id="embedded-framework-08950">
<when>
<file filename="{*}redis{*}.jar"/>
</when>
<perform>
<classification title="Embedded framework - Redis" category-id="information" effort="0">
<description>The application embeds the Redis client.</description>
</classification>
<technology-tag level="INFORMATIONAL">Redis</technology-tag>
</perform>
</rule>
<!-- this rule has to be always the last one in order to effectively checks for classifications added from previous rules in this ruleset-->
<rule id="embedded-framework-09000">
<when>
Expand Down
Binary file not shown.
9E7A
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,20 @@
<fail message="Expected data not found for rule technology-usage-embedded-framework-08900"/>
</perform>
</rule>
<rule id="technology-usage-embedded-framework-08950-test">
<when>
<not>
<technology-statistics-exists name="Redis" number-found="1">
<tag name="Store"/>
<tag name="Embedded"/>
<tag name="Caching"/>
</technology-statistics-exists>
</not>
</when>
<perform>
<fail message="Expected data not found for rule technology-usage-embedded-framework-08950"/>
</perform>
</rule>
</rules>
</ruleset>
</ruletest>
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,17 @@
<fail message="Expected data not found for rule embedded-framework-08900"/>
</perform>
</rule>
<rule id="embedded-framework-08950-test">
<when>
<not>
<classification-exists classification="Embedded framework - Redis"/>
<technology-tag-exists technology-tag="Redis"/>
</not>
</when>
<perform>
<fail message="Expected data not found for rule embedded-framework-08950"/>
</perform>
</rule>
<rule id="embedded-framework-09000-test">
<when>
<not>
Expand Down
0