Decouple setup/ runtime classes from production artifact#40696
Open
lbajsarowicz wants to merge 1 commit intomagento:2.4-developfrom
Open
Decouple setup/ runtime classes from production artifact#40696lbajsarowicz wants to merge 1 commit intomagento:2.4-developfrom
lbajsarowicz wants to merge 1 commit intomagento:2.4-developfrom
Conversation
…pendency Move runtime-critical classes out of setup/ into Framework so that setup/ can be excluded from production deployments without breaking bin/magento. Changes: - Move SchemaSetupInterface impl to Framework\Setup\SchemaSetup - Move ModuleDataSetupInterface impl to Framework\Setup\ModuleDataSetup - Move SetupCache to Framework\Setup\SetupCache - Move AbstractSetupCommand to Framework\Console\Command - Update app/etc/di.xml preferences to point to Framework classes - Update Backend maintenance commands to use Framework namespace - Make Cli.php tolerant of missing setup/ directory (file_exists guard) - Old setup/ classes now extend Framework ones (backwards compatible) Resolves: magento#40695
|
Hi @lbajsarowicz. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
Contributor
Author
|
@magento run all tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves runtime-critical classes out of the
setup/directory intolib/internal/Magento/Framework/so thatsetup/can be safely excluded from production deployments without breakingbin/magento.Currently, every
bin/magentoinvocation — includingcache:flush,indexer:reindex,cron:run— crashes ifsetup/is missing, becauseCli.phpunconditionally requiressetup/config/application.config.phpandapp/etc/di.xmlmaps core interfaces toMagento\Setup\*classes.This is the first backwards-compatible step toward fully removing
setup/from production artifacts.Changes
1. Move runtime DI implementations to Framework
Magento\Setup\Module\Setup→Magento\Framework\Setup\SchemaSetupMagento\Setup\Module\DataSetup→Magento\Framework\Setup\ModuleDataSetupMagento\Setup\Module\Setup\SetupCache→Magento\Framework\Setup\SetupCacheapp/etc/di.xmlpreferences to point to new Framework classes2. Move AbstractSetupCommand to Framework
Magento\Setup\Console\Command\AbstractSetupCommand→Magento\Framework\Console\Command\AbstractSetupCommandMagento\Backendmaintenance commands to use new namespace3. Make Cli.php setup-tolerant
Cli::__construct()now checksfile_exists()before loadingsetup/config/application.config.phpsetup/is absent, non-setup commands (cache:*,indexer:*,cron:*) work normally4. Backwards compatibility
All old classes in
setup/src/now extend their new Framework counterparts:Third-party extensions using
Magento\Setup\*classes continue to work without changes.Test plan
bin/magento setup:upgradeworks withsetup/presentbin/magento setup:di:compileworks withsetup/presentbin/magento cache:flushworks withsetup/presentbin/magento cache:flushworks withsetup/removed (new capability)bin/magento indexer:reindexworks withsetup/removedMagento\Setup\Module\Setupstill work (BC alias)Magento\Setup\Console\Command\AbstractSetupCommandstill work (BC alias)maintenance:status,maintenance:enable,maintenance:allow-ipscommands workResolves #40695
⭐ Support my work
Do you like the fix? Remember to react with "👍🏻" to get it merged faster,
Then Sponsor me on Github so I can spend more time on fixing issues like this one.
Learn more at https://github.com/sponsors/lbajsarowicz