Skip to content
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

!!! TASK: Interdimensional relatives for node move #4993

Merged
merged 32 commits into from Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
37efdb2
Extract and extend constraint check test cases
Apr 6, 2024
a610003
Refactor MoveNodeAggregate - new parent test suite from events to com…
Apr 6, 2024
63e6813
WIP Add extensive (failing) test suite for MoveNode without a new parent
Apr 7, 2024
6ca7fc2
Move SiblingPositions test cases to DoctrineDbal adapter
Apr 7, 2024
577d64e
Merge branch '9.0' into interdimensionalRelativesForNodeMove
Apr 9, 2024
eb44fa3
WIP: Introduce comprehensive test suite for moving to a new parent
Apr 9, 2024
b0f0b92
Merge branch '9.0' into interdimensionalRelativesForNodeMove
Apr 10, 2024
c7e2d79
Introduce more comprehensive MoveNode test suite
Apr 13, 2024
6580445
Add creation constraint checks after node move
Apr 13, 2024
bddda1c
Enforce additional sibling constraint checks on MoveNode
Apr 14, 2024
e82d47f
WIP: Refactor NodeAggregateWasMoved to use InterdimensionalSiblings
Apr 14, 2024
13bcf43
Fix sibling assignments to pass tests <3
Apr 14, 2024
dc4e7da
Extend and fix test cases for MoveNode to new parent
Apr 14, 2024
c013cc3
Properly validate siblings
Apr 15, 2024
0bbc4ac
Fix NodeMove/SubtreeTags test suite
Apr 15, 2024
a6e9b1d
Expect proper exception
Apr 15, 2024
4961034
Adjust zero-dimensional test cases
Apr 15, 2024
38051db
Pacify linter
Apr 15, 2024
e6e67e6
Adjust other projection test cases
Apr 15, 2024
e94c161
make SubtreeTags private again
Apr 16, 2024
3c88de4
Streamline Nodes::getNodeAggregateIds naming
Apr 16, 2024
333dcf6
Streamline exact tag check names
Apr 16, 2024
1427c1f
Use event instead of command DSP for ChangeProjection
Apr 16, 2024
698d243
Merge branch '9.0' into interdimensionalRelativesForNodeMove
Apr 20, 2024
40f2212
Merge branch '9.0' into interdimensionalRelativesForNodeMove
Apr 26, 2024
0acaaf1
Introduce and use Nodes::map
Apr 26, 2024
6318c7f
Update Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php
nezaniel Apr 29, 2024
5a7bcfd
Update Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php
nezaniel Apr 29, 2024
839ea3a
Update Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Fe…
nezaniel Apr 29, 2024
56cbfab
Update Neos.ContentRepository.Core/Classes/Projection/ContentGraph/No…
nezaniel Apr 29, 2024
3882b18
Merge branch '9.0' into interdimensionalRelativesForNodeMove
Apr 30, 2024
77ffad4
Adjust to comments
Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,110 @@
@contentrepository
Feature: Sibling positions are properly resolved

In the general DBAL adapter, hierarchy relations are sorted by an integer field. It defaults to a distance of 128,
which is reduced each time a node is inserted between two siblings. Once the number becomes uneven, the siblings positions are recalculated.
These are the test cases for this behavior.
nezaniel marked this conversation as resolved.
Show resolved Hide resolved

Background:
Given using the following content dimensions:
| Identifier | Values | Generalizations |
| example | general, source, peer, spec | spec->source->general, peer->general |
And using the following node types:
"""yaml
'Neos.ContentRepository.Testing:Document': []
"""
And using identifier "default", I define a content repository
And I am in content repository "default"
And the command CreateRootWorkspace is executed with payload:
| Key | Value |
| workspaceName | "live" |
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in the active content stream of workspace "live" and dimension space point {"example": "general"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the following CreateNodeAggregateWithNode commands are executed:
| nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName |
| sir-nodeward-nodington-iii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | esquire |
| lady-nodette-nodington-i | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-i |
| lady-nodette-nodington-x | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-x |
| lady-nodette-nodington-ix | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-ix |
| lady-nodette-nodington-viii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-viii |
| lady-nodette-nodington-vii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-vii |
| lady-nodette-nodington-vi | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-vi |
| lady-nodette-nodington-v | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-v |
| lady-nodette-nodington-iv | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-iv |
| lady-nodette-nodington-iii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-iii |
| lady-nodette-nodington-ii | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | nodington-ii |


Scenario: Trigger position update in DBAL graph
Given I am in the active content stream of workspace "live" and dimension space point {"example": "general"}
# distance i to x: 128
# distance ii to x: 64
When the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-ii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance iii to x: 32
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-iii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance iv to x: 16
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-iv" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance v to x: 8
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-v" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance vi to x: 4
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-vi" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance vii to x: 2
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-vii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance viii to x: 1 -> reorder -> 128
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-viii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance ix to x: 64 after reorder
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-ix" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date

Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have the following child nodes:
| Name | NodeDiscriminator |
| esquire | cs-identifier;sir-nodeward-nodington-iii;{"example": "general"} |
| nodington-i | cs-identifier;lady-nodette-nodington-i;{"example": "general"} |
| nodington-ii | cs-identifier;lady-nodette-nodington-ii;{"example": "general"} |
| nodington-iii | cs-identifier;lady-nodette-nodington-iii;{"example": "general"} |
| nodington-iv | cs-identifier;lady-nodette-nodington-iv;{"example": "general"} |
| nodington-v | cs-identifier;lady-nodette-nodington-v;{"example": "general"} |
| nodington-vi | cs-identifier;lady-nodette-nodington-vi;{"example": "general"} |
| nodington-vii | cs-identifier;lady-nodette-nodington-vii;{"example": "general"} |
| nodington-viii | cs-identifier;lady-nodette-nodington-viii;{"example": "general"} |
| nodington-ix | cs-identifier;lady-nodette-nodington-ix;{"example": "general"} |
| nodington-x | cs-identifier;lady-nodette-nodington-x;{"example": "general"} |