Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/9.0' into task/4477-NodeType-get…
Browse files Browse the repository at this point in the history
…PropertyType-nullable
  • Loading branch information
mhsdesign committed Nov 1, 2023
2 parents 55e1ebf + 64d2af1 commit 2f1316a
Show file tree
Hide file tree
Showing 576 changed files with 9,778 additions and 51,887 deletions.
16 changes: 9 additions & 7 deletions .composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"type": "neos-package-collection",
"require": {
"neos/flow-development-collection": "9.0.x-dev",
"neos/neos-setup": "^2.0"
"neos/neos-setup": "^2.0",
"league/flysystem-memory": "^3"
},
"replace": {
},
Expand All @@ -14,12 +15,14 @@
"scripts": {
"lint:phpcs-psr12": "../../bin/phpcs --colors --standard=PSR12 ./Neos.ContentGraph.DoctrineDbalAdapter/src ./Neos.ContentGraph.PostgreSQLAdapter/src ./Neos.ContentRepository.BehavioralTests/Classes ./Neos.ContentRepository.TestSuite/Classes ./Neos.ContentRepository.Core/Classes ./Neos.Neos/Classes",
"lint:phpcs": [
"@lint:phpcs-psr12 --exclude=Generic.Files.LineLength"
"@lint:phpcs-psr12 --exclude=Generic.Files.LineLength,PSR1.Files.SideEffects"
],
"lint:phpstan": "../../bin/phpstan analyse",
"lint:distributionintegrity": "[ -d 'Neos.ContentRepository' ] && { echo 'Package Neos.ContentRepository should not exist.' 1>&2; exit 1; } || exit 0;",
"lint": [
"@lint:phpcs",
"@lint:phpstan"
"@lint:phpstan",
"@lint:distributionintegrity"
],
"test:unit": [
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/UnitTests.xml Neos.ContentRepository.Core/Tests/Unit",
Expand All @@ -29,18 +32,17 @@
"../../bin/phpunit --colors --stop-on-failure -c ../../Build/BuildEssentials/PhpUnit/FunctionalTests.xml Neos.ContentRepository.Core/Tests/Functional"
],
"test:behavioral": [
"mkdir -p ../../Build/Behat/; cp -R Neos.ContentRepository.BehavioralTests/DistributionBehatTemplate/* ../../Build/Behat/; cd ../../Build/Behat/; composer install; cd ../../Packages/Neos",
"../../bin/behat -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
"../../bin/behat -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser"
"../../bin/behat -f progress -c Neos.Neos/Tests/Behavior/behat.yml"
],
"test:behavioral:stop-on-failure": [
"mkdir -p ../../Build/Behat/; cp -R Neos.ContentRepository.BehavioralTests/DistributionBehatTemplate/* ../../Build/Behat/; cd ../../Build/Behat/; composer install; cd ../../Packages/Neos",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.BehavioralTests/Tests/Behavior/behat.yml.dist",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser"
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.Neos/Tests/Behavior/behat.yml",
"../../bin/behat -vvv --stop-on-failure -f progress -c Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/behat.yml.dist"
],
"test": [
"@test:unit",
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
git -C ../${{ env.NEOS_FOLDER }} checkout -b build
composer config repositories.neos '{ "type": "path", "url": "../${{ env.NEOS_FOLDER }}", "options": { "symlink": false } }'
composer require --no-update neos/neos-development-collection:"dev-build as ${{ env.NEOS_BRANCH_ALIAS }}"
# workaround for not-yet-released neos/eventstore packages
# TODO workaround for not-yet-released neos/eventstore packages
composer require --no-update neos/eventstore:"dev-main"
composer require --no-update neos/eventstore-doctrineadapter:"dev-main"
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
FLOW_CONTEXT=Testing ./flow doctrine:migrate --quiet
bin/phpunit --colors --stop-on-failure -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml --testsuite "Neos tests" --verbose
- name: Run ES CR Tests
- name: Run Behavioral Tests (ES CR && Neos.Neos)
id: escrtests
if: matrix.parallel-parts == 'escr-behavioral'
# DEBUG MODE: comment-in the next line, because we want to reach the Upload Mysql/Postgres DB dump step.
Expand Down Expand Up @@ -325,18 +325,6 @@ jobs:
if: matrix.parallel-parts == 'functionaltests-postgres'
run: bin/phpunit --colors --stop-on-failure -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml --testsuite "Neos tests" --verbose

- name: Run behat tests (PGSQL)
if: matrix.parallel-parts == 'functionaltests-postgres'
run: |
FLOW_CONTEXT=Testing/Behat ./flow configuration:show
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationstatus
FLOW_CONTEXT=Testing/Behat ./flow behat:setup
FLOW_CONTEXT=Testing/Behat ./flow doctrine:create
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all
# TODO: RE-ENABLE AFTER FIXING
#bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser
buildall:
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip travis]')"
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postgresql-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ jobs:
FLOW_CONTEXT=Testing/Behat ./flow behat:setup
FLOW_CONTEXT=Testing/Behat ./flow doctrine:create
FLOW_CONTEXT=Testing/Behat ./flow doctrine:migrationversion --add --version all
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml.dist --tags ~@browser
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.Neos/Tests/Behavior/behat.yml
bin/behat --stop-on-failure -f progress -c Packages/Neos/Neos.ContentRepository/Tests/Behavior/behat.yml.dist
26 changes: 26 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: Neos.Neos/Documentation/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats:
- pdf
- epub

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: Neos.Neos/Documentation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@
*/

require_once(__DIR__ . '/../../../../../../Application/Neos.Behat/Tests/Behat/FlowContextTrait.php');
require_once(__DIR__ . '/../../../../../../Framework/Neos.Flow/Tests/Behavior/Features/Bootstrap/IsolatedBehatStepsTrait.php');
require_once(__DIR__ . '/../../../../../Neos.ContentRepository.Security/Tests/Behavior/Features/Bootstrap/NodeAuthorizationTrait.php');
require_once(__DIR__ . '/ProjectionIntegrityViolationDetectionTrait.php');

use Behat\Behat\Context\Context as BehatContext;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Neos\Behat\Tests\Behat\FlowContextTrait;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\ProjectionIntegrityViolationDetectionTrait;
use Neos\ContentRepository\BehavioralTests\Tests\Functional\BehatTestHelper;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\CRBehavioralTestsSubjectProvider;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinPyStringNodeBasedNodeTypeManagerFactory;
use Neos\ContentRepository\BehavioralTests\TestSuite\Behavior\GherkinTableNodeBasedContentDimensionSourceFactory;
Expand All @@ -30,21 +27,17 @@
use Neos\ContentRepository\Core\Factory\ContentRepositoryServiceInterface;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteTrait;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Tests\Behavior\Features\Bootstrap\IsolatedBehatStepsTrait;

/**
* Features context
*/
class FeatureContext implements BehatContext
{
use FlowContextTrait;
use IsolatedBehatStepsTrait;
use ProjectionIntegrityViolationDetectionTrait;
use CRTestSuiteTrait;
use CRBehavioralTestsSubjectProvider;

protected string $behatTestHelperObjectName = BehatTestHelper::class;

protected ContentRepositoryRegistry $contentRepositoryRegistry;

public function __construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalContentGraphProjectionFactory;
use Neos\ContentGraph\DoctrineDbalAdapter\DoctrineDbalProjectionIntegrityViolationDetectionRunnerFactory;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\SharedModel\Id\UuidFactory;
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentGraph\DoctrineDbalAdapter\Tests\Behavior\Features\Bootstrap\Helpers\TestingNodeAggregateId;
use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteRuntimeVariables;
use Neos\ContentRepositoryRegistry\Infrastructure\DbalClient;
use Neos\Error\Messages\Error;
use Neos\Error\Messages\Result;
use Neos\Flow\Utility\Algorithms;
use PHPUnit\Framework\Assert;

/**
Expand Down Expand Up @@ -236,14 +236,14 @@ private function transformDatasetToHierarchyRelationRecord(array $dataset): arra
'dimensionspacepoint' => $dimensionSpacePoint->toJson(),
'dimensionspacepointhash' => $dimensionSpacePoint->hash,
'parentnodeanchor' => $parentNodeAggregateId->isNonExistent()
? Algorithms::generateUUID()
? UuidFactory::create()
: $this->findRelationAnchorPointByIds(
ContentStreamId::fromString($dataset['contentStreamId']),
$dimensionSpacePoint,
NodeAggregateId::fromString($dataset['parentNodeAggregateId'])
),
'childnodeanchor' => $childAggregateId->isNonExistent()
? Algorithms::generateUUID()
? UuidFactory::create()
: $this->findRelationAnchorPointByIds(
ContentStreamId::fromString($dataset['contentStreamId']),
$dimensionSpacePoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Run integrity violation detection regarding hierarchy relations and nod
| language | de, gsw, fr | gsw->de |
And using the following node types:
"""yaml
'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document': []
"""
And using identifier "default", I define a content repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Run integrity violation detection regarding parent relations
| language | de, gsw, fr | gsw->de |
And using the following node types:
"""yaml
'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document': []
"""
And using identifier "default", I define a content repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Run integrity violation detection regarding reference relations
| language | de, gsw, fr | gsw->de |
And using the following node types:
"""yaml
'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document':
properties:
referenceProperty:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Run integrity violation detection regarding restriction relations
| language | de, gsw, fr | gsw->de |
And using the following node types:
"""yaml
'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document': []
"""
And using identifier "default", I define a content repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Run integrity violation detection regarding restriction relations
| language | de, gsw, fr | gsw->de |
And using the following node types:
"""yaml
'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document': []
"""
And using identifier "default", I define a content repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Feature: Run integrity violation detection regarding sibling sorting
| language | de, gsw, fr | gsw->de |
And using the following node types:
"""yaml
'Neos.ContentRepository:Root': []
'Neos.ContentRepository.Testing:Document': []
"""
And using identifier "default", I define a content repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function markStale(): void
private function whenRootNodeAggregateWithNodeWasCreated(RootNodeAggregateWithNodeWasCreated $event, EventEnvelope $eventEnvelope): void
{
$nodeRelationAnchorPoint = NodeRelationAnchorPoint::create();
$originDimensionSpacePoint = OriginDimensionSpacePoint::fromArray([]);
$originDimensionSpacePoint = OriginDimensionSpacePoint::createWithoutDimensions();
$node = new NodeRecord(
$nodeRelationAnchorPoint,
$event->nodeAggregateId,
Expand Down Expand Up @@ -272,7 +272,7 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim
->getAnchorPointForNodeAndOriginDimensionSpacePointAndContentStream(
$event->nodeAggregateId,
/** the origin DSP of the root node is always the empty dimension ({@see whenRootNodeAggregateWithNodeWasCreated}) */
OriginDimensionSpacePoint::fromArray([]),
OriginDimensionSpacePoint::createWithoutDimensions(),
$event->contentStreamId
);
if ($rootNodeAnchorPoint === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function build(
);

return new ContentGraphProjection(
// @phpstan-ignore-next-line
new DoctrineDbalContentGraphProjection(
$this->dbalClient,
new NodeFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection;

use Neos\Flow\Utility\Algorithms;
use Neos\ContentRepository\Core\SharedModel\Id\UuidFactory;

/**
* The node relation anchor value object
Expand All @@ -30,7 +30,7 @@ private function __construct(

public static function create(): self
{
return new self(Algorithms::generateUUID());
return new self(UuidFactory::create());
}

public static function forRootEdge(): self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,40 +84,6 @@ final public function getSubgraph(
return $this->subgraphs[$index];
}

/**
* @throws DBALException
* @throws NodeTypeNotFoundException
*/
public function findNodeByIdAndOriginDimensionSpacePoint(
ContentStreamId $contentStreamId,
NodeAggregateId $nodeAggregateId,
OriginDimensionSpacePoint $originDimensionSpacePoint
): ?Node {
$connection = $this->client->getConnection();

// HINT: we check the ContentStreamId on the EDGE;
// as this is where we actually find out whether the node exists in the content stream
$nodeRow = $connection->executeQuery(
'SELECT n.*, h.contentstreamid, h.name FROM ' . $this->tableNamePrefix . '_node n
INNER JOIN ' . $this->tableNamePrefix . '_hierarchyrelation h
ON h.childnodeanchor = n.relationanchorpoint
WHERE n.nodeaggregateid = :nodeAggregateId
AND n.origindimensionspacepointhash = :originDimensionSpacePointHash
AND h.contentstreamid = :contentStreamId',
[
'nodeAggregateId' => $nodeAggregateId->value,
'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash,
'contentStreamId' => $contentStreamId->value
]
)->fetchAssociative();

return $nodeRow ? $this->nodeFactory->mapNodeRowToNode(
$nodeRow,
$originDimensionSpacePoint->toDimensionSpacePoint(),
VisibilityConstraints::withoutRestrictions()
) : null;
}

/**
* @throws RootNodeAggregateDoesNotExist
*/
Expand Down
Loading

0 comments on commit 2f1316a

Please sign in to comment.