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

TASK: Remove explicit deprecated command blocking #5059

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
8 changes: 0 additions & 8 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"@test:behat-cli -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test:behavioral:sync": [
"@putenv CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION=1",
"@test:behavioral"
],
"test:behavioral:stop-on-failure": [
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist",
Expand All @@ -58,10 +54,6 @@
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"@test:behat-cli -vvv --stop-on-failure -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test:behavioral:stop-on-failure:sync": [
"@putenv CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION=1",
"@test:behavioral:stop-on-failure"
],
"test": [
"@test:unit",
"@test:functional",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ jobs:
# DEBUG MODE: ALTERNATIVELY, comment in the following lines to dump the DB.
# do not exit the script if the tests break; as we want to upload the database dumps afterwards.
set +e
composer test:behavioral:stop-on-failure:sync
composer test:behavioral:stop-on-failure
retVal=$?

# automatically search for race conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function __construct()
self::bootstrapFlow();
$this->contentRepositoryRegistry = $this->getObject(ContentRepositoryRegistry::class);

$this->setupCRTestSuiteTrait();
$this->setupDbalGraphAdapterIntegrityViolationTrait();
}

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 @@ -41,7 +42,7 @@ trait ProjectionIntegrityViolationDetectionTrait
{
use CRTestSuiteRuntimeVariables;

private DoctrineDbalClient $dbalClient;
private Connection $dbal;

protected Result $lastIntegrityViolationDetectionResult;

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

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

/**
Expand All @@ -80,7 +81,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 +98,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 +115,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 All @@ -132,7 +133,7 @@ public function iChangeTheFollowingNodesName(TableNode $payloadTable): void
{
$dataset = $this->transformPayloadTableToDataset($payloadTable);

$relationAnchorPoint = $this->dbalClient->getConnection()->executeQuery(
$relationAnchorPoint = $this->dbal->executeQuery(
'SELECT n.relationanchorpoint FROM ' . $this->tableNames()->node() . ' n
JOIN ' . $this->tableNames()->hierarchyRelation() . ' h ON h.childnodeanchor = n.relationanchorpoint
WHERE h.contentstreamid = :contentStreamId
Expand All @@ -145,7 +146,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 +172,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 +190,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 +208,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 +278,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 +314,7 @@ private function transformPayloadTableToDataset(TableNode $payloadTable): array
*/
public function iRunIntegrityViolationDetection(): void
{
$projectionIntegrityViolationDetectionRunner = $this->getContentRepositoryService(new DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory($this->dbalClient));
$projectionIntegrityViolationDetectionRunner = $this->getContentRepositoryService(new DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory($this->getObject(DoctrineDbalClient::class)));
$this->lastIntegrityViolationDetectionResult = $projectionIntegrityViolationDetectionRunner->run();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feature: Run integrity violation detection regarding hierarchy relations and nod
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand All @@ -35,7 +34,6 @@ Feature: Run integrity violation detection regarding hierarchy relations and nod
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeName | "child-document" |
| nodeAggregateClassification | "regular" |
And the graph projection is fully up to date

Scenario: Detach a hierarchy relation from its parent
When I add the following hierarchy relation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feature: Run integrity violation detection regarding parent relations
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand Down Expand Up @@ -55,7 +54,6 @@ Feature: Run integrity violation detection regarding parent relations
| parentNodeAggregateId | "sir-david-nodenborough" |
| nodeName | "child-document" |
| nodeAggregateClassification | "regular" |
And the graph projection is fully up to date

Scenario: Set a second parent for Nody McNodeface
And I add the following hierarchy relation:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Feature: Run integrity violation detection regarding reference relations
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand All @@ -46,7 +45,6 @@ Feature: Run integrity violation detection regarding reference relations
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeAggregateClassification | "regular" |
And the graph projection is fully up to date

Scenario: Detach a reference relation from its source
When the command SetNodeReferences is executed with payload:
Expand All @@ -55,7 +53,6 @@ Feature: Run integrity violation detection regarding reference relations
| sourceNodeAggregateId | "source-nodandaise" |
| referenceName | "referenceProperty" |
| references | [{"target": "anthony-destinode"}] |
And the graph projection is fully up to date
And I detach the following reference relation from its source:
| Key | Value |
| contentStreamId | "cs-identifier" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ Feature: Run integrity violation detection regarding sibling sorting
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date

Scenario: Create two siblings and set the sorting to the same value
When the event NodeAggregateWithNodeWasCreated was published with payload:
Expand All @@ -46,7 +44,6 @@ Feature: Run integrity violation detection regarding sibling sorting
| coveredDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeAggregateClassification | "regular" |
And the graph projection is fully up to date
And I set the following position:
| Key | Value |
| contentStreamId | "cs-identifier" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ Feature: Run integrity violation detection regarding subtree tag inheritance
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| nodeTypeName | "Neos.ContentRepository:Root" |
And the graph projection is fully up to date

Scenario: Create nodes, disable the topmost and remove some restriction edges manually
When the event NodeAggregateWithNodeWasCreated was published with payload:
Expand Down Expand Up @@ -64,7 +62,6 @@ Feature: Run integrity violation detection regarding subtree tag inheritance
| nodeAggregateId | "sir-david-nodenborough" |
| affectedDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] |
| tag | "disabled" |
And the graph projection is fully up to date
And I remove the following subtree tag:
| Key | Value |
| contentStreamId | "cs-identifier" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feature: Run projection integrity violation detection regarding naming of tether
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {"language":"de"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand All @@ -35,7 +34,6 @@ Feature: Run projection integrity violation detection regarding naming of tether
| parentNodeAggregateId | "lady-eleonode-rootford" |
| nodeName | "document" |
| nodeAggregateClassification | "regular" |
And the graph projection is fully up to date

Scenario: Remove tethered node's name
When the event NodeAggregateWithNodeWasCreated was published with payload:
Expand All @@ -48,7 +46,6 @@ Feature: Run projection integrity violation detection regarding naming of tether
| parentNodeAggregateId | "sir-david-nodenborough" |
| nodeName | "to-be-hacked-to-null" |
| nodeAggregateClassification | "tethered" |
And the graph projection is fully up to date
And I change the following node's name:
| Key | Value |
| contentStreamId | "cs-identifier" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: Sibling positions are properly resolved
| workspaceTitle | "Live" |
| workspaceDescription | "The live workspace" |
| newContentStreamId | "cs-identifier" |
And the graph projection is fully up to date
And I am in workspace "live" and dimension space point {"example": "general"}
And the command CreateRootNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand Down Expand Up @@ -50,49 +49,41 @@ Feature: Sibling positions are properly resolved
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-ii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance iii to x: 32
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-iii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance iv to x: 16
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-iv" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance v to x: 8
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-v" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance vi to x: 4
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-vi" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance vii to x: 2
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-vii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance viii to x: 1 -> reorder -> 128
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-viii" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date
# distance ix to x: 64 after reorder
And the command MoveNodeAggregate is executed with payload:
| Key | Value |
| nodeAggregateId | "lady-nodette-nodington-ix" |
| newSucceedingSiblingNodeAggregateId | "lady-nodette-nodington-x" |
And the graph projection is fully up to date

Then I expect node aggregate identifier "lady-eleonode-rootford" to lead to node cs-identifier;lady-eleonode-rootford;{}
And I expect this node to have the following child nodes:
Expand Down
Loading
Loading