[Forwardport] Add argument on app:config:dump to skip dumping all system settings. #14807
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.
Original Pull Request
#12410
Description
Add option
config-types
onapp:config:dump
to skip dumping all system settings. That allows to dump onlyscope
,theme
for easier maintainability.Fixed Issues
When using
app:config:dump
in real projects, we normally do not want to dump all thousandscore_config_data
settings into config files. That makes the files difficult to read and maintain. Imho dumpingscopes
andthemes
makes a lot of sense. However, the system settings should be kept small and simple. They must be progressively added according to project needs.On the other hand, the main purpose of
config.php
is to propagate configuration that must be same in all environments, specially forPRD
andBuild
systems. These settings should be just a few, like for examplecss
andjs
configuration needed forsetup:static-content:deploy
. Of course others settings might be needed depending on the project but all the others are better managed intocore_config_data
table or by using setup scripts.This new option
config-types
makes possible to dumpscopes
andthemes
automatically (needed for build system) while managing system settings manually usingconfig:set --lock-config
as requested in PR:It also fixes this issue:
Manual testing scenarios
Example of workflow on a real project:
When creating the project we dump all settings with
app:config:dump scopes themes
That creates the needed settings for
scopes
andthemes
but skipssystem
core config dataWe also add shared settings needed for
PRD
andBuild
environmentsAs project evolves, we add a new stores and themes, so we need to update our
config.php
settings.At the same time, if we ever need to
share
system settings on all environments, we can use the commandbin/magento config:set --lock-config
without needing to dump all hundreds of settings into theconfig.php
Contribution checklist