-
Notifications
You must be signed in to change notification settings - Fork 602
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
#1609 - Exclude seed property and facets subtree from ensure oak index comparison #1624
#1609 - Exclude seed property and facets subtree from ensure oak index comparison #1624
Conversation
KelvinXu can you review the mandatory excludes? |
@@ -482,6 +498,8 @@ boolean needsUpdate(@Nonnull Resource ensureDefinition, @Nonnull Resource oakInd | |||
final CustomChecksumGeneratorOptions ensureDefinitionOptions = new CustomChecksumGeneratorOptions(); | |||
ensureDefinitionOptions.addIncludedNodeTypes(new String[]{NT_OAK_UNSTRUCTURED}); | |||
ensureDefinitionOptions.addExcludedProperties(this.ignoreProperties); | |||
ensureDefinitionOptions.addExcludedSubTrees(this.excludeSubTrees); |
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.
Shouldn't these two lines also be added to oakIndexOptions
? Also notice this.excludeSubTrees
is based on NT_OAK_QUERY_INDEX_DEFINITION
, which is meant for oakIndexOptions
if I am not mistaken. Essentially we may have to have two excludeSubTrees
based on NT_OAK_UNSTRUCTURED
and NT_OAK_QUERY_INDEX_DEFINITION
and added to the two options
respectively?
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.
right you are! and thats why @kelvinxzf should always review my PR's! :)
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.
Maybe you need the following as well?
oakIndexOptions.addExcludedSubTrees(this.excludeSubTrees); oakIndexOptions.addExcludedNodeNames(this.excludeNodeNames);
Have to update EOI side of excludes |
@kelvinxzf @catholicon - Updated the Code and the Issue description to match the the current state. WDYT? |
@davidjgonzalez, I wonder if it might be interesting if EOID could be defined such that it has Barring this theoretical suggestion, the idea seems correct to me (I just read the comments - not the code though) |
Perhaps how the copy happens needs to get re-architected for these flexible use cases... which would likely result in not needing the ChecksumGenerator (since a more advance tree walk could compute that) We could look at it, but we'd probably scrap this PR entirely and rethink this. |
Oh... Then don't worry about it. I was imagining in terms of like diff where it often is easy to skip traversing further into the tree if some condition turns up. |
@catholicon im totally fine w scrapping a PR if its the right move :) Im not sure what the timing around this is ... or if we want to use this as a Temp fix and define an updated delta-detection/update strategy. |
@davidjgonzalez if it is just a matter of populating <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" For the simplification purpose, can we also assume everything defined above would be ignored on both sides? |
Yeah timing wise, the configurable way can be coming later... |
@davidjgonzalez, no I don't think the current implementation is incorrect step. I just meant to say that it'd be nice to have some configuration to say which nodes to avoid under facet node. In that regard, I like @kelvinxzf's idea too. The default config could have |
@davidjgonzalez @catholicon I quickly tested this branch and it seems working as expected... |
@kelvinxzf that is my understanding of the correct and expected behavior, but @catholicon is the super-authority! Thanks for taking the time to work through this - your help has been very appreciated. |
Pull Request Test Coverage Report for Build 3557
💛 - Coveralls |
…facets subtree from ensure oak index comparison (Adobe-Consulting-Services#1624)
EnsureOakIndex excludes property
seed
, and sub-tree[oak:QueryIndexDefinition]/facets/jcr:content
, by way up an updated to ChecksumGeneratorImpl that allows specific excludedNodeNames and excludedSubTrees.Glossary
Handling the "seed" property.
The seed property ("seed") is set as an Mandatory Ignored Property, meaning it's existence and value are ignored for both:
Ensure Oak Index will completely ignore this property on the OID entirely and must be managed directly on the OID itself (EOID cannot add/remove/update this property, and does not understand that it even exists).
Handling the "facets" subtree
The following subtrees are set as Mandatory Excluded SubTrees meaning they are excluded while determining if the OID and EOID are different and need updating.
[oak:QueryIndexDefinition]/facets/jcr:content
<- for the OID[oak:Unstructured]/facets/jcr:content
<- for the EOIDEOID should never define
facets/jcr:content
but rather onlyfacets
. (Requires documentation)The following will indicate a difference between the OID and EOID:
facets
node in either the OID/EOIDfacets
node between the OID/EOIDWhen the OID is updated based on the EOID, the OID's
[oak:QueryIndexDefinition]/facets
will be entirely replaced with the EOID's[oak:Unstructured]/facets/jcr:content