diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature index bdc114cdf7f..3a1b492d362 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature @@ -57,7 +57,7 @@ Feature: Add Dimension Specialization Given I change the content dimensions in content repository "default" to: | Identifier | Values | Generalizations | | language | mul, de, ch | ch->de->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -71,7 +71,7 @@ Feature: Add Dimension Specialization # the original content stream has not been touched When I am in workspace "live" And I am in dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language":"de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" And I expect this node to have the following properties: | Key | Value | @@ -81,14 +81,14 @@ Feature: Add Dimension Specialization # now, we find the node underneath both DimensionSpacePoints - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language":"de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "hello" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} # shine through added - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language":"de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" And I expect this node to have the following properties: | Key | Value | @@ -101,27 +101,27 @@ Feature: Add Dimension Specialization # finally, we MODIFY the node and ensure that the modification is visible in both DSPs (as otherwise the shine through would not have worked # as expected) # migration-cs is the actual name of the temporary workspace - And I am in workspace "migration-cs" + And I am in workspace "migration-workspace" And the command SetNodeProperties is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | originDimensionSpacePoint | {"language": "de"} | | propertyValues | {"text": "changed"} | - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language":"de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "changed" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} # ch shines through to the DE node - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language":"de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "changed" | # the original content stream was untouched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language":"de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "hello" | @@ -143,7 +143,7 @@ Feature: Add Dimension Specialization When I am in workspace "live" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When VisibilityConstraints are set to "withoutRestrictions" - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language":"de"} to exist in the content graph When VisibilityConstraints are set to "frontend" # we change the dimension configuration @@ -151,7 +151,7 @@ Feature: Add Dimension Specialization | Identifier | Values | Generalizations | | language | mul, de, ch | ch->de->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -164,17 +164,17 @@ Feature: Add Dimension Specialization """ # the original content stream has not been touched - When I am in content stream "cs-identifier" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When VisibilityConstraints are set to "withoutRestrictions" - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language":"de"} to exist in the content graph When VisibilityConstraints are set to "frontend" # The visibility edges were modified - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When VisibilityConstraints are set to "withoutRestrictions" - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language":"de"} to exist in the content graph When VisibilityConstraints are set to "frontend" When I run integrity violation detection @@ -194,7 +194,7 @@ Feature: Add Dimension Specialization | sourceOrigin | {"language":"de"} | | targetOrigin | {"language":"en"} | - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - @@ -208,7 +208,7 @@ Feature: Add Dimension Specialization Then the last command should have thrown an exception of type "DimensionSpacePointAlreadyExists" Scenario: Error case - the target dimension is not configured - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - @@ -227,7 +227,7 @@ Feature: Add Dimension Specialization | Identifier | Values | Generalizations | | language | mul, de, foo | de->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - @@ -246,7 +246,7 @@ Feature: Add Dimension Specialization | Identifier | Values | Generalizations | | language | mul, de, foo | de->mul, foo->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature index e422d531bb4..b17a6ef86b0 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature @@ -47,7 +47,7 @@ Feature: Add New Property Scenario: Fixed newValue - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -72,17 +72,17 @@ Feature: Add New Property """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | - Then I expect node aggregate identifier "other" to lead to node migration-cs;other;{} + Then I expect a node identified by migration-cs;other;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_Dimensions.feature index b5973a86dd2..db052a12e43 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_Dimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_Dimensions.feature @@ -51,7 +51,7 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints Scenario: change materialized "de" node, should shine through in "ch", but not in "en" - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -76,39 +76,39 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | When I am in workspace "live" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | # the node was changed inside the new content stream, but only in DE (and shined through to CH; not in EN) - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - When I am in content stream "migration-cs" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "en"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | @@ -121,7 +121,7 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints | sourceOrigin | {"language":"de"} | | targetOrigin | {"language":"ch"} | - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -144,14 +144,14 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints """ # the node was changed inside the new content stream, but only in DE - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "ch"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "ch"} to exist in the content graph # !!! CH is still unmodified And I expect this node to have the following properties: | Key | Value | @@ -166,7 +166,7 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints | sourceOrigin | {"language":"de"} | | targetOrigin | {"language":"ch"} | - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -190,14 +190,14 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints """ # the node was changed inside the new content stream in DE and EN - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "ch"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph # !!! CH is modified now And I expect this node to have the following properties: | Key | Value | @@ -205,7 +205,7 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints Scenario: matching only happens based on originDimensionSpacePoint, not on visibleDimensionSpacePoints - we try to change CH, but should not see any modification (includeSpecializations = FALSE - default) - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -229,20 +229,20 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints """ # neither DE or CH is modified - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | Scenario: matching only happens based on originDimensionSpacePoint, not on visibleDimensionSpacePoints - we try to change CH, but should not see any modification (includeSpecializations = TRUE) - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -267,14 +267,14 @@ Feature: Change Property Value across dimensions; and test DimensionSpacePoints """ # neither DE or CH is modified - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_NoDimensions.feature index 012cc9e2d2c..841d8aeb2cd 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/ChangePropertyValue_NoDimensions.feature @@ -39,7 +39,7 @@ Feature: Change Property Scenario: Fixed newValue - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -57,20 +57,20 @@ Feature: Change Property """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | # the node type was changed inside the new content stream - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | Scenario: Ignoring transformation if property does not exist on node - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -87,14 +87,14 @@ Feature: Change Property newSerializedValue: 'fixed value' """ # we did not change anything because notExisting does not exist - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | Scenario: replacement using default currentValuePlaceholder - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -110,14 +110,14 @@ Feature: Change Property property: 'text' newSerializedValue: 'bla {current}' """ - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "bla Original text" | Scenario: replacement using alternative currentValuePlaceholder - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -134,14 +134,14 @@ Feature: Change Property currentValuePlaceholder: '{otherPlaceholder}' newSerializedValue: 'bla {otherPlaceholder}' """ - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "bla Original text" | Scenario: using search/replace - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -158,14 +158,14 @@ Feature: Change Property search: 'Original' replace: 'alternative' """ - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "alternative text" | Scenario: using search/replace including placeholder (all options) - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -183,8 +183,8 @@ Feature: Change Property search: 'Original' replace: 'alternative' """ - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "bla alternative text" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_NodeName_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_NodeName_NoDimensions.feature index 58ac70de9c5..541e7536d75 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_NodeName_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_NodeName_NoDimensions.feature @@ -59,7 +59,7 @@ Feature: Filter - Node Name Scenario: Fixed newValue - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -77,31 +77,31 @@ Feature: Filter - Node Name """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "na-name1" to lead to node cs-identifier;na-name1;{} + Then I expect a node identified by cs-identifier;na-name1;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original name1" | - Then I expect node aggregate identifier "na-name2" to lead to node cs-identifier;na-name2;{} + Then I expect a node identified by cs-identifier;na-name2;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original name2" | - Then I expect node aggregate identifier "na-without-name" to lead to node cs-identifier;na-without-name;{} + Then I expect a node identified by cs-identifier;na-without-name;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "no node name" | # we filter based on the node name - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "na-name1" to lead to node migration-cs;na-name1;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;na-name1;{} to exist in the content graph # only changed here And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - Then I expect node aggregate identifier "na-name2" to lead to node migration-cs;na-name2;{} + Then I expect a node identified by migration-cs;na-name2;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original name2" | - Then I expect node aggregate identifier "na-without-name" to lead to node migration-cs;na-without-name;{} + Then I expect a node identified by migration-cs;na-without-name;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "no node name" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyNotEmpty_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyNotEmpty_NoDimensions.feature index 2f1824103b4..af0abbb43bc 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyNotEmpty_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyNotEmpty_NoDimensions.feature @@ -68,7 +68,7 @@ Feature: Filter - Property not empty Scenario: PropertyNotEmpty - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -86,34 +86,34 @@ Feature: Filter - Property not empty """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "na-name1" to lead to node cs-identifier;na-name1;{} + Then I expect a node identified by cs-identifier;na-name1;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original name1" | - Then I expect node aggregate identifier "na-name2" to lead to node cs-identifier;na-name2;{} + Then I expect a node identified by cs-identifier;na-name2;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "" | - Then I expect node aggregate identifier "na-null-value" to lead to node cs-identifier;na-null-value;{} + Then I expect a node identified by cs-identifier;na-null-value;{} to exist in the content graph And I expect this node to have no properties - Then I expect node aggregate identifier "na-no-text" to lead to node cs-identifier;na-no-text;{} + Then I expect a node identified by cs-identifier;na-no-text;{} to exist in the content graph And I expect this node to not have the property "text" # we filter based on the node name - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "na-name1" to lead to node migration-cs;na-name1;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;na-name1;{} to exist in the content graph # only changed here And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - Then I expect node aggregate identifier "na-name2" to lead to node migration-cs;na-name2;{} + Then I expect a node identified by migration-cs;na-name2;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "" | - Then I expect node aggregate identifier "na-null-value" to lead to node migration-cs;na-null-value;{} + Then I expect a node identified by migration-cs;na-null-value;{} to exist in the content graph And I expect this node to have no properties - Then I expect node aggregate identifier "na-no-text" to lead to node migration-cs;na-no-text;{} + Then I expect a node identified by migration-cs;na-no-text;{} to exist in the content graph And I expect this node to not have the property "text" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyValue_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyValue_NoDimensions.feature index feba97e5a75..565637cc62c 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyValue_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/Filter_PropertyValue_NoDimensions.feature @@ -68,7 +68,7 @@ Feature: Filter - Property Value Scenario: PropertyValue - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -87,34 +87,34 @@ Feature: Filter - Property Value """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "na-name1" to lead to node cs-identifier;na-name1;{} + Then I expect a node identified by cs-identifier;na-name1;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original name1" | - Then I expect node aggregate identifier "na-name2" to lead to node cs-identifier;na-name2;{} + Then I expect a node identified by cs-identifier;na-name2;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "value2" | - Then I expect node aggregate identifier "na-null-value" to lead to node cs-identifier;na-null-value;{} + Then I expect a node identified by cs-identifier;na-null-value;{} to exist in the content graph And I expect this node to have no properties - Then I expect node aggregate identifier "na-no-text" to lead to node cs-identifier;na-no-text;{} + Then I expect a node identified by cs-identifier;na-no-text;{} to exist in the content graph And I expect this node to not have the property "text" # we filter based on the node name - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "na-name1" to lead to node migration-cs;na-name1;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;na-name1;{} to exist in the content graph # only changed here And I expect this node to have the following properties: | Key | Value | | text | "fixed value" | - Then I expect node aggregate identifier "na-name2" to lead to node migration-cs;na-name2;{} + Then I expect a node identified by migration-cs;na-name2;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "value2" | - Then I expect node aggregate identifier "na-null-value" to lead to node migration-cs;na-null-value;{} + Then I expect a node identified by migration-cs;na-null-value;{} to exist in the content graph And I expect this node to have no properties - Then I expect node aggregate identifier "na-no-text" to lead to node migration-cs;na-no-text;{} + Then I expect a node identified by migration-cs;na-no-text;{} to exist in the content graph And I expect this node to not have the property "text" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature index f5f34127cc3..90bf3b31b01 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature @@ -55,7 +55,7 @@ Feature: Move dimension space point | Identifier | Values | Generalizations | | language | mul, de_DE | de_DE->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -68,15 +68,15 @@ Feature: Move dimension space point """ # the original content stream has not been touched When I am in content stream "cs-identifier" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" # we find the node underneath the new DimensionSpacePoint, but not underneath the old. - When I am in content stream "migration-cs" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "de_DE"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de_DE"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de_DE"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de_DE"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" When I run integrity violation detection @@ -95,7 +95,7 @@ Feature: Move dimension space point When I am in workspace "live" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When VisibilityConstraints are set to "withoutRestrictions" - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When VisibilityConstraints are set to "frontend" # we change the dimension configuration @@ -103,7 +103,7 @@ Feature: Move dimension space point | Identifier | Values | Generalizations | | language | mul, de_DE | de_DE->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -119,14 +119,14 @@ Feature: Move dimension space point When I am in workspace "live" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When VisibilityConstraints are set to "withoutRestrictions" - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When VisibilityConstraints are set to "frontend" # The visibility edges were modified - When I am in content stream "migration-cs" and dimension space point {"language": "de_DE"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de_DE"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When VisibilityConstraints are set to "withoutRestrictions" - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de_DE"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de_DE"} to exist in the content graph When VisibilityConstraints are set to "frontend" When I run integrity violation detection @@ -138,7 +138,7 @@ Feature: Move dimension space point | Identifier | Values | Generalizations | | language | mul, ch | ch->mul | - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - @@ -152,7 +152,7 @@ Feature: Move dimension space point Then the last command should have thrown an exception of type "DimensionSpacePointAlreadyExists" Scenario: Error case - the target dimension is not configured - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_Dimensions.feature index b1420081678..8b1992b26ba 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_Dimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_Dimensions.feature @@ -56,7 +56,7 @@ Feature: Adjust node types with a node migration 'Neos.ContentRepository.Testing:OtherDocument': [] """ # we should be able to rename the node type - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -73,18 +73,18 @@ Feature: Adjust node types with a node migration """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" # ... also in the fallback dimension When I am in workspace "live" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" # the node type was changed inside the new content stream - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:OtherDocument" # ... also in the fallback dimension - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:OtherDocument" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_NoDimensions.feature index 5cebe74064f..e3e8696ddf0 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/NodeTypeAdjustment_NoDimensions.feature @@ -54,7 +54,7 @@ Feature: Adjust node types with a node migration 'Neos.ContentRepository.Testing:OtherDocument': [] """ # we should be able to rename the node type - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -71,10 +71,10 @@ Feature: Adjust node types with a node migration """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:Document" # the node type was changed inside the new content stream - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to be of type "Neos.ContentRepository.Testing:OtherDocument" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/PublishingOnSuccess_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/PublishingOnSuccess_NoDimensions.feature new file mode 100644 index 00000000000..813741197ec --- /dev/null +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/PublishingOnSuccess_NoDimensions.feature @@ -0,0 +1,62 @@ +@contentrepository @adapters=DoctrineDBAL +Feature: Publishing on Success + + Background: + Given using no content dimensions + And using the following node types: + """yaml + 'Neos.ContentRepository:Root': + constraints: + nodeTypes: + 'Neos.ContentRepository.Testing:Document': true + 'Neos.ContentRepository.Testing:Document': + properties: + text: + type: string + """ + And using identifier "default", I define a content repository + And I am in content repository "default" + And the command CreateRootWorkspace is executed with payload: + | Key | Value | + | workspaceName | "live" | + | workspaceTitle | "Live" | + | workspaceDescription | "The live workspace" | + | newContentStreamId | "cs-identifier" | + And I am in workspace "live" + And the command CreateRootNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "lady-eleonode-rootford" | + | nodeTypeName | "Neos.ContentRepository:Root" | + # Node /document + When the command CreateNodeAggregateWithNode is executed with payload: + | Key | Value | + | nodeAggregateId | "sir-david-nodenborough" | + | nodeTypeName | "Neos.ContentRepository.Testing:Document" | + | originDimensionSpacePoint | {} | + | parentNodeAggregateId | "lady-eleonode-rootford" | + | initialPropertyValues | {"text": "Original text"} | + + + Scenario: Fixed newValue + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", with publishing on success: + """yaml + migration: + - + filters: + - + type: 'NodeType' + settings: + nodeType: 'Neos.ContentRepository.Testing:Document' + transformations: + - + type: 'ChangePropertyValue' + settings: + property: 'text' + newSerializedValue: 'fixed value' + """ + + When I am in workspace "live" and dimension space point {} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph + And I expect this node to have the following properties: + | Key | Value | + | text | "fixed value" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveNodes_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveNodes_Dimensions.feature index be8af991d95..f3e2bab3a14 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveNodes_Dimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveNodes_Dimensions.feature @@ -49,7 +49,7 @@ Feature: Remove Nodes Scenario: Remove nodes in a given dimension space point removes the node with all virtual specializations - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -69,30 +69,30 @@ Feature: Remove Nodes """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "gsw"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph # the node was removed inside the new content stream, but only in de and gsw (virtual specialization) - When I am in content stream "migration-cs" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "gsw"} + When I am in workspace "migration-workspace" and dimension space point {"language": "gsw"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "en"} to exist in the content graph When I run integrity violation detection Then I expect the integrity violation detection result to contain exactly 0 errors Scenario: Remove nodes in a given dimension space point removes the node without shine-throughs with strategy "allSpecializations" - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -115,30 +115,30 @@ Feature: Remove Nodes # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "gsw"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph # the node was removed inside the new content stream, but only in de and gsw, since it is a specialization - When I am in content stream "migration-cs" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "gsw"} + When I am in workspace "migration-workspace" and dimension space point {"language": "gsw"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "en"} to exist in the content graph When I run integrity violation detection Then I expect the integrity violation detection result to contain exactly 0 errors Scenario: allVariants is not supported in RemoveNode, as this would violate the filter configuration potentially - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - @@ -162,7 +162,7 @@ Feature: Remove Nodes Scenario: Remove nodes in a virtual specialization (gsw) - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -185,30 +185,30 @@ Feature: Remove Nodes # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "gsw"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph # the node was removed inside the new content stream, but only in gsw - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph - When I am in content stream "migration-cs" and dimension space point {"language": "gsw"} + When I am in workspace "migration-workspace" and dimension space point {"language": "gsw"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "en"} to exist in the content graph When I run integrity violation detection Then I expect the integrity violation detection result to contain exactly 0 errors Scenario: Remove nodes in a shine-through dimension space point (gsw) - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -226,30 +226,30 @@ Feature: Remove Nodes # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "gsw"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph # the node was removed inside the new content stream, but only in gsw - When I am in content stream "migration-cs" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "de"} to exist in the content graph - When I am in content stream "migration-cs" and dimension space point {"language": "gsw"} + When I am in workspace "migration-workspace" and dimension space point {"language": "gsw"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{"language": "en"} to exist in the content graph When I run integrity violation detection Then I expect the integrity violation detection result to contain exactly 0 errors Scenario: Remove nodes in a shine-through dimension space point (DE,gsw) - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -272,29 +272,29 @@ Feature: Remove Nodes # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "gsw"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph # the node was removed inside the new content stream, but only in gsw - When I am in content stream "migration-cs" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "gsw"} + When I am in workspace "migration-workspace" and dimension space point {"language": "gsw"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When I run integrity violation detection Then I expect the integrity violation detection result to contain exactly 0 errors Scenario: Remove nodes in a shine-through dimension space point (DE,gsw) - variant 2 - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -310,22 +310,22 @@ Feature: Remove Nodes # the original content stream has not been touched When I am in workspace "live" and dimension space point {"language": "de"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "gsw"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "de"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "de"} to exist in the content graph When I am in workspace "live" and dimension space point {"language": "en"} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{"language": "en"} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{"language": "en"} to exist in the content graph # the node was removed inside the new content stream, but only in gsw - When I am in content stream "migration-cs" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "gsw"} + When I am in workspace "migration-workspace" and dimension space point {"language": "gsw"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node - When I am in content stream "migration-cs" and dimension space point {"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} Then I expect node aggregate identifier "sir-david-nodenborough" to lead to no node When I run integrity violation detection diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveProperty_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveProperty_NoDimensions.feature index 1ff8d98f545..a2d81a9f503 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveProperty_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RemoveProperty_NoDimensions.feature @@ -39,7 +39,7 @@ Feature: Remove Property Scenario: Fixed newValue - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -56,18 +56,18 @@ Feature: Remove Property """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | # the node type was changed inside the new content stream - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have no properties Scenario: Ignoring transformation if property does not exist on node - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -83,8 +83,8 @@ Feature: Remove Property property: 'notExisting' """ # we did not change anything because notExisting does not exist - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameNodeAggregate_Dimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameNodeAggregate_Dimensions.feature index 8c62f0f72fd..32cfbd39cf5 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameNodeAggregate_Dimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameNodeAggregate_Dimensions.feature @@ -50,7 +50,7 @@ Feature: Rename Node Aggregate Scenario: Rename Node Aggregate - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -75,18 +75,18 @@ Feature: Rename Node Aggregate Then I expect the node "sir-david-nodenborough" to have the name "foo" # the node was changed inside the new content stream, across all dimensions - When I am in content stream "migration-cs" and dimension space point {"language": "de"} + When I am in workspace "migration-workspace" and dimension space point {"language": "de"} Then I expect the node "sir-david-nodenborough" to have the name "other" - When I am in content stream "migration-cs" and dimension space point {"language": "ch"} + When I am in workspace "migration-workspace" and dimension space point {"language": "ch"} Then I expect the node "sir-david-nodenborough" to have the name "other" - When I am in content stream "migration-cs" and dimension space point {"language": "en"} + When I am in workspace "migration-workspace" and dimension space point {"language": "en"} Then I expect the node "sir-david-nodenborough" to have the name "other" Scenario: Rename Node Aggregate will fail when restricted to a single Dimension - When I run the following node migration for workspace "live", creating content streams "migration-cs" and exceptions are caught: + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: """yaml migration: - diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameProperty_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameProperty_NoDimensions.feature index cf4fc540c69..d382353d5ec 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameProperty_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/RenameProperty_NoDimensions.feature @@ -52,7 +52,7 @@ Feature: Rename Property newText: type: string """ - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -70,14 +70,14 @@ Feature: Rename Property """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | # the node type was changed inside the new content stream - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | newText | "Original text" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/StripTagsOnProperty_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/StripTagsOnProperty_NoDimensions.feature index 19586ae45ce..4584a2df214 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/StripTagsOnProperty_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/StripTagsOnProperty_NoDimensions.feature @@ -39,7 +39,7 @@ Feature: Strip Tags on Property Scenario: Fixed newValue - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -56,14 +56,14 @@ Feature: Strip Tags on Property """ # the original content stream has not been touched When I am in workspace "live" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node cs-identifier;sir-david-nodenborough;{} + Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original
text
" | # the node type was changed inside the new content stream - When I am in content stream "migration-cs" and dimension space point {} - Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node migration-cs;sir-david-nodenborough;{} + When I am in workspace "migration-workspace" and dimension space point {} + Then I expect a node identified by migration-cs;sir-david-nodenborough;{} to exist in the content graph And I expect this node to have the following properties: | Key | Value | | text | "Original text" | diff --git a/Neos.ContentRepository.NodeMigration/src/Command/ExecuteMigration.php b/Neos.ContentRepository.NodeMigration/src/Command/ExecuteMigration.php index ed34f8d0a43..cd4e43931ba 100644 --- a/Neos.ContentRepository.NodeMigration/src/Command/ExecuteMigration.php +++ b/Neos.ContentRepository.NodeMigration/src/Command/ExecuteMigration.php @@ -22,75 +22,12 @@ */ final class ExecuteMigration { - /** - * @var MigrationConfiguration - */ - private $migrationConfiguration; - - /** - * @var WorkspaceName - */ - private $workspaceName; - - /** - * This property exists mostly for testing, to make the command handler fully deterministic. - * - * A migration file is structured like this: - * migrations: [ - * {filters: ... transformations: ...}, - * {filters: ... transformations: ...} - * ] - * For every "submigration" (i.e. every "line" from above), we fork a new content stream, - * to make the migration roll-back-able. - * In the first "submigration", we use the base content stream identifier (of $workspaceName) for *reading*, and - * use the first content stream identifier of this list for writing. - * In the second "submigration", we use the content stream of the *first* submigration for reading, and the next one - * from this list for writing. - * - * This effectively makes all changes of the first submigration visible in the next submigration. - * - * @var ContentStreamId[] - */ - private $contentStreamIdsForWriting; - - /** - * ExecuteMigration constructor. - * @param MigrationConfiguration $migrationConfiguration - * @param WorkspaceName $workspaceName - * @param ContentStreamId[] $contentStreamIdsForWriting - */ public function __construct( - MigrationConfiguration $migrationConfiguration, - WorkspaceName $workspaceName, - array $contentStreamIdsForWriting = [] + public readonly MigrationConfiguration $migrationConfiguration, + public readonly WorkspaceName $sourceWorkspaceName, + public readonly WorkspaceName $targetWorkspaceName, + public readonly bool $publishOnSuccess, + public readonly ContentStreamId $contentStreamId, ) { - $this->migrationConfiguration = $migrationConfiguration; - $this->workspaceName = $workspaceName; - $this->contentStreamIdsForWriting = array_values($contentStreamIdsForWriting); - } - - /** - * @return MigrationConfiguration - */ - public function getMigrationConfiguration(): MigrationConfiguration - { - return $this->migrationConfiguration; - } - - /** - * @return WorkspaceName - */ - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - - public function getOrCreateContentStreamIdForWriting(int $index): ContentStreamId - { - if (isset($this->contentStreamIdsForWriting[$index])) { - return $this->contentStreamIdsForWriting[$index]; - } - - return ContentStreamId::create(); } } diff --git a/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php b/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php index 4184b8b4569..ba7279ce0c2 100644 --- a/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php +++ b/Neos.ContentRepository.NodeMigration/src/NodeMigrationService.php @@ -12,12 +12,14 @@ use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceDescription; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceTitle; +use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\PublishWorkspace; +use Neos\ContentRepository\Core\Feature\WorkspaceModification\Command\DeleteWorkspace; use Neos\ContentRepository\NodeMigration\Command\ExecuteMigration; use Neos\ContentRepository\NodeMigration\Filter\FiltersFactory; use Neos\ContentRepository\NodeMigration\Filter\InvalidMigrationFilterSpecified; use Neos\ContentRepository\NodeMigration\Transformation\TransformationsFactory; +use Neos\Neos\PendingChangesProjection\ChangeFinder; /** * Node Migrations are manually written adjustments to the Node tree; @@ -59,34 +61,58 @@ public function __construct( public function executeMigration(ExecuteMigration $command): void { - $workspace = $this->contentRepository->getWorkspaceFinder()->findOneByName($command->getWorkspaceName()); - if ($workspace === null) { + $sourceWorkspace = $this->contentRepository->getWorkspaceFinder()->findOneByName($command->sourceWorkspaceName); + if ($sourceWorkspace === null) { throw new WorkspaceDoesNotExist(sprintf( 'The workspace %s does not exist', - $command->getWorkspaceName()->value + $command->sourceWorkspaceName->value ), 1611688225); } - foreach ($command->getMigrationConfiguration()->getMigration() as $step => $migrationDescription) { - $contentStreamForWriting = $command->getOrCreateContentStreamIdForWriting($step); - $workspaceNameForWriting = WorkspaceName::fromString($contentStreamForWriting->value); + $targetWorkspaceWasCreated = false; + if ($targetWorkspace = $this->contentRepository->getWorkspaceFinder()->findOneByName($command->targetWorkspaceName)) { + if (!$this->workspaceIsEmpty($targetWorkspace)) { + throw new MigrationException(sprintf('Target workspace "%s" already exists an is not empty. Please clear the workspace before.', $targetWorkspace->workspaceName->value)); + } + + } else { $this->contentRepository->handle( CreateWorkspace::create( - $workspaceNameForWriting, - $workspace->workspaceName, - WorkspaceTitle::fromString($contentStreamForWriting->value), + $command->targetWorkspaceName, + $sourceWorkspace->workspaceName, + WorkspaceTitle::fromString($command->targetWorkspaceName->value), WorkspaceDescription::fromString(''), - $contentStreamForWriting, + $command->contentStreamId, ) ); + $targetWorkspace = $this->contentRepository->getWorkspaceFinder()->findOneByName($command->targetWorkspaceName); + $targetWorkspaceWasCreated = true; + } + + if($targetWorkspace === null) { + throw new MigrationException(sprintf('Target workspace "%s" could not loaded nor created.', $command->targetWorkspaceName->value)); + } + + foreach ($command->migrationConfiguration->getMigration() as $migrationDescription) { /** array $migrationDescription */ $this->executeSubMigrationAndBlock( $migrationDescription, - $workspace, - $workspaceNameForWriting, - $contentStreamForWriting + $sourceWorkspace, + $targetWorkspace ); } + + if ($command->publishOnSuccess === true) { + $this->contentRepository->handle( + PublishWorkspace::create($command->targetWorkspaceName) + ); + + if ($targetWorkspaceWasCreated === true) { + $this->contentRepository->handle( + DeleteWorkspace::create($command->targetWorkspaceName) + ); + } + } } /** @@ -98,8 +124,7 @@ public function executeMigration(ExecuteMigration $command): void protected function executeSubMigrationAndBlock( array $migrationDescription, Workspace $workspaceForReading, - WorkspaceName $workspaceNameForWriting, - ContentStreamId $contentStreamForWriting + Workspace $workspaceForWriting, ): void { $filters = $this->filterFactory->buildFilterConjunction($migrationDescription['filters'] ?? []); $transformations = $this->transformationFactory->buildTransformation( @@ -128,7 +153,7 @@ protected function executeSubMigrationAndBlock( } if ($transformations->containsGlobal()) { - $transformations->executeGlobalAndBlock($workspaceNameForWriting); + $transformations->executeGlobalAndBlock($workspaceForWriting->workspaceName); } elseif ($transformations->containsNodeAggregateBased()) { $contentGraph = $this->contentRepository->getContentGraph($workspaceForReading->workspaceName); foreach ($contentGraph->findUsedNodeTypeNames() as $nodeTypeName) { @@ -138,7 +163,7 @@ protected function executeSubMigrationAndBlock( ) as $nodeAggregate ) { if ($filters->matchesNodeAggregate($nodeAggregate)) { - $transformations->executeNodeAggregateBasedAndBlock($nodeAggregate, $workspaceNameForWriting, $contentStreamForWriting); + $transformations->executeNodeAggregateBasedAndBlock($nodeAggregate, $workspaceForWriting->workspaceName, $workspaceForWriting->currentContentStreamId); } } } @@ -167,8 +192,8 @@ protected function executeSubMigrationAndBlock( $transformations->executeNodeBasedAndBlock( $node, $coveredDimensionSpacePoints, - $workspaceNameForWriting, - $contentStreamForWriting + $workspaceForWriting->workspaceName, + $workspaceForWriting->currentContentStreamId ); } } @@ -177,4 +202,11 @@ protected function executeSubMigrationAndBlock( } } } + + private function workspaceIsEmpty(Workspace $workspace): bool + { + return $this->contentRepository + ->projectionState(ChangeFinder::class) + ->countByContentStreamId($workspace->currentContentStreamId) === 0; + } } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/MigrationsTrait.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/MigrationsTrait.php index 62f647cd8a9..b02a8e2abed 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/MigrationsTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/MigrationsTrait.php @@ -31,19 +31,17 @@ trait MigrationsTrait use CRTestSuiteRuntimeVariables; /** - * @When I run the following node migration for workspace :workspaceName, creating content streams :contentStreams: + * @When I run the following node migration for workspace :sourceWorkspaceName, creating target workspace :targetWorkspaceName on contentStreamId :contentStreamId, with publishing on success: */ - public function iRunTheFollowingNodeMigration(string $workspaceName, string $contentStreams, PyStringNode $string): void + public function iRunTheFollowingNodeMigrationWithTargetWorkspace(string $sourceWorkspaceName, string $targetWorkspaceName, string $contentStreamId, PyStringNode $string, bool $publishingOnSuccess = true): void { $migrationConfiguration = new MigrationConfiguration(Yaml::parse($string->getRaw())); - $contentStreamIds = array_map( - fn (string $cs) => ContentStreamId::fromString($cs), - explode(',', $contentStreams) - ); $command = new ExecuteMigration( $migrationConfiguration, - WorkspaceName::fromString($workspaceName), - $contentStreamIds + WorkspaceName::fromString($sourceWorkspaceName), + WorkspaceName::fromString($targetWorkspaceName), + $publishingOnSuccess, + ContentStreamId::fromString($contentStreamId) ); /** @var NodeMigrationService $nodeMigrationService */ @@ -52,12 +50,20 @@ public function iRunTheFollowingNodeMigration(string $workspaceName, string $con } /** - * @When I run the following node migration for workspace :workspaceName, creating content streams :contentStreams and exceptions are caught: + * @When I run the following node migration for workspace :sourceWorkspaceName, creating target workspace :targetWorkspaceName on contentStreamId :contentStreamId, without publishing on success: + */ + public function iRunTheFollowingNodeMigrationWithoutPublishingOnSuccess(string $sourceWorkspaceName, string $targetWorkspaceName, string $contentStreamId, PyStringNode $string): void + { + $this->iRunTheFollowingNodeMigrationWithTargetWorkspace($sourceWorkspaceName, $targetWorkspaceName, $contentStreamId, $string, false); + } + + /** + * @When I run the following node migration for workspace :sourceWorkspaceName, creating target workspace :targetWorkspaceName on contentStreamId :contentStreamId and exceptions are caught: */ - public function iRunTheFollowingNodeMigrationAndExceptionsAreCaught(string $workspaceName, string $contentStreams, PyStringNode $string): void + public function iRunTheFollowingNodeMigrationAndExceptionsAreCaught(string $sourceWorkspaceName, string $targetWorkspaceName, string $contentStreamId, PyStringNode $string): void { try { - $this->iRunTheFollowingNodeMigration($workspaceName, $contentStreams, $string); + $this->iRunTheFollowingNodeMigrationWithTargetWorkspace($sourceWorkspaceName, $targetWorkspaceName, $contentStreamId, $string); } catch (\Exception $exception) { $this->lastCommandException = $exception; } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php index ad96bdacce4..b227c5660b6 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php @@ -19,7 +19,6 @@ use Neos\ContentRepository\Core\ContentGraphFinder; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\NodeType\NodeTypeName; -use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\ContentSubgraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindBackReferencesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/NodeMigrationCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/NodeMigrationCommandController.php index 3aac4cd033d..8a361a21acd 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/NodeMigrationCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/NodeMigrationCommandController.php @@ -13,6 +13,7 @@ */ use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; +use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepository\NodeMigration\Command\ExecuteMigration; use Neos\ContentRepository\NodeMigration\Command\MigrationConfiguration; @@ -34,7 +35,6 @@ #[Flow\Scope('singleton')] class NodeMigrationCommandController extends CommandController { - public function __construct( private readonly MigrationFactory $migrationFactory, private readonly ContentRepositoryRegistry $contentRepositoryRegistry, @@ -48,15 +48,18 @@ public function __construct( * Do the configured migrations in the given migration. * * @param string $version The version of the migration configuration you want to use. - * @param string $workspace The workspace where the migration should be applied; by default "live" + * @param string $sourceWorkspace The workspace where the migration should be applied; by default "live" + * @param bool $publishOnSuccess If true, the changes get published automatically after successful apply (default: true). * @param boolean $force Confirm application of this migration, only needed if the given migration contains any warnings. * @param string $contentRepository Identifier of the content repository. (Default: 'default') * @return void * @throws StopCommandException * @see neos.contentrepositoryregistry:nodemigration:execute */ - public function executeCommand(string $version, string $workspace = 'live', bool $force = false, string $contentRepository = 'default'): void + public function executeCommand(string $version, string $sourceWorkspace = 'live', bool $publishOnSuccess = true, bool $force = false, string $contentRepository = 'default'): void { + $sourceWorkspaceName = WorkspaceName::fromString($sourceWorkspace); + $targetWorkspaceName = WorkspaceName::fromString(sprintf('migration-%s-%s', $sourceWorkspaceName->value, $version)); $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); try { @@ -74,14 +77,26 @@ public function executeCommand(string $version, string $workspace = 'live', bool $nodeMigrationService->executeMigration( new ExecuteMigration( $migrationConfiguration, - WorkspaceName::fromString($workspace) + $sourceWorkspaceName, + $targetWorkspaceName, + $publishOnSuccess, + ContentStreamId::create() ) ); + $this->outputLine(); $this->outputLine('Successfully applied migration.'); + if ($publishOnSuccess) { + $this->outputLine('You should rebase all outdated workspaces to ensure every workspace get the changes immediately. `./flow workspace:rebaseoutdated`'); + } else { + $this->outputLine(sprintf('We created a workspace "%s" for review. Please review changes an publish them to "%s".', $targetWorkspaceName->value, $sourceWorkspaceName->value)); + $this->outputLine('You should rebase all outdated workspaces after publishing to ensure every workspace get the changes immediately. `./flow workspace:rebaseoutdated`'); + } + } catch (MigrationException $e) { $this->outputLine(); - $this->outputLine('Error: ' . $e->getMessage()); + $this->outputLine('Error on applying node migrations:'); + $this->outputLine($e->getMessage()); $this->quit(1); } } diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature index 0291ba17882..f0e4169fe36 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/Dimensions.feature @@ -183,7 +183,7 @@ Feature: Routing functionality with multiple content dimensions en: '' """ - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-cs" on contentStreamId "migration-cs", without publishing on success: """yaml migration: - @@ -252,7 +252,7 @@ Feature: Routing functionality with multiple content dimensions en: '' """ And the node "carl-destinode" in content stream "cs-identifier" and dimension '{"market":"DE", "language":"at"}' should not resolve to an URL - When I run the following node migration for workspace "live", creating content streams "migration-cs": + When I run the following node migration for workspace "live", creating target workspace "migration-cs" on contentStreamId "migration-cs", without publishing on success: """yaml migration: -