shopware / shopware

Shopware 6 is an open commerce platform based on Symfony Framework and Vue and supported by a worldwide community and more than 1.500 community extensions
https://shopware.com
MIT License
2.81k stars 1.02k forks source link

TestBootstrapper forced Shopware install uses stale plugins configuration #3078

Open DCoderLT opened 1 year ago

DCoderLT commented 1 year ago

PHP Version

8.2

Shopware Version

6.5.0.0

Expected behaviour

When I use TestBoostrapper and force a Shopware reinstall, the system should not execute any code from plugins before plugins are actually registered.

Actual behaviour

When \Shopware\Core\Kernel boots, it picks up active plugins from the database. When TestBoostrapper forces a reinstall through system:install, the kernel is not rebooted after dropping the db - those active plugins are still registered, but their DB schema is now gone. After system:install drops the db and runs the core migrations, it will call dal:refresh:index. If one of those stale plugins had a service tagged shopware.entity_indexer, this service will be triggered, and i that service was not written defensively, it can crash with a missing DB table or a similar problem. If that crash happens, the test database no longer contains the problematic plugin, so the next time TestBootstrapper boots, it will not register the plugin/indexer, and the test run will complete successfully. But if the test bootstrapper installs that poisonous plugin, the next test run will crash again... and the test runner will flip-flop between running and crashing with every run.

I imagine that this is not limited to an entity indexer, and there are other scenarios where using those stale services can cause a problem.

How to reproduce

shopware-issue-bot[bot] commented 1 year ago

We found the following existing issues which may help or are related to your topic:

MarcelSchmaeing commented 2 months ago

Hi,

thx for your issue we will put it into our new evaluation process and have a look at it again.

shopwareBot commented 2 months ago

[public] Automated response: This issue is linked to the internal issue https://shopware.atlassian.net/browse/NEXT-37957.

[created from NEXT-37957, comment 489033]