Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add failing tests for workspace publish #4897

Open
wants to merge 3 commits into
base: 9.0
Choose a base branch
from

Conversation

pKallert
Copy link
Contributor

I created a failing test for #4783

Apparently, the problem here is the command PublishIndividualNodesFromWorkspace. This command is used by the Neos UI to publish simple changes.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@mhsdesign
Copy link
Member

Thanks for writing the test looks perfect :D

Then the last command should have thrown an exception of type "BaseWorkspaceHasBeenModifiedInTheMeantime"

now we just have to fix this, which should be fairly simple by adding a constraint check in the handlePublishIndividualNodesFromWorkspace no? Like checking that neither workspace nor baseWorkspace must be outdated.
That might be it.

@bwaidelich
Copy link
Member

@pKallert wonderful, thank you!

now we just have to fix this, which should be fairly simple by adding a constraint check in the handlePublishIndividualNodesFromWorkspace no?

A constraint check would probably be the first step. But there's still a risk for race conditions, so IMO we need #4692 for this – or at least the part that replaces ExpectedVersion::ANY() with ExpectedVersion::fromVersion($contentStreamVersion->unwrap())

@nezaniel
Copy link
Member

WorkspaceCommandHandler::handlePublishIndividualNodesFromWorkspace does an implicit rebase by forking a new content stream from the base workspace and then re-applying the commands, so we avoid ConcurrencyException by design.
To test for actual concurrency handling, we introduced parallel tests (see composer test:parallel).

So I think we can close this, any objections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants