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

Conversation

nezaniel
Copy link
Member

@nezaniel nezaniel commented Apr 15, 2024

Builds on: #4982

This replaces the cumbersome MoveNodeMappings DTO with the far more lightweight, but surprisingly even more capable InterdimensionalSiblings DTO.

Upgrade instructions

This is breaky for 3rd party packages since the event DTOs are part of the API

Review instructions

First: Don't be afraid of the number of LoC added. That's just proper test coverage for MoveNode, finally.

For the refactoring, further assumptions are made (and enforced via constraint checks and tests):

  1. Pure edge operation
    MoveNode is considered an pure edge operation, meaning no node is actually touched. This was also implied before, since MoveNode explicitly never updated any timestamps. Thus, no OrginDimensionSpacePoints are communicated anymore, just siblings per affected DSP.
    Hint: Neos' ChangeProjection needs to decide how to deal with MoveNode. Its tests pass anyway.

  2. Only one parent (at most) per move operation
    As the RelationDistributionStrategy already states: the variants will be gathered (more or less, depending on the strategy) at the new parent, if given.
    That also means: no implicit parent changes. If a given sibling belongs to a different parent, this will lead to

  • a constraint check exception, if it's not really a sibling in the selected DSP
  • the "sibling" being ignored in an affected DSP if it's not a sibling there
  1. Succeeding sibling has priority over preceding sibling
    The given succeeding sibling (and its further succeeding siblings) will be checked for applicability.
    If none is found and a preceding sibling is given, it (and its further preceding siblings) will be checked instead.

  2. Preceding siblings are evaluated if given and no succeeding sibling is given

  3. Non-determinable siblings
    If no succeeding sibling can be determined for the move operation, there are three cases

  • both siblings are explicitly given as null, which reflects the intention of "move to end"
  • a parent id is given; We need to define a succeeding sibling (or null) here and chose null
  • no parent is given: This is a no-op in the affected DSP; It will not even be part of the InterdimensionalSiblings because nothing happens in this DSP

Checklist

  • Code follows the PSR-12 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the 9.0 branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive, thanks for taking care!
Just a first batch of comments after skimming over from my phone

Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 by reading.
Thanks a lot for catching me up earlier, I finally understood it and it makes a lot of sense :)
I left some comments re migration strategy, but no reason to block this IMO.

Also, what are those:
image

?

@nezaniel
Copy link
Member Author

Also, what are those:
[...]
?

It's untouched; I guess it fails on a newer / older PHPStan version

@nezaniel
Copy link
Member Author

...and was fixed by just merging 9.0

Copy link
Contributor

@grebaldi grebaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nezaniel,

I went through your code, and I believe I understand the gist of it 😅 Left some comments, none of which are big things.

I also did some manual testing with the UI and ran the UI E2E tests atop your branch, and everything looks 👍

nezaniel and others added 6 commits April 29, 2024 23:32
Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
…ature/NodeMove.php

Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
…des.php

Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
@nezaniel nezaniel merged commit 203fbe7 into 9.0 Apr 30, 2024
10 checks passed
@nezaniel nezaniel deleted the interdimensionalRelativesForNodeMove branch April 30, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants