-
-
Notifications
You must be signed in to change notification settings - Fork 224
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: Bind ContentGraph
to workspace
#5028
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php
Outdated
Show resolved
Hide resolved
The ContentGraph is now always bound to a `WorkspaceName` and `ContentStreamId` combination. The ProjectionState of the ContentGraph is now the `ContentGraphFinder` which allows you to get an instance of the `ContentGraph` bound to a combination (usually by giving only the `WorkspaceName`). The userland way is to use `ContentRepository::getContentGraph(WorkspaceName)`
5ba922d
to
7d691d8
Compare
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php
Show resolved
Hide resolved
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.
@kitsunet Thanks so much for putting a tremendous amount of time into this. I think it looks great already.
I just left some mostly nitpicky comments after a first quick pass mostly to dump my thoughts – no need to fix those (now).
One more important architectural choice is the stateful ContentGraphFinder
.
If I get it right, it now needs a getInstances()
method such that we can access (and reset the state of) all previously created CG instances in order to enable or disable their inMemory cache.
And then we need a reset()
method to reset the instances for tests.
This is quite a lot of "burden" to an interface (and custom implementations) for some really low-level goals.
Maybe together we can come up with a slightly different mechanism to work with those runtime caches. But this is certainly no reason to block this one, we could always tweak it in a follow-up.
Great work!
Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphTableNames.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
Outdated
Show resolved
Hide resolved
Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php
Outdated
Show resolved
Hide resolved
<3 Thank you! Yes lets definitely have a look at those low level things, they were really an afterthought since I realized that definitely the tests do not like having the instances around. We could completely skip the cache, but then any cache within the CG or subgraph wouldn't be much use either because you get a fresh instance every time. |
Co-authored-by: Bastian Waidelich <b.waidelich@wwwision.de>
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphInterface.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com>
Neos.ContentRepository.Core/Classes/ContentGraphFinderInterface.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphInterface.php
Show resolved
Hide resolved
Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php
Show resolved
Hide resolved
...tentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteRuntimeVariables.php
Outdated
Show resolved
Hide resolved
…unet/neos-development-collection into feature/content-graph-bound # Conflicts: # Neos.ContentRepository.Core/Classes/ContentGraphFinder.php
Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php
Outdated
Show resolved
Hide resolved
Hah, net minus lines, nice! |
UI Adjustments: neos/neos-ui#3775 |
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.
Wow. What a blast. As bastian had one last go through i also found some mininini things (just apply and merge :D)
Additionally i managed to get the Neos Ui e2e tests running in addition to the Neos ui adjustments i prepared.
So i consider this absolutely ready and it can be merged this evening!
Neos.ContentRepository.Core/Classes/Feature/ContentStreamCommandHandler.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php
Outdated
Show resolved
Hide resolved
Neos.ContentRepository.Core/Classes/Feature/ContentStreamCommandHandler.php
Show resolved
Hide resolved
Co-authored-by: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com>
Co-authored-by: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com>
Note for later: |
ContentGraph
to workspace
Wow now its finally done. Thx for the plenty adjustments and your motivation. @bwaidelich do you want to +1 as well? |
ContentGraph
to workspaceContentGraph
to workspace
@mhsdesign being trigger-happy again without even waiting for the checks to pass :) |
Haha lol idk this was automerge? 😂 |
…Graph directly $this->projectedNodeIterator->nodeAggregatesOfType has been rewritten to $this->contentGraph->findNodeAggregatesByType The `ProjectedNodeIterator` was before neos#5028 required to encapsulate `findNodeAggregatesByType` to only work on the live workspace.
…Graph directly $this->projectedNodeIterator->nodeAggregatesOfType has been rewritten to $this->contentGraph->findNodeAggregatesByType The `ProjectedNodeIterator` was before neos/neos-development-collection#5028 required to encapsulate `findNodeAggregatesByType` to only work on the live workspace.
The ContentGraph is now always bound to a
WorkspaceName
andContentStreamId
combination.The internal! ProjectionState of the ContentGraph is now the
ContentGraphFinder
which allows you to get an instance of theContentGraph
bound to a combination (usually by giving only theWorkspaceName
).The userland way to access the content graph is to ask the content repository:
ContentRepository::getContentGraph(WorkspaceName)
Upgrade instructions
The
WorkspaceName
must be passed along to get a subgraph instead of the internalContentStreamId
:This pr presents an in between step. Its for example currently not easily possible to get the WorkspaceName of a
Node
, but that will be solved in a following pr see also #4564.In this intermediate step, one must ask the workspace finder first to resolve a workspace for content stream which then can be passed to
getContentGraph
(see howContentRepositoryRegistry::subgraphForNode
handles it internally)Review instructions
Followups: #5038
Neos Ui adjustments: neos/neos-ui#3775