From 98c145050a0fd0f2f06b2d6df6a412aa11d368f9 Mon Sep 17 00:00:00 2001 From: Simon Krull Date: Sat, 29 Apr 2023 21:35:07 +0200 Subject: [PATCH 1/4] TASK: Add documentation for CLI commands introduced with Neos 9 --- .../Classes/Command/ContentCommandController.php | 7 +++++++ .../Classes/Command/CrCommandController.php | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php index d8f000bee14..116c80f05fb 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php @@ -39,6 +39,13 @@ public function __construct( parent::__construct(); } + /** + * Refreshes the root node dimensions in the specified content repository for the specified workspace + * + * @param string $contentRepository test + * @param string $workspace test + * @return void + */ public function refreshRootNodeDimensionsCommand(string $contentRepository = 'default', string $workspace = WorkspaceName::WORKSPACE_NAME_LIVE): void { $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php index 82d5408ae3a..4eac500f950 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php @@ -82,6 +82,12 @@ public function replayAllCommand(string $contentRepository = 'default', bool $qu } } + /** + * This will completely prune the data of your content repository. + * + * @param string $contentRepository name of the content repository where the data should be pruned from + * @return void + */ public function pruneCommand(string $contentRepository = 'default'): void { if (!$this->output->askConfirmation(sprintf("This will prune your content repository \"%s\". Are you sure to proceed? (y/n) ", $contentRepository), false)) { From 9d87192421329d5653aa1beaab88f7f693b61adf Mon Sep 17 00:00:00 2001 From: Simon Krull Date: Wed, 26 Jul 2023 15:34:04 +0200 Subject: [PATCH 2/4] TASK: adjust doc comments --- .../Classes/Command/ContentCommandController.php | 2 +- .../Classes/Command/CrCommandController.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php index 116c80f05fb..94157326f90 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php @@ -40,7 +40,7 @@ public function __construct( } /** - * Refreshes the root node dimensions in the specified content repository for the specified workspace + * Refreshes the root node dimensions in the specified content repository for the specified workspace. * * @param string $contentRepository test * @param string $workspace test diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php index 4eac500f950..0b165539b20 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/CrCommandController.php @@ -83,9 +83,9 @@ public function replayAllCommand(string $contentRepository = 'default', bool $qu } /** - * This will completely prune the data of your content repository. + * This will completely prune the data of the specified content repository. * - * @param string $contentRepository name of the content repository where the data should be pruned from + * @param string $contentRepository name of the content repository where the data should be pruned from. * @return void */ public function pruneCommand(string $contentRepository = 'default'): void From e74f3f008434e6844d086186bfbb5a33e86d9840 Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Wed, 26 Jul 2023 16:23:30 +0200 Subject: [PATCH 3/4] Add more doc comments --- ...erformanceMeasurementCommandController.php | 10 ++++- .../RaceConditionTrackerCommandController.php | 11 ++++++ .../Command/ContentCommandController.php | 39 +++++++++++++++++-- .../StructureAdjustmentsCommandController.php | 14 +++++++ ...cessProjectionCatchUpCommandController.php | 5 +++ 5 files changed, 74 insertions(+), 5 deletions(-) diff --git a/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementCommandController.php b/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementCommandController.php index 64fbd771645..b538fabecbc 100644 --- a/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementCommandController.php +++ b/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementCommandController.php @@ -37,7 +37,11 @@ public function __construct( } /** - * @throws \Throwable + * Prepare the performance test by removing existing data and creating nodes for the test. + * + * @param int $nodesPerLevel The number of nodes to create per level. + * @param int $levels The number of levels in the node tree. + * @internal */ public function preparePerformanceTestCommand(int $nodesPerLevel, int $levels): void { @@ -51,7 +55,9 @@ public function preparePerformanceTestCommand(int $nodesPerLevel, int $levels): } /** - * @throws \Throwable + * Test the performance of forking a content stream and measure the time taken. + * + * @internal */ public function testPerformanceCommand(): void { diff --git a/Neos.ContentRepository.BehavioralTests/Classes/ProjectionRaceConditionTester/Command/RaceConditionTrackerCommandController.php b/Neos.ContentRepository.BehavioralTests/Classes/ProjectionRaceConditionTester/Command/RaceConditionTrackerCommandController.php index bd96c289904..6c50a6f55af 100644 --- a/Neos.ContentRepository.BehavioralTests/Classes/ProjectionRaceConditionTester/Command/RaceConditionTrackerCommandController.php +++ b/Neos.ContentRepository.BehavioralTests/Classes/ProjectionRaceConditionTester/Command/RaceConditionTrackerCommandController.php @@ -35,12 +35,23 @@ final class RaceConditionTrackerCommandController extends CommandController */ protected $configuration; + /** + * Reset the race condition tracker by clearing the stored traces in Redis. + * @internal + */ public function resetCommand(): void { RedisInterleavingLogger::connect($this->configuration['redis']['host'], $this->configuration['redis']['port']); RedisInterleavingLogger::reset(); } + + /** + * Analyze the stored trace and detect race conditions and double-processed events. + * + * @param string|null $storeTrace The path to store the full trace in NDJSON format (optional). + * @internal + */ public function analyzeTraceCommand(string $storeTrace = null): void { RedisInterleavingLogger::connect($this->configuration['redis']['host'], $this->configuration['redis']['port']); diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php index 94157326f90..873f09823ac 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/ContentCommandController.php @@ -42,9 +42,11 @@ public function __construct( /** * Refreshes the root node dimensions in the specified content repository for the specified workspace. * - * @param string $contentRepository test - * @param string $workspace test - * @return void + * In the content repository, the root node has to cover all existing dimension space points. + * With this command, the root node can be updated such that it represents all configured dimensions + * + * @param string $contentRepository The content repository identifier. (Default: 'default') + * @param string $workspace The workspace name. (Default: 'live') */ public function refreshRootNodeDimensionsCommand(string $contentRepository = 'default', string $workspace = WorkspaceName::WORKSPACE_NAME_LIVE): void { @@ -76,6 +78,22 @@ public function refreshRootNodeDimensionsCommand(string $contentRepository = 'de $this->outputFormatted('Done!'); } + /** + * Moves a dimension space point from the source to the target in the specified workspace and content repository. + * + * With this command all nodes for a given content dimension can be moved to a different dimension. This can be necessary + * if a dimension configuration has been added or renamed. + * + * *Note:* source and target dimensions have to be specified as JSON, for example: + * ``` + * ./flow content:movedimensionspacepoint '{"language": "de"}' '{"language": "en"}' + * ``` + * + * @param string $source The JSON representation of the source dimension space point. (Example: '{"language": "de"}') + * @param string $target The JSON representation of the target dimension space point. (Example: '{"language": "en"}') + * @param string $contentRepository The content repository identifier. (Default: 'default') + * @param string $workspace The workspace name. (Default: 'live') + */ public function moveDimensionSpacePointCommand(string $source, string $target, string $contentRepository = 'default', string $workspace = WorkspaceName::WORKSPACE_NAME_LIVE): void { // TODO: CLI arguments: $contentRepositoryId => $contentRepository (in other CLI commands) @@ -99,6 +117,21 @@ public function moveDimensionSpacePointCommand(string $source, string $target, s $this->outputFormatted('Done!'); } + /** + * Creates node variants recursively from the source to the target dimension space point in the specified workspace and content repository. + * + * This can be necessary if a new content dimension specialization was added (for example a more specific language) + * + * *Note:* source and target dimensions have to be specified as JSON, for example: + * ``` + * ./flow content:createvariantsrecursively '{"language": "de"}' '{"language": "de_ch"}' + * ``` + * + * @param string $source The JSON representation of the source dimension space point. (Example: '{"language": "de"}') + * @param string $target The JSON representation of the target origin dimension space point. (Example: '{"language": "en"}') + * @param string $contentRepository The content repository identifier. (Default: 'default') + * @param string $workspace The workspace name. (Default: 'live') + */ public function createVariantsRecursivelyCommand(string $source, string $target, string $contentRepository = 'default', string $workspace = WorkspaceName::WORKSPACE_NAME_LIVE): void { $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/StructureAdjustmentsCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/StructureAdjustmentsCommandController.php index 9f8900bd63f..64946e2a33c 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/StructureAdjustmentsCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/StructureAdjustmentsCommandController.php @@ -29,6 +29,13 @@ final class StructureAdjustmentsCommandController extends CommandController */ protected $contentRepositoryRegistry; + + /** + * Detect required structure adjustments for the specified node type in the given content repository. + * + * @param string|null $nodeType The node type to find structure adjustments for. If not provided, all adjustments will be shown. (Default: null) + * @param string $contentRepositoryIdentifier The content repository identifier. (Default: 'default') + */ public function detectCommand(string $nodeType = null, string $contentRepositoryIdentifier = 'default'): void { $contentRepositoryId = ContentRepositoryId::fromString($contentRepositoryIdentifier); @@ -45,6 +52,13 @@ public function detectCommand(string $nodeType = null, string $contentRepository $this->printErrors($errors); } + /** + * Apply required structure adjustments for the specified node type in the given content repository. + * + * @param string|null $nodeType The node type to apply structure adjustments for. If not provided, all found adjustments will be applied. (Default: null) + * @param string $contentRepositoryIdentifier The content repository identifier. (Default: 'default') + * @return void + */ public function fixCommand(string $nodeType = null, string $contentRepositoryIdentifier = 'default'): void { $contentRepositoryId = ContentRepositoryId::fromString($contentRepositoryIdentifier); diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php index bf122f2a606..77899b83827 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php @@ -21,6 +21,11 @@ class SubprocessProjectionCatchUpCommandController extends CommandController */ protected $contentRepositoryRegistry; + /** + * @param string $contentRepositoryIdentifier + * @param string $projectionClassName + * @internal + */ public function catchupCommand(string $contentRepositoryIdentifier, string $projectionClassName): void { From 1298837a7e6e6c68b3dfc7879ba3d9c5d7b94539 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Tue, 19 Sep 2023 15:32:29 +0200 Subject: [PATCH 4/4] Update Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php --- .../Command/SubprocessProjectionCatchUpCommandController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php index 77899b83827..8ee1c0c3d62 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/SubprocessProjectionCatchUpCommandController.php @@ -23,7 +23,7 @@ class SubprocessProjectionCatchUpCommandController extends CommandController /** * @param string $contentRepositoryIdentifier - * @param string $projectionClassName + * @param string $projectionClassName fully qualified class name of the projection to catch up * @internal */ public function catchupCommand(string $contentRepositoryIdentifier, string $projectionClassName): void