adobe / aem-modernize-tools

A suite of tools to modernize your AEM Sites implementations off legacy features.
http://opensource.adobe.com/aem-modernize-tools/
Apache License 2.0
64 stars 42 forks source link

"Like" based Rule Patterns #157

Closed bstopp closed 2 years ago

bstopp commented 2 years ago

Description

This update allows node-based rule configurations to use a "relative" path for matching. The patterns shown below will all match any component with the resource type aem-modernize/components/text:

<patterns jcr:primaryType="nt:unstructured">
  <text jcr:primaryType="nt:unstructured"
      sling:resourceType="aem-modernize/components/text"/>
</patterns>

<patterns jcr:primaryType="nt:unstructured">
  <text jcr:primaryType="nt:unstructured"
      sling:resourceType="components/text"/>
</patterns>

<patterns jcr:primaryType="nt:unstructured">
  <text jcr:primaryType="nt:unstructured"
      sling:resourceType="text"/>
</patterns>

Motivation and Context

Teams found that a single component was used across multiple tenants, but each tenant's rules were exactly the same.

Types of changes

Checklist:

codecov[bot] commented 2 years ago

Codecov Report

Merging #157 (adf1761) into main (98de03c) will increase coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #157      +/-   ##
============================================
+ Coverage     80.33%   80.42%   +0.08%     
- Complexity      488      492       +4     
============================================
  Files            38       38              
  Lines          2192     2202      +10     
  Branches        396      399       +3     
============================================
+ Hits           1761     1771      +10     
  Misses          312      312              
  Partials        119      119              
Flag Coverage Δ
unittests 80.42% <100.00%> (+0.08%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...odernize/rule/impl/AbstractRewriteRuleService.java 84.86% <100.00%> (+0.59%) :arrow_up:
.../aem/modernize/rule/impl/NodeBasedRewriteRule.java 93.39% <100.00%> (+0.06%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 98de03c...adf1761. Read the comment docs.