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

!!! BUGFIX: Aggregate changes must know their affected origin dimension space points #5395

Draft
wants to merge 14 commits into
base: 9.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
use Neos\ContentRepository\Core\Feature\WorkspaceModification\Event\WorkspaceBaseWorkspaceWasChanged;
use Neos\ContentRepository\Core\Feature\WorkspaceModification\Event\WorkspaceWasRemoved;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyDiscarded;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyPublished;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPublished;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceRebaseFailed;
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceWasRebased;
Expand Down Expand Up @@ -196,8 +194,6 @@ public function canHandle(EventInterface $event): bool
WorkspaceRebaseFailed::class,
WorkspaceWasCreated::class,
WorkspaceWasDiscarded::class,
WorkspaceWasPartiallyDiscarded::class,
WorkspaceWasPartiallyPublished::class,
WorkspaceWasPublished::class,
WorkspaceWasRebased::class,
WorkspaceWasRemoved::class,
Expand Down Expand Up @@ -233,8 +229,6 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void
WorkspaceRebaseFailed::class => $this->whenWorkspaceRebaseFailed($event),
WorkspaceWasCreated::class => $this->whenWorkspaceWasCreated($event),
WorkspaceWasDiscarded::class => $this->whenWorkspaceWasDiscarded($event),
WorkspaceWasPartiallyDiscarded::class => $this->whenWorkspaceWasPartiallyDiscarded($event),
WorkspaceWasPartiallyPublished::class => $this->whenWorkspaceWasPartiallyPublished($event),
WorkspaceWasPublished::class => $this->whenWorkspaceWasPublished($event),
WorkspaceWasRebased::class => $this->whenWorkspaceWasRebased($event),
WorkspaceWasRemoved::class => $this->whenWorkspaceWasRemoved($event),
Expand Down Expand Up @@ -774,16 +768,6 @@ private function whenWorkspaceWasDiscarded(WorkspaceWasDiscarded $event): void
$this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId);
}

private function whenWorkspaceWasPartiallyDiscarded(WorkspaceWasPartiallyDiscarded $event): void
{
$this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId);
}

private function whenWorkspaceWasPartiallyPublished(WorkspaceWasPartiallyPublished $event): void
{
$this->updateWorkspaceContentStreamId($event->sourceWorkspaceName, $event->newSourceContentStreamId);
}

private function whenWorkspaceWasPublished(WorkspaceWasPublished $event): void
{
$this->updateWorkspaceContentStreamId($event->sourceWorkspaceName, $event->newSourceContentStreamId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Feature: Workspace discarding - complex chained functionality
When the command DiscardIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-ws" |
| nodesToDiscard | [{"workspaceName": "user-ws", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "sir-david-nodenborough"}, {"workspaceName": "user-ws", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "sir-david-nodenborough"}] |
| nodesToDiscard | ["sir-david-nodenborough", "sir-david-nodenborough"] |
| newContentStreamId | "user-cs-id-rebased" |
Then the last command should have thrown the PartialWorkspaceRebaseFailed exception with:
| SequenceNumber | Event | Exception |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Feature: Discard individual nodes (basics)
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToDiscard | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
| nodesToDiscard | ["sir-nodeward-nodington-iii"] |
| newContentStreamId | "user-cs-identifier-new" |
Then I expect the content stream "user-cs-identifier" to not exist

Expand Down Expand Up @@ -126,7 +126,7 @@ Feature: Discard individual nodes (basics)
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToDiscard | [{"dimensionSpacePoint": {}, "nodeAggregateId": "non-existing-node"}, {"dimensionSpacePoint": {}, "nodeAggregateId": "sir-unchanged"}] |
| nodesToDiscard | ["non-existing-node", "sir-unchanged"] |
| newContentStreamId | "user-cs-identifier-new-two" |

# all nodes are still on the original user cs
Expand Down Expand Up @@ -156,7 +156,7 @@ Feature: Discard individual nodes (basics)
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToDiscard | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}, {"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "nody-mc-nodeface"}, {"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
| nodesToDiscard | ["sir-david-nodenborough", "nody-mc-nodeface", "sir-nodeward-nodington-iii"] |
| newContentStreamId | "user-cs-identifier-new" |

# when discarding all nodes we expect a full discard via WorkspaceWasDiscarded
Expand Down Expand Up @@ -186,7 +186,7 @@ Feature: Discard individual nodes (basics)
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToDiscard | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
| nodesToDiscard | ["sir-nodeward-nodington-iii"] |

# live WS does not change because of a discard
When I am in workspace "live" and dimension space point {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Feature: Workspace publication - complex chained functionality
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-ws" |
| nodesToPublish | [{"dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-nodebelig"}] |
| nodesToPublish | ["sir-nodebelig"] |
| newContentStreamId | "user-cs-id-rebased" |
Then the last command should have thrown the WorkspaceRebaseFailed exception with:
| SequenceNumber | Event | Exception |
Expand All @@ -108,7 +108,7 @@ Feature: Workspace publication - complex chained functionality
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-ws" |
| nodesToPublish | [{"workspaceName": "user-ws", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "nody-mc-nodeface"}] |
| nodesToPublish | ["nody-mc-nodeface"] |
| newContentStreamId | "user-cs-id-rebased" |
Then the last command should have thrown the PartialWorkspaceRebaseFailed exception with:
| SequenceNumber | Event | Exception |
Expand Down Expand Up @@ -144,7 +144,7 @@ Feature: Workspace publication - complex chained functionality
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-ws" |
| nodesToPublish | [{"dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-david-nodenborough"}] |
| nodesToPublish | ["sir-david-nodenborough"] |
| newContentStreamId | "user-cs-id-rebased" |
Then the last command should have thrown the PartialWorkspaceRebaseFailed exception with:
| SequenceNumber | Event | Exception |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Feature: Individual node publication
| nody-mc-nodeface | Neos.ContentRepository.Testing:Content | $child2Id | nody | {} |
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| nodesToPublish | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}] |
| nodesToPublish | ["sir-david-nodenborough"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |

And I am in workspace "live"
Expand All @@ -79,7 +79,7 @@ Feature: Individual node publication
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"dimensionSpacePoint": {}, "nodeAggregateId": "non-existing"}] |
| nodesToPublish | ["non-existing"] |
| contentStreamIdForRemainingPart | "user-cs-new" |
Then workspaces user-test has status OUTDATED

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Feature: Publishing individual nodes (basics)
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
| nodesToPublish | ["sir-nodeward-nodington-iii"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
Then I expect the content stream "user-cs-identifier" to not exist

Expand Down Expand Up @@ -142,7 +142,7 @@ Feature: Publishing individual nodes (basics)
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"dimensionSpacePoint": {}, "nodeAggregateId": "non-existing-node"}, {"dimensionSpacePoint": {}, "nodeAggregateId": "sir-unchanged"}] |
| nodesToPublish | ["non-existing-node", "sir-unchanged"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining-two" |

When I am in workspace "live" and dimension space point {}
Expand Down Expand Up @@ -198,7 +198,7 @@ Feature: Publishing individual nodes (basics)
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"dimensionSpacePoint": {}, "nodeAggregateId": "sir-unchanged"}] |
| nodesToPublish | ["sir-unchanged"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
Then the last command should have thrown the WorkspaceRebaseFailed exception with:
| SequenceNumber | Event | Exception |
Expand All @@ -208,7 +208,7 @@ Feature: Publishing individual nodes (basics)
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}, {"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "nody-mc-nodeface"}, {"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
| nodesToPublish | ["sir-david-nodenborough", "nody-mc-nodeface", "sir-nodeward-nodington-iii"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |

# when publishing all nodes we expect a full discard via WorkspaceWasPublished
Expand Down Expand Up @@ -252,7 +252,7 @@ Feature: Publishing individual nodes (basics)
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}, {"dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}] |
| nodesToPublish | ["sir-nodeward-nodington-iii", "sir-david-nodenborough"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |

Then I expect exactly 8 events to be published on stream "ContentStream:cs-identifier"
Expand Down Expand Up @@ -291,7 +291,7 @@ Feature: Publishing individual nodes (basics)
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [{"dimensionSpacePoint": {}, "nodeAggregateId": "non-existing"}] |
| nodesToPublish | ["non-existing"] |
| contentStreamIdForRemainingPart | "user-cs-new" |
Then workspaces user-test has status OUTDATED

Expand Down
Loading
Loading