We ran into a strange issue while setting up serialization for our content tree in a Sitecore 9.2 XP0 environment. Our goal is to achieve a configuration that serializes a skeleton of our content tree and is deployed once when ever it does not exist or another developer added new top-level folders.
Our issue is: childrenOfPath rules are not applied correctly. The entire content tree within /Global is serialized despite excluding it or ignoring it completely.
I've attached a screenshot of our content tree as well as two configurations. One working. One not working.
The configuration you see below is our attempt to a more generic approach which fails to exclude the children of the /Global folder.
Additionally I've tried to remove the \
from name at the except element as well as played around with the includeChildren attribute.
<configuration name="Project.Foo.DeployOnce" description="Foo Global Content" dependencies="Foundation.*,Feature.*,Project.Common" extends="Foo.Project">
<evaluator type="Unicorn.Evaluators.NewItemOnlyEvaluator, Unicorn" singleInstance="true"/>
<predicate>
<include name="Foo Tenant" database="master" path="/sitecore/content/Foo">
<exclude childrenOfPath="Global">
<except name="\*" includeChildren="false"/>
</exclude>
</include>
</predicate>
<rolePredicate>
<include domain="extranet" pattern="^Project Foo Global.*$" />
</rolePredicate>
</configuration>
This works and meets the requirement of only serializing the needed skeleton folders but is not generic and requires developers to manually add to the configuration ( and also remember to do so )
<configuration name="Project.Foo.DeployOnce" description="Foo Global Content" dependencies="Foundation.*,Feature.*,Project.Common" extends="Foo.Project">
<evaluator type="Unicorn.Evaluators.NewItemOnlyEvaluator, Unicorn" singleInstance="true"/>
<predicate>
<include name="Foo Tenant" database="master" path="/sitecore/content/Foo">
<exclude children="true">
<except name="Global" />
<except name="Global/Site Settings" />
<except name="Global/Module Content" />
<except name="Global/Module Content/Gallery" />
<except name="Global/Module Content/Image" />
<except name="Global/Module Content/Media Text" />
<except name="Global/Module Content/Youtube Video" />
</exclude>
</include>
</predicate>
<rolePredicate>
<include domain="extranet" pattern="^Project Foo Global.*$" />
</rolePredicate>
</configuration>
Do I have a wrong understanding of how childrenOfPath works? I feel like I've developed a tunnel vision.