-
Notifications
You must be signed in to change notification settings - Fork 25
refactor: remove validation from converter #79
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
refactor: remove validation from converter #79
Conversation
…to feature/migration-logging-refactor
…are/SwagMigrationAssistant into feature/migration-logging-refactor
…are/SwagMigrationAssistant into feature/migration-logging-refactor
…are/SwagMigrationAssistant into feature/migration-logging-refactor
…are/SwagMigrationAssistant into 13124/remove-validation-from-converter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Shopware migration assistant to handle edge cases more gracefully by moving validation logic from converters to writers and making the conversion process more permissive. The key changes include:
- Removing early returns from converters when optional data is missing, allowing partial conversions to proceed
- Adding filtering logic to writers to prevent overwriting locked/system-default data
- Replacing
$this->getContainer()withstatic::getContainer()throughout test files for consistency - Updating fixture outputs to reflect new conversion behavior for previously rejected edge cases
Reviewed Changes
Copilot reviewed 119 out of 119 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/Profile/Shopware6/Writer/ProductSortingWriter.php |
Adds constructor and writeData method to filter out locked product sortings before writing |
src/Profile/Shopware6/Writer/CmsPageWriter.php |
Adds writeData method to filter out locked CMS pages before writing |
src/Profile/Shopware6/Converter/TaxRuleConverter.php |
Refactors to continue conversion even when optional associations are missing |
src/Profile/Shopware6/Converter/SeoUrlConverter.php |
Removes early return for unmodified SEO URLs, makes foreignKey conversion conditional |
src/Profile/Shopware6/Converter/ProductSortingConverter.php |
Removes locked product sorting check from converter (moved to writer) |
src/Profile/Shopware6/Converter/NumberRangeConverter.php |
Makes type lookup non-blocking, allows conversion without valid type |
src/Profile/Shopware6/Converter/MediaFolderConverter.php |
Restructures logic to handle edge case for digital products media folder |
src/Profile/Shopware6/Converter/MailTemplateConverter.php |
Makes mail template type lookup non-blocking |
src/Profile/Shopware6/Converter/DocumentConverter.php |
Makes document type lookup non-blocking |
src/Profile/Shopware6/Converter/DocumentBaseConfigConverter.php |
Makes document type lookup non-blocking |
src/Profile/Shopware6/Converter/CustomerWishlistConverter.php |
Removes customer and sales channel validation from converter |
src/Profile/Shopware6/Converter/CmsPageConverter.php |
Removes locked CMS page handling from converter (moved to writer) |
src/Profile/Shopware6/Converter/CategoryCmsPageAssociationConverter.php |
Makes CMS page mapping lookup non-blocking |
src/Profile/Shopware/Converter/* |
Multiple converters refactored to remove strict validation and allow partial conversions |
src/Migration/Writer/SeoUrlWriter.php |
Filters out modified SEO URLs before writing |
src/Migration/Writer/LanguageWriter.php |
Adds constructor and writeData to filter existing languages |
tests/**/* |
Updates getContainer() to static::getContainer() and adjusts test expectations |
tests/_fixtures/**/* |
Updates test fixtures to reflect new conversion behavior |
src/DependencyInjection/*.xml |
Adds required service dependencies for new writer logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please add a short PR description 🙂 . E.g. questions I would like to see answered in it:
|
…are/SwagMigrationAssistant into 13124/remove-validation-from-converter
…are/SwagMigrationAssistant into 13124/remove-validation-from-converter
44cdc50 to
92419d8
Compare
ennasus4sun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 💪🏻
MalteJanz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still have to look further (didn't had the time yet for a full review) 🙈 .
And guys, please review and test this very carefully. Because we can easily introduce new bugs here, especially as our acceptance tests aren't running right now in the feature branch
| // TODO: fix & update snapshots | |
| // eslint-disable-next-line playwright/no-skipped-test | |
| test.skip(); |
…are/SwagMigrationAssistant into 13124/remove-validation-from-converter
MalteJanz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After my open comments are solved: LGTM, nice job, this was quite a task 💪
tests/_fixtures/Shopware6/CustomerWishlist/02-CustomerNotFound/output.php
Outdated
Show resolved
Hide resolved
tests/_fixtures/Shopware6/CustomerWishlist/03-SalesChannelNotFound/output.php
Outdated
Show resolved
Hide resolved
tests/_fixtures/Shopware6/MediaFolder/04-DigitalProductsMediaFolder/output.php
Outdated
Show resolved
Hide resolved
…are/SwagMigrationAssistant into 13124/remove-validation-from-converter
5d4ec50
into
feature/migration-logging-refactor
Remove all checks, which results in an empty Convert Result. These should be catches by the later entity validation