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

WIP: FEATURE: Rework CR CatchUp mechanism #4988

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3a2fc46
WIP: FEATURE: Rework CR CatchUp mechanism
bwaidelich Apr 11, 2024
99cd1e0
Remove `react/async` dependency
bwaidelich Apr 12, 2024
e8a0bdd
Remove `react/async` dependency 2/2
bwaidelich Apr 12, 2024
d2382ee
Cosmetic fix to satisfy linter
bwaidelich Apr 13, 2024
7dc35fc
Remove unused namespace imports
bwaidelich Apr 13, 2024
13e1238
Replace `CheckpointStorageInterface`
bwaidelich Apr 14, 2024
4c425cd
Replace `CheckpointStorageInterface`
bwaidelich Apr 14, 2024
b1d28f6
Merge branch 'feature/4746-rework-catchup-mechanism' of https://githu…
bwaidelich Apr 14, 2024
ad57a91
Remove `DbalClientInterface` and implementations
bwaidelich Apr 15, 2024
b817b1d
Update composer manifest
bwaidelich Apr 16, 2024
cb653fd
Tweak checkpoint error message
bwaidelich Apr 16, 2024
43da4c2
Re-add `neos/eventstore-doctrineadapter` dependency
bwaidelich Apr 16, 2024
bb1c498
Mostly cosmetic tweaks to satisfy linter
bwaidelich Apr 16, 2024
e62cb87
Make checkpoint table check a platform specific check
bwaidelich Apr 17, 2024
7cc13ed
Remove notion of "sync" from composer scripts and readme
bwaidelich Apr 17, 2024
fc6ec5c
Remove ProjectionCatchUpTriggerInterface and implementations
bwaidelich Apr 17, 2024
89eada5
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 24, 2024
cc3a191
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 25, 2024
7c8ae2c
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 26, 2024
ed47eb6
Fix ContentStreamProjection checkpoint
bwaidelich Apr 26, 2024
592e78d
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich Apr 30, 2024
4af1e3c
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 1, 2024
4c68ca7
BUGFIX: Remove doctrine migrate and cr setup commands from behat scripts
bwaidelich May 1, 2024
7bfd941
Use dedicated connection for EventStore
bwaidelich May 1, 2024
e2e8af6
Re-use previously created event store instances
bwaidelich May 1, 2024
fb9b897
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 6, 2024
082c5ca
Merge remote-tracking branch 'origin/9.0' into feature/4746-rework-ca…
mhsdesign May 17, 2024
adf6eef
TASK: Adjustments after merging 9.0 (beta10) to satisfy phpstan mostly
mhsdesign May 17, 2024
c6920ec
Merge remote-tracking branch 'origin/9.0' into feature/4746-rework-ca…
mhsdesign May 17, 2024
88abe17
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 19, 2024
27f330f
Merge branch 'task/remove-dbal-client' into feature/4746-rework-catch…
bwaidelich May 19, 2024
b4fe6e9
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 19, 2024
3abc8f0
Make ContentGraphTableNames::tableNamePrefix private again
bwaidelich May 19, 2024
3d6edc7
Merge branch '9.0' into feature/4746-rework-catchup-mechanism
bwaidelich May 21, 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
2 changes: 0 additions & 2 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@test:behat-cli -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -c Neos.ContentRepository.Export/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"@test:behat-cli -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test:behavioral:stop-on-failure": [
Expand All @@ -51,7 +50,6 @@
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentRepository.Export/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -vvv --stop-on-failure -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"@test:behat-cli -vvv --stop-on-failure -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap;

use Behat\Gherkin\Node\TableNode;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Neos\ContentGraph\DoctrineDbalAdapter\ContentGraphTableNames;
Expand All @@ -27,7 +28,6 @@
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteRuntimeVariables;
use Neos\ContentRepositoryRegistry\DoctrineDbalClient\DoctrineDbalClient;
use Neos\Error\Messages\Error;
use Neos\Error\Messages\Result;
use PHPUnit\Framework\Assert;
Expand All @@ -41,7 +41,7 @@ trait ProjectionIntegrityViolationDetectionTrait
{
use CRTestSuiteRuntimeVariables;

private DoctrineDbalClient $dbalClient;
private Connection $dbal;

protected Result $lastIntegrityViolationDetectionResult;

Expand All @@ -62,7 +62,7 @@ private function tableNames(): ContentGraphTableNames

public function setupDbalGraphAdapterIntegrityViolationTrait()
{
$this->dbalClient = $this->getObject(DoctrineDbalClient::class);
$this->dbal = $this->getObject(Connection::class);
}

/**
Expand All @@ -80,7 +80,7 @@ public function iRemoveTheFollowingSubtreeTag(TableNode $payloadTable): void
if (!$subtreeTags->contain($subtreeTagToRemove)) {
throw new \RuntimeException(sprintf('Failed to remove subtree tag "%s" because that tag is not set', $subtreeTagToRemove->value), 1708618267);
}
$this->dbalClient->getConnection()->update(
$this->dbal->update(
$this->tableNames()->hierarchyRelation(),
[
'subtreetags' => json_encode($subtreeTags->without($subtreeTagToRemove), JSON_THROW_ON_ERROR | JSON_FORCE_OBJECT),
Expand All @@ -97,7 +97,7 @@ public function iAddTheFollowingHierarchyRelation(TableNode $payloadTable): void
{
$dataset = $this->transformPayloadTableToDataset($payloadTable);
$record = $this->transformDatasetToHierarchyRelationRecord($dataset);
$this->dbalClient->getConnection()->insert(
$this->dbal->insert(
$this->tableNames()->hierarchyRelation(),
$record
);
Expand All @@ -114,7 +114,7 @@ public function iChangeTheFollowingHierarchyRelationsDimensionSpacePointHash(Tab
$record = $this->transformDatasetToHierarchyRelationRecord($dataset);
unset($record['position']);

$this->dbalClient->getConnection()->update(
$this->dbal->update(
$this->tableNames()->hierarchyRelation(),
[
'dimensionspacepointhash' => $dataset['newDimensionSpacePointHash']
Expand Down Expand Up @@ -145,7 +145,7 @@ public function iChangeTheFollowingNodesName(TableNode $payloadTable): void
]
)->fetchOne();

$this->dbalClient->getConnection()->update(
$this->dbal->update(
$this->tableNames()->node(),
[
'name' => $dataset['newName']
Expand All @@ -171,7 +171,7 @@ public function iSetTheFollowingPosition(TableNode $payloadTable): void
'childnodeanchor' => $this->findRelationAnchorPointByDataset($dataset)
];

$this->dbalClient->getConnection()->update(
$this->dbal->update(
$this->tableNames()->hierarchyRelation(),
[
'position' => $dataset['newPosition']
Expand All @@ -189,7 +189,7 @@ public function iDetachTheFollowingReferenceRelationFromItsSource(TableNode $pay
{
$dataset = $this->transformPayloadTableToDataset($payloadTable);

$this->dbalClient->getConnection()->update(
$this->dbal->update(
$this->tableNames()->referenceRelation(),
[
'nodeanchorpoint' => 7777777
Expand All @@ -207,7 +207,7 @@ public function iSetTheFollowingReferencePosition(TableNode $payloadTable): void
{
$dataset = $this->transformPayloadTableToDataset($payloadTable);

$this->dbalClient->getConnection()->update(
$this->dbal->update(
$this->tableNames()->referenceRelation(),
[
'position' => $dataset['newPosition']
Expand Down Expand Up @@ -277,7 +277,7 @@ private function findHierarchyRelationByIds(
DimensionSpacePoint $dimensionSpacePoint,
NodeAggregateId $nodeAggregateId
): array {
$nodeRecord = $this->dbalClient->getConnection()->executeQuery(
$nodeRecord = $this->dbal->executeQuery(
'SELECT h.*
FROM ' . $this->tableNames()->node() . ' n
INNER JOIN ' . $this->tableNames()->hierarchyRelation() . ' h
Expand Down Expand Up @@ -313,7 +313,7 @@ private function transformPayloadTableToDataset(TableNode $payloadTable): array
*/
public function iRunIntegrityViolationDetection(): void
{
$projectionIntegrityViolationDetectionRunner = $this->getContentRepositoryService(new DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory($this->dbalClient));
$projectionIntegrityViolationDetectionRunner = $this->getContentRepositoryService(new DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory($this->dbal));
$this->lastIntegrityViolationDetectionResult = $projectionIntegrityViolationDetectionRunner->run();
}

Expand Down
3 changes: 1 addition & 2 deletions Neos.ContentGraph.DoctrineDbalAdapter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"license": "GPL-3.0+",
"require": {
"neos/contentrepository-core": "self.version",
"doctrine/dbal": "^2.13",
"doctrine/migrations": "*"
"neos/contentrepository-dbaltools": "*"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

namespace Neos\ContentGraph\DoctrineDbalAdapter;

use Doctrine\DBAL\Connection;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\ContentGraph;
use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Repository\NodeFactory;
use Neos\ContentRepository\Core\ContentGraphFactoryInterface;
use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface;
use Neos\ContentRepository\Core\NodeType\NodeTypeManager;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist;
Expand All @@ -29,7 +29,7 @@
final readonly class ContentGraphFactory implements ContentGraphFactoryInterface
{
public function __construct(
private DbalClientInterface $client,
private Connection $dbal,
private NodeFactory $nodeFactory,
private ContentRepositoryId $contentRepositoryId,
private NodeTypeManager $nodeTypeManager,
Expand All @@ -46,7 +46,7 @@ public function buildForWorkspace(WorkspaceName $workspaceName): ContentGraph
'workspace'
));

$row = $this->client->getConnection()->executeQuery(
$row = $this->dbal->executeQuery(
'
SELECT * FROM ' . $tableName . '
WHERE workspaceName = :workspaceName
Expand All @@ -66,6 +66,6 @@ public function buildForWorkspace(WorkspaceName $workspaceName): ContentGraph

public function buildForWorkspaceAndContentStream(WorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraph
{
return new ContentGraph($this->client, $this->nodeFactory, $this->contentRepositoryId, $this->nodeTypeManager, $this->tableNames, $workspaceName, $contentStreamId);
return new ContentGraph($this->dbal, $this->nodeFactory, $this->contentRepositoryId, $this->nodeTypeManager, $this->tableNames, $workspaceName, $contentStreamId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final readonly class ContentGraphTableNames
{
private function __construct(
private string $tableNamePrefix
public string $tableNamePrefix
) {
}

Expand Down
Loading
Loading