Skip to content

Commit 088edbd

Browse files
authored
Merge pull request #5385 from mhsdesign/bugfix/publish-only-across-all-dimensions
BUGFIX: Simplify PartialPublish & Discard (for now) to NOT select dimensions and have custom events
2 parents ffe4faa + fa58f0c commit 088edbd

File tree

57 files changed

+257
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+257
-702
lines changed

Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656
use Neos\ContentRepository\Core\Feature\WorkspaceModification\Event\WorkspaceBaseWorkspaceWasChanged;
5757
use Neos\ContentRepository\Core\Feature\WorkspaceModification\Event\WorkspaceWasRemoved;
5858
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded;
59-
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyDiscarded;
60-
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPartiallyPublished;
6159
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasPublished;
6260
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceRebaseFailed;
6361
use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Event\WorkspaceWasRebased;
@@ -196,8 +194,6 @@ public function canHandle(EventInterface $event): bool
196194
WorkspaceRebaseFailed::class,
197195
WorkspaceWasCreated::class,
198196
WorkspaceWasDiscarded::class,
199-
WorkspaceWasPartiallyDiscarded::class,
200-
WorkspaceWasPartiallyPublished::class,
201197
WorkspaceWasPublished::class,
202198
WorkspaceWasRebased::class,
203199
WorkspaceWasRemoved::class,
@@ -233,8 +229,6 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void
233229
WorkspaceRebaseFailed::class => $this->whenWorkspaceRebaseFailed($event),
234230
WorkspaceWasCreated::class => $this->whenWorkspaceWasCreated($event),
235231
WorkspaceWasDiscarded::class => $this->whenWorkspaceWasDiscarded($event),
236-
WorkspaceWasPartiallyDiscarded::class => $this->whenWorkspaceWasPartiallyDiscarded($event),
237-
WorkspaceWasPartiallyPublished::class => $this->whenWorkspaceWasPartiallyPublished($event),
238232
WorkspaceWasPublished::class => $this->whenWorkspaceWasPublished($event),
239233
WorkspaceWasRebased::class => $this->whenWorkspaceWasRebased($event),
240234
WorkspaceWasRemoved::class => $this->whenWorkspaceWasRemoved($event),
@@ -774,16 +768,6 @@ private function whenWorkspaceWasDiscarded(WorkspaceWasDiscarded $event): void
774768
$this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId);
775769
}
776770

777-
private function whenWorkspaceWasPartiallyDiscarded(WorkspaceWasPartiallyDiscarded $event): void
778-
{
779-
$this->updateWorkspaceContentStreamId($event->workspaceName, $event->newContentStreamId);
780-
}
781-
782-
private function whenWorkspaceWasPartiallyPublished(WorkspaceWasPartiallyPublished $event): void
783-
{
784-
$this->updateWorkspaceContentStreamId($event->sourceWorkspaceName, $event->newSourceContentStreamId);
785-
}
786-
787771
private function whenWorkspaceWasPublished(WorkspaceWasPublished $event): void
788772
{
789773
$this->updateWorkspaceContentStreamId($event->sourceWorkspaceName, $event->newSourceContentStreamId);

Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W10-IndividualNodeDiscarding/01-ConstraintChecks.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Feature: Workspace discarding - complex chained functionality
7070
When the command DiscardIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
7171
| Key | Value |
7272
| workspaceName | "user-ws" |
73-
| nodesToDiscard | [{"workspaceName": "user-ws", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "sir-david-nodenborough"}, {"workspaceName": "user-ws", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "sir-david-nodenborough"}] |
73+
| nodesToDiscard | ["sir-david-nodenborough", "sir-david-nodenborough"] |
7474
| newContentStreamId | "user-cs-id-rebased" |
7575
Then the last command should have thrown the PartialWorkspaceRebaseFailed exception with:
7676
| SequenceNumber | Event | Exception |

Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W10-IndividualNodeDiscarding/02-BasicFeatures.feature

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,18 @@ Feature: Discard individual nodes (basics)
9696
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
9797
| Key | Value |
9898
| workspaceName | "user-test" |
99-
| nodesToDiscard | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
99+
| nodesToDiscard | ["sir-nodeward-nodington-iii"] |
100100
| newContentStreamId | "user-cs-identifier-new" |
101101
Then I expect the content stream "user-cs-identifier" to not exist
102102
103+
Then I expect exactly 2 events to be published on stream with prefix "Workspace:user-test"
104+
And event at index 1 is of type "WorkspaceWasDiscarded" with payload:
105+
| Key | Expected |
106+
| workspaceName | "user-test" |
107+
| newContentStreamId | "user-cs-identifier-new" |
108+
| previousContentStreamId | "user-cs-identifier" |
109+
| partial | true |
110+
103111
When I am in workspace "user-test" and dimension space point {}
104112
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node user-cs-identifier-new;sir-david-nodenborough;{}
105113
And I expect this node to have the following properties:
@@ -126,7 +134,7 @@ Feature: Discard individual nodes (basics)
126134
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
127135
| Key | Value |
128136
| workspaceName | "user-test" |
129-
| nodesToDiscard | [{"dimensionSpacePoint": {}, "nodeAggregateId": "non-existing-node"}, {"dimensionSpacePoint": {}, "nodeAggregateId": "sir-unchanged"}] |
137+
| nodesToDiscard | ["non-existing-node", "sir-unchanged"] |
130138
| newContentStreamId | "user-cs-identifier-new-two" |
131139
132140
# all nodes are still on the original user cs
@@ -156,16 +164,16 @@ Feature: Discard individual nodes (basics)
156164
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
157165
| Key | Value |
158166
| workspaceName | "user-test" |
159-
| 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"}] |
167+
| nodesToDiscard | ["sir-david-nodenborough", "nody-mc-nodeface", "sir-nodeward-nodington-iii"] |
160168
| newContentStreamId | "user-cs-identifier-new" |
161169
162-
# when discarding all nodes we expect a full discard via WorkspaceWasDiscarded
163170
Then I expect exactly 2 events to be published on stream with prefix "Workspace:user-test"
164171
And event at index 1 is of type "WorkspaceWasDiscarded" with payload:
165172
| Key | Expected |
166173
| workspaceName | "user-test" |
167174
| newContentStreamId | "user-cs-identifier-new" |
168175
| previousContentStreamId | "user-cs-identifier" |
176+
| partial | false |
169177
170178
When I am in workspace "user-test" and dimension space point {}
171179
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node user-cs-identifier-new;sir-david-nodenborough;{}
@@ -186,7 +194,7 @@ Feature: Discard individual nodes (basics)
186194
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
187195
| Key | Value |
188196
| workspaceName | "user-test" |
189-
| nodesToDiscard | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-nodeward-nodington-iii"}] |
197+
| nodesToDiscard | ["sir-nodeward-nodington-iii"] |
190198
191199
# live WS does not change because of a discard
192200
When I am in workspace "live" and dimension space point {}

Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W7-WorkspacePublication/02-PublishWorkspace.feature

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,19 @@ Feature: Workspace based content publishing
9595
When the command PublishWorkspace is executed with payload:
9696
| Key | Value |
9797
| workspaceName | "user-test" |
98+
| newContentStreamId | "user-cs-new" |
99+
98100
Then I expect the content stream "user-cs-identifier" to not exist
99101

102+
Then I expect exactly 2 events to be published on stream with prefix "Workspace:user-test"
103+
And event at index 1 is of type "WorkspaceWasPublished" with payload:
104+
| Key | Expected |
105+
| sourceWorkspaceName | "user-test" |
106+
| targetWorkspaceName | "live" |
107+
| newSourceContentStreamId | "user-cs-new" |
108+
| previousSourceContentStreamId | "user-cs-identifier" |
109+
| partial | false |
110+
100111
When I am in workspace "live" and dimension space point {}
101112
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node cs-identifier;nody-mc-nodeface;{}
102113
And I expect this node to have the following properties:

Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/01-ConstraintChecks.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Feature: Workspace publication - complex chained functionality
8282
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
8383
| Key | Value |
8484
| workspaceName | "user-ws" |
85-
| nodesToPublish | [{"dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-nodebelig"}] |
85+
| nodesToPublish | ["sir-nodebelig"] |
8686
| newContentStreamId | "user-cs-id-rebased" |
8787
Then the last command should have thrown the WorkspaceRebaseFailed exception with:
8888
| SequenceNumber | Event | Exception |
@@ -108,7 +108,7 @@ Feature: Workspace publication - complex chained functionality
108108
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
109109
| Key | Value |
110110
| workspaceName | "user-ws" |
111-
| nodesToPublish | [{"workspaceName": "user-ws", "dimensionSpacePoint": {"language": "en"}, "nodeAggregateId": "nody-mc-nodeface"}] |
111+
| nodesToPublish | ["nody-mc-nodeface"] |
112112
| newContentStreamId | "user-cs-id-rebased" |
113113
Then the last command should have thrown the PartialWorkspaceRebaseFailed exception with:
114114
| SequenceNumber | Event | Exception |
@@ -144,7 +144,7 @@ Feature: Workspace publication - complex chained functionality
144144
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
145145
| Key | Value |
146146
| workspaceName | "user-ws" |
147-
| nodesToPublish | [{"dimensionSpacePoint": {"language": "de"}, "nodeAggregateId": "sir-david-nodenborough"}] |
147+
| nodesToPublish | ["sir-david-nodenborough"] |
148148
| newContentStreamId | "user-cs-id-rebased" |
149149
Then the last command should have thrown the PartialWorkspaceRebaseFailed exception with:
150150
| SequenceNumber | Event | Exception |

Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/02-BasicFeatures.feature

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@ Feature: Individual node publication
5454
| nody-mc-nodeface | Neos.ContentRepository.Testing:Content | $child2Id | nody | {} |
5555
When the command PublishIndividualNodesFromWorkspace is executed with payload:
5656
| Key | Value |
57-
| nodesToPublish | [{"workspaceName": "user-test", "dimensionSpacePoint": {}, "nodeAggregateId": "sir-david-nodenborough"}] |
57+
| nodesToPublish | ["sir-david-nodenborough"] |
5858
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
5959

60+
Then I expect exactly 2 events to be published on stream with prefix "Workspace:user-test"
61+
And event at index 1 is of type "WorkspaceWasPublished" with payload:
62+
| Key | Expected |
63+
| sourceWorkspaceName | "user-test" |
64+
| targetWorkspaceName | "live" |
65+
| newSourceContentStreamId | "user-cs-identifier-remaining" |
66+
| previousSourceContentStreamId | "user-cs-identifier" |
67+
| partial | true |
68+
6069
And I am in workspace "live"
6170

6271
Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph
@@ -79,7 +88,7 @@ Feature: Individual node publication
7988
When the command PublishIndividualNodesFromWorkspace is executed with payload:
8089
| Key | Value |
8190
| workspaceName | "user-test" |
82-
| nodesToPublish | [{"dimensionSpacePoint": {}, "nodeAggregateId": "non-existing"}] |
91+
| nodesToPublish | ["non-existing"] |
8392
| contentStreamIdForRemainingPart | "user-cs-new" |
8493
Then workspaces user-test has status OUTDATED
8594

0 commit comments

Comments
 (0)