-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
!!! FEATURE: Add workspaceName
to relevant events
#5002
Conversation
Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php
Outdated
Show resolved
Hide resolved
# Conflicts: # Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php
…gregateId` interface
workspaceName
to relevant eventsworkspaceName
to relevant events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments for my fellow reviewers..
Apart from those I wonder if we need to take care of previous CR exports, e.g. via some on-the-fly-migration during import!?
@@ -38,13 +38,13 @@ public static function enrichWithCommand( | |||
foreach ($events as $event) { | |||
if ($event instanceof DecoratedEvent) { | |||
$undecoratedEvent = $event->innerEvent; | |||
if (!$undecoratedEvent instanceof PublishableToOtherContentStreamsInterface) { | |||
if (!$undecoratedEvent instanceof PublishableToWorkspaceInterface) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed the interface PublishableToOtherContentStreamsInterface
to PublishableToWorkspaceInterface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes that was missed with bernhards change :D
$contentGraph->getWorkspaceName(), | ||
$contentGraph->getContentStreamId(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the contentStreamId
was taken from the node aggregate – but since that does not contain the workspaceName
I changed both to use the info from the ContentGraph
.
Not 100% sure about this, but in practice it should not make a difference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually that seems like the best option as NodeAggregate::contentStreamId
will be removed.
if (!isset($eventPayload['workspaceName'])) { | ||
$eventPayload['workspaceName'] = 'some-workspace'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this in all the "The event [...] was published with payload" steps to fill the workspaceName
if it wasn't specified (we already do that for dimension space points etc).
An alternative would be to adjust the behat tests themselves.. not sure about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto fill seems fine. dont we do this with the csid as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to fall back to currentContentStreamId and could do the same with currentWorkspaceName. I'm not too fond of autofill here and would prefer an exception if neither is given
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh lol sorry i missed that we literally hardcode 'some-workspace'
here. I was under impression we would fallback to currentWorkspaceName
which i also prefer ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's because it does not matter in the cases. But I agree that we should be specific here, I'll adjust the tests and require the workspace name to be set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phew, that was tedious but I think I adjusted all affected tests (let's see what the CI says)
I love our tests, but IMO we test too much from the _event_s perspective (there are 83 hits for /the event .* was published with payload/
). IMO we should mostly execute commands and expect events and/or state as a result (except for the rare low-level cases that are not feasible to recreate with commands).. But that's for another time :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx ❤️, Yes i have an issue as reminder for that: #4336
but i was under the impression that most things now use commands already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with migrating the Neos Ui e2e events and running the ui e2e tests as well.
We also have to adjust our 3 event export:
- Neos.Demo
- Neos ui testcase twodimension
- Neos ui testcase onedimension
i would propose to just edit the workspace live
in there so its easy to review the changes.
Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php
Show resolved
Hide resolved
Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php
Outdated
Show resolved
Hide resolved
@mhsdesign thanks for the feedback, I'll take care of a follow-up.
Not sure if I got that.. Is that something that can be done in this PR directly or is that Neos UI? |
Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php
Outdated
Show resolved
Hide resolved
Okay, so the migration will def take some time like a good minute for 19k events. |
nevermind. I oversaw the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oke seems to work. There will definitely be a lot of missing
's depending on how many node migrations you did ... or maybe there is something wrong. Hard to tell because the events dont tell me why this change was made.
There is an initiating user id set? So not cli + node migration? If that is true and you also have preservations we should maybe reconsider.
On the otherhand ill +1 this and well see if there are bugs once this is in use by projections at first.
I read that three times but still don't understand it ;) |
what i meant @bwaidelich, what do you think lead to this event: payload: {
"contentStreamId": "9cc426e4-3520-4e48-8272-609267850177",
"nodeAggregateId": "6b6e1251-4346-494f-ac56-526a30a5741d",
"originDimensionSpacePoint": {
"language": "pl"
},
"affectedDimensionSpacePoints": [
{
"language": "pl"
}
],
"propertyValues": {
"uriPathSegment": {
"value": "laszelechow",
"type": "string"
}
},
"propertiesToUnset": [],
"workspaceName": "missing"
} metadata {
"commandClass": "Neos\\ContentRepository\\Core\\Feature\\NodeModification\\Command\\SetSerializedNodeProperties",
"commandPayload": {
"nodeAggregateId": "6b6e1251-4346-494f-ac56-526a30a5741d",
"originDimensionSpacePoint": {
"language": "pl"
},
"propertyValues": {
"uriPathSegment": {
"value": "laszelechow",
"type": "string"
}
},
"propertiesToUnset": [],
"workspaceName": "missing:9cc426e4-3520-4e48-8272-609267850177"
},
"initiatingUserId": "3e5ed99c-16e4-4a12-a23b-4489563e85e7",
"initiatingTimestamp": "2023-11-07T23:16:15+00:00"
} |
@mhsdesign Uh, no idea. But if no corresponding workspace was created before, it should have never happened to begin with. |
only kindof, i feared we did something wrong that i have so many But as said i think there is no bug on our side. I just kindof fear that there might be the need to be some Every code must assume that the workspace name is no longer valid either way so +1. |
For the shown event were does the workspaceName come from there? As in, where is this event created code wise? |
that is the problem due to missing metadata we dont surely now but i suspect from previous structure adjustments or more likely node migrations (@dlubitz mentioned they operate currently on cs instead of ws and that is what he is about to change: #4685) |
Neither of those would have a user ID though? I rather meant what event is it and which command handler creates it... |
yeah thats the thing that makes me rethink this as well. Its a properties was set event: (but you should have the same db dump as well)
(the above is event 20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much details, thank you for going through it all.
I meant these three json l:
all adjusted ;) |
With neos#5002 `\Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder::isLiveContentStream` is obsolete.
With neos/neos-development-collection#5002 `\Neos\Neos\FrontendRouting\Projection\DocumentUriPathFinder::isLiveContentStream` is obsolete.
Adds the
workspaceName
to the data of all content stream related events.Breaking change
This is a breaking change because it changes the event payload.
Exports need to be replaced and events can be migrated with the provided event migration:
Event migration
This PR comes with a event migration that allows for fixing already published events:
Resolves: #4996