Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/9.0' into feature/workspace-reba…
Browse files Browse the repository at this point in the history
…se-confirmation
  • Loading branch information
mhsdesign committed Jan 29, 2025
2 parents 165416d + 3163877 commit e687b49
Show file tree
Hide file tree
Showing 107 changed files with 1,037 additions and 1,009 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Feature: Set node properties: Constraint checks
| Key | Value |
| nodeAggregateId | "lady-eleonode-rootford" |
| originDimensionSpacePoint | {"language":"de"} |
| propertyValues | {} |
| propertyValues | {"text":"New text"} |
Then the last command should have thrown an exception of type "NodeAggregateIsRoot"

Scenario: Try to set properties in an origin dimension space point that does not exist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,28 @@ Feature: Discard individual nodes (basics)
And I expect this node to have the following properties:
| Key | Value |
| image | "Initial image" |
Scenario: Discard no node, non existing ones or unchanged nodes is a no-op
# no node
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
Scenario: Discard no node is not allowed
When the command DiscardIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToDiscard | [] |
| newContentStreamId | "user-cs-identifier-new" |
Then I expect the content stream "user-cs-identifier-new" to not exist
Then the last command should have thrown an exception of type "InvalidArgumentException" with code 1737448741
Scenario: Discard non existing nodes or unchanged nodes is skipped (via exception)
# unchanged or non existing nodes
When the command DiscardIndividualNodesFromWorkspace is executed with payload:
When the command DiscardIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToDiscard | ["non-existing-node", "sir-unchanged"] |
| newContentStreamId | "user-cs-identifier-new-two" |
Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1737477674 and message:
"""
No nodes matched in workspace "user-test" the filter non-existing-node,sir-unchanged.
"""
# all nodes are still on the original user cs
When I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node user-cs-identifier;sir-david-nodenborough;{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ Feature: Change base workspace works :D what else
| baseWorkspaceName | "live" |
| newContentStreamId | "shared-cs-identifier" |

Scenario: Change base workspace is a no-op if the base already matches
When the command ChangeBaseWorkspace is executed with payload:
Scenario: Change base workspace is skipped (via exception) if the base already matches
When the command ChangeBaseWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| baseWorkspaceName | "live" |
Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1737534132 and message:
"""
Skipped changing the base workspace to "live" from workspace "user-test" because its already set.
"""

Then I expect exactly 1 event to be published on stream "Workspace:user-test"
And event at index 0 is of type "WorkspaceWasCreated" with payload:
Expand All @@ -65,38 +69,6 @@ Feature: Change base workspace works :D what else
Given I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{}

Scenario: Change base workspace is a no-op if the base already matches but the workspace is outdated
When the command CreateNodeAggregateWithNode is executed with payload:
| Key | Value |
| workspaceName | "live" |
| nodeAggregateId | "holy-nody" |
| nodeTypeName | "Neos.ContentRepository.Testing:Content" |
| originDimensionSpacePoint | {} |
| parentNodeAggregateId | "lady-eleonode-rootford" |
| initialPropertyValues | {"text": "New node in live"} |

Then workspaces user-test has status OUTDATED

When the command ChangeBaseWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
| baseWorkspaceName | "live" |

Then workspaces user-test has status OUTDATED

Then I expect exactly 1 event to be published on stream "Workspace:user-test"
And event at index 0 is of type "WorkspaceWasCreated" with payload:
| Key | Expected |
| workspaceName | "user-test" |
| baseWorkspaceName | "live" |
| newContentStreamId | "user-cs-identifier" |

Given I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "holy-nody" to lead to no node

Given I am in workspace "live" and dimension space point {}
Then I expect node aggregate identifier "holy-nody" to lead to node cs-identifier;holy-nody;{}

Scenario: Change base workspace if user has no changes and is up to date with new base
When the command ChangeBaseWorkspace is executed with payload:
| Key | Value |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ Feature: Rebasing with no conflict

Then workspaces live,user-test have status UP_TO_DATE

Scenario: Rebase is a no-op if there are no changes
When the command RebaseWorkspace is executed with payload:
Scenario: Rebase is skipped (via exception) if there are no changes
When the command RebaseWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| rebasedContentStreamId | "user-cs-rebased" |
Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1730463693 and message:
"""
Skipped rebase workspace "user-test" because it is not outdated.
"""
Then I expect the content stream "user-cs-rebased" to not exist

When I am in workspace "live" and dimension space point {}
Expand All @@ -62,6 +66,14 @@ Feature: Rebasing with no conflict
| rebaseErrorHandlingStrategy | "force" |
Then I expect the content stream "user-cs-identifier" to not exist

Then I expect exactly 2 events to be published on stream with prefix "Workspace:user-test"
And event at index 1 is of type "WorkspaceWasRebased" with payload:
| Key | Expected |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-rebased" |
| previousContentStreamId | "user-cs-identifier" |
| skippedEvents | [] |

When I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "sir-david-nodenborough" to lead to node user-cs-rebased;sir-david-nodenborough;{}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ Feature: Workspace rebasing - conflicting changes
| rebasedContentStreamId | "user-cs-identifier-rebased" |
| rebaseErrorHandlingStrategy | "force" |

Then I expect exactly 2 events to be published on stream with prefix "Workspace:user-ws"
And event at index 1 is of type "WorkspaceWasRebased" with payload:
| Key | Expected |
| workspaceName | "user-ws" |
| newContentStreamId | "user-cs-identifier-rebased" |
| previousContentStreamId | "user-cs-identifier" |
| skippedEvents | [12,14] |

Then I expect the content stream "user-cs-identifier" to not exist
Then I expect the content stream "user-cs-identifier-rebased" to exist

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Feature: Workspace based content publishing

When the command SetNodeProperties is executed with payload:
| Key | Value |
| workspaceName | "live" |
| workspaceName | "user-test" |
| nodeAggregateId | "nody-mc-nodeface" |
| originDimensionSpacePoint | {} |
| propertyValues | {"text": "Modified anew"} |
Expand All @@ -177,15 +177,20 @@ Feature: Workspace based content publishing
| Key | Value |
| text | "Modified anew" |

Scenario: Publish is a no-op if there are no changes
Scenario: Publish is skipped (via exception) if there are no changes
And I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{}

And the command PublishWorkspace is executed with payload:
And the command PublishWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-new" |

Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1730463156 and message:
"""
Skipped publish workspace "user-test" without any publishable changes.
"""

# the user and live workspace are unchanged
Then I expect exactly 1 event to be published on stream "Workspace:user-test"
Then I expect exactly 1 event to be published on stream "ContentStream:user-cs-identifier"
Expand All @@ -196,22 +201,27 @@ Feature: Workspace based content publishing
Then I expect exactly 4 events to be published on stream "ContentStream:cs-identifier"
Then I expect exactly 1 event to be published on stream "Workspace:live"

Scenario: Publish is a no-op if there are no changes (and the workspace is outdated)
Scenario: Publish is skipped (via exception) if there are no changes (and the workspace is outdated)
And the command SetNodeProperties is executed with payload:
| Key | Value |
| workspaceName | "live" |
| nodeAggregateId | "nody-mc-nodeface" |
| originDimensionSpacePoint | {} |
| propertyValues | {"text": "Modified in live workspace"} |

And the command PublishWorkspace is executed with payload:
And the command PublishWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-new" |

Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1730463156 and message:
"""
Skipped publish workspace "user-test" without any publishable changes.
"""

Then workspaces user-test has status OUTDATED

Then I expect exactly 1 events to be published on stream with prefix "Workspace:user-test"

And I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to node user-cs-identifier;nody-mc-nodeface;{}
And I expect this node to have the following properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Feature: Individual node publication
Then I expect a node identified by cs-identifier;sir-david-nodenborough;{} to exist in the content graph


Scenario: Partial publish is a no-op if the workspace doesnt contain any changes (and the workspace is outdated)
Scenario: Partial publish is skipped (via exception) if the workspace doesnt contain any changes (and the workspace is outdated)

When the command CreateNodeAggregateWithNode is executed with payload:
| Key | Value |
Expand All @@ -85,11 +85,17 @@ Feature: Individual node publication
And I am in workspace "user-test" and dimension space point {}
Then I expect node aggregate identifier "nody-mc-nodeface" to lead to no node

When the command PublishIndividualNodesFromWorkspace is executed with payload:
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | ["non-existing"] |
| contentStreamIdForRemainingPart | "user-cs-new" |

Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1730463156 and message:
"""
Skipped publish workspace "user-test" without any publishable changes.
"""

Then workspaces user-test has status OUTDATED

And I am in workspace "user-test" and dimension space point {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,28 @@ Feature: Publishing individual nodes (basics)
| Key | Value |
| image | "Modified image" |
Scenario: Publish no node, non existing ones or unchanged nodes is a no-op
# no node
When the command PublishIndividualNodesFromWorkspace is executed with payload:
Scenario: Publish no node is not allowed
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | [] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
Then I expect the content stream "user-cs-identifier-remaining" to not exist
Then the last command should have thrown an exception of type "InvalidArgumentException" with code 1737448717
Scenario: Publish non existing nodes or unchanged nodes is skipped (via exception)
# unchanged or non existing nodes
When the command PublishIndividualNodesFromWorkspace is executed with payload:
| Key | Value |
| workspaceName | "user-test" |
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | ["non-existing-node", "sir-unchanged"] |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining-two" |
| contentStreamIdForRemainingPart | "user-cs-identifier-remaining" |
Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1737477674 and message:
"""
No nodes matched in workspace "user-test" the filter non-existing-node,sir-unchanged.
"""
Then I expect the content stream "user-cs-identifier-remaining" to not exist
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;{}
Expand Down Expand Up @@ -288,11 +295,17 @@ Feature: Publishing individual nodes (basics)
| originDimensionSpacePoint | {} |
| propertyValues | {"text": "Modified in live workspace"} |
When the command PublishIndividualNodesFromWorkspace is executed with payload:
When the command PublishIndividualNodesFromWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| nodesToPublish | ["non-existing"] |
| contentStreamIdForRemainingPart | "user-cs-new" |
Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1737477674 and message:
"""
No nodes matched in workspace "user-test" the filter non-existing.
"""
Then workspaces user-test has status OUTDATED
Then I expect exactly 1 events to be published on stream with prefix "Workspace:user-test"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,16 @@ Feature: Workspace discarding - basic functionality
| originDimensionSpacePoint | {} |
| propertyValues | {"text": "Modified in live workspace"} |

And the command DiscardWorkspace is executed with payload:
And the command DiscardWorkspace is executed with payload and exceptions are caught:
| Key | Value |
| workspaceName | "user-test" |
| newContentStreamId | "user-cs-two-discarded" |

Then the last command should have thrown an exception of type "WorkspaceCommandSkipped" with code 1730463156 and message:
"""
Skipped discard workspace "user-test" without any publishable changes.
"""

Then workspaces user-test has status OUTDATED

Then I expect exactly 1 events to be published on stream with prefix "Workspace:user-test"
Expand Down
Loading

0 comments on commit e687b49

Please sign in to comment.