Skip to content

Commit

Permalink
WIP: Use node aggregate ids WITH dsp for `WorkspaceWasPartiallyPublis…
Browse files Browse the repository at this point in the history
…hed` in preparation of partial dimension publish ... at some point
  • Loading branch information
mhsdesign committed Nov 29, 2024
1 parent 534ce4f commit 98a7cb1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private static function commandMatchesAtLeastOneNode(
NodeAggregateIds $nodeIdsToMatch,
): bool {
foreach ($nodeIdsToMatch as $nodeId) {
// todo rather use the domain event here and use `EmbedsNodeAggregateId` already!
/**
* This match must contain all commands which are working with individual nodes, such that they are
* filterable whether they are applying their action to a NodeIdToPublish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ private function handlePublishIndividualNodesFromWorkspace(
return;
}

// todo we should - similar to discard - also add the node aggregate IDs with dimension point to the event again. The question is if we use the old events to analyse that or the newly emitted (today) events?
// could they come to a different result like MORE or less dimensions are suddenly affected because of a change in configuration? And would it make sense to use the old or new events then? Probably the old
// to make it consistent with discard.
$nodesToPublish = $this->extractNodeAggregateIdsAndAffectedDimensionSpacePoints($matchingCommands);

yield $this->closeContentStream(
$workspace->currentContentStreamId,
$workspaceContentStreamVersion
Expand Down Expand Up @@ -550,7 +555,7 @@ static function ($handle) use ($commandSimulator, $matchingCommands, $remainingC
$baseWorkspace->workspaceName,
$command->contentStreamIdForRemainingPart,
$workspace->currentContentStreamId,
$command->nodesToPublish
$nodesToPublish
)
]),
ExpectedVersion::ANY()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Event;

use Neos\ContentRepository\Core\EventStore\EventInterface;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;

Expand All @@ -41,27 +41,21 @@ public function __construct(
* The old content stream, which contains ALL the data (discarded and non-discarded)
*/
public ContentStreamId $previousSourceContentStreamId,
public NodeAggregateIds $publishedNodes,
/**
* Todo docs!
*/
public NodeIdsToPublishOrDiscard $publishedNodes,
) {
}

public static function fromArray(array $values): self
{
$publishedNodes = [];
foreach ($values['publishedNodes'] as $publishedNode) {
if (is_array($publishedNode)) {
// legacy case:
$publishedNodes[] = $publishedNode['nodeAggregateId'];
continue;
}
$publishedNodes[] = $publishedNode;
}
return new self(
WorkspaceName::fromString($values['sourceWorkspaceName']),
WorkspaceName::fromString($values['targetWorkspaceName']),
ContentStreamId::fromString($values['newSourceContentStreamId']),
ContentStreamId::fromString($values['previousSourceContentStreamId']),
NodeAggregateIds::fromArray($publishedNodes),
NodeIdsToPublishOrDiscard::fromArray($values['publishedNodes']),
);
}

Expand Down

0 comments on commit 98a7cb1

Please sign in to comment.