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

BUGFIX: Duplicated content stream in import and export #4914

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Feb 27, 2024

Resolves: #4298
Replaces: #4674

Neos.Demo adjustments: neos/Neos.Demo#191
Neos.Ui adjustments (for the e2e test exports): neos/neos-ui#3729

The ContentStreamWasCreated will NOT be part of the export, as we only export one stream, and only live per jsonl file.
(In a later step we might also remove the contentstream field of the event payload, as this might not be used at all)
Additionally the importer will ignore any ContentStreamWasCreated events and raise a warning.

Upgrade instructions

Review instructions

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

If still imported the importer should log an error.
@mhsdesign mhsdesign force-pushed the bugfix/4298-dublicated-contentstream-in-import-and-export branch from f635049 to 918f131 Compare February 27, 2024 11:07
@@ -16,7 +18,7 @@
/**
* Processor that exports all events of the live workspace to an "events.jsonl" file
*/
final class EventExportProcessor implements ProcessorInterface
final class EventExportProcessor implements ProcessorInterface, ContentRepositoryServiceInterface
Copy link
Member Author

@mhsdesign mhsdesign Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i made them a cr service so i can instantiate them without much hassle in the tests. As we just had a major discussion about to refactor a lot of thing either way, i think its fine to do this, as this code will be refactored afterwards ^^

@mhsdesign mhsdesign force-pushed the bugfix/4298-dublicated-contentstream-in-import-and-export branch from 82d84cc to 75e53d0 Compare March 11, 2024 14:35
@mhsdesign mhsdesign merged commit e9ec798 into neos:9.0 Mar 11, 2024
8 checks passed
Copy link
Member

@bwaidelich bwaidelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too late to the party, but I wonder why this adds a ./flow doctrine:migrate and ./flow cr:setup invokation in the default context within the test script?

"@test:behat-cli -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist"
"@test:behat-cli -c Neos.ContentRepository.Export/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This puzzles me!?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for keeping things tidy. Its different than you think ;)
I just moved the "../../flow doctrine:migrate --quiet; ../../flow cr:setup part two lines below as its only seemingly required for the Neos.Neos tests and not the rest.
We should definitely get rid of this hack and its only needed in the ci but idk why;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah and believe me im also confused about the fact its in the default development context ... seems to fix a glitch will take care of this at one point ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, this wasn't introduced with your PR but much earlier
But..

./flow cr:setup

in development context has nothing to do with the behat context – or only by accident.

Are you sure that this fixes a glitch, or did we just drag this along?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mhsdesign lets see what the CI says: #5005

"@test:behat-cli -vvv --stop-on-failure -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist"
"@test:behat-cli -vvv --stop-on-failure -c Neos.ContentRepository.Export/Tests/Behavior/behat.yml.dist",
"@test:behat-cli -vvv --stop-on-failure -c Neos.TimeableNodeVisibility/Tests/Behavior/behat.yml.dist",
"../../flow doctrine:migrate --quiet; ../../flow cr:setup",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.and this

@mhsdesign mhsdesign deleted the bugfix/4298-dublicated-contentstream-in-import-and-export branch April 22, 2024 12:26
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.

BUG: Importing a dump via cr:import will create duplicate content stream entries
4 participants