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: Simplify PartialPublish & Discard (for now) to NOT select dimensions and have custom events #5385

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e575933
TASK: Remove possibility to specify dimensions in partial publish or …
mhsdesign Nov 29, 2024
d78b1dd
TASK: Remove obsolete `MatchableWithNodeIdToPublishOrDiscardInterface`
mhsdesign Nov 29, 2024
1b6ab9d
TASK: Improve asset usage test match error
mhsdesign Nov 29, 2024
16da882
TASK: Revert catchup hook adjustment to rely on `NodeAggregateIds` in…
mhsdesign Nov 30, 2024
ac2c359
TASK: Remove information which nodes were partially published or disc…
mhsdesign Nov 30, 2024
e4ad10b
TASK: Simplify asset usage catchup hook to not optimise partial discard
mhsdesign Nov 30, 2024
4f8a9f6
WIP: Simplify publishing, that partial and full publish is the same
mhsdesign Nov 30, 2024
e5a9100
Linter in the winter
mhsdesign Nov 30, 2024
07b053e
TASK: Introduce migration to rename WorkspaceWasPartiallyPublished an…
mhsdesign Dec 1, 2024
d8e0ede
TASK: Phpstanisize event migrations
mhsdesign Dec 2, 2024
9e66ce6
Merge remote-tracking branch 'origin/9.0' into bugfix/publish-only-ac…
mhsdesign Dec 5, 2024
ec01723
TASK: Adjust new change projection tests to dont handle discarding on…
mhsdesign Dec 5, 2024
3d572c8
TASK: Revert special code path from partial to full publish
mhsdesign Dec 9, 2024
7aaeaae
TASK: Remove obsolete todos
mhsdesign Dec 9, 2024
3412594
TASK: Remove migration for partially publish events and handle them a…
mhsdesign Dec 10, 2024
135dc67
TASK: Simplify upcasting of legacy events to be in `fromArray` instea…
mhsdesign Dec 10, 2024
6bc3c55
TASK: Introduce "partial" flag on publish events
mhsdesign Dec 10, 2024
fa58f0c
BUGFIX: Ensure that `commandMatchesAtLeastOneNode` contains all comma…
mhsdesign Dec 11, 2024
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