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

[Forwardport] Add argument on app:config:dump to skip dumping all system settings. #14807

Conversation

ihor-sviziev
Copy link
Contributor

Original Pull Request

#12410

Description

Add option config-types on app:config:dump to skip dumping all system settings. That allows to dump only scope, theme for easier maintainability.

Fixed Issues

When using app:config:dump in real projects, we normally do not want to dump all thousands core_config_data settings into config files. That makes the files difficult to read and maintain. Imho dumping scopes and themes 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 for PRD and Build systems. These settings should be just a few, like for example css and js configuration needed for setup:static-content:deploy. Of course others settings might be needed depending on the project but all the others are better managed into core_config_data table or by using setup scripts.

This new option config-types makes possible to dump scopes and themes automatically (needed for build system) while managing system settings manually using config:set --lock-config as requested in PR:

It also fixes this issue:

Manual testing scenarios

Example of workflow on a real project:

  1. When creating the project we dump all settings with app:config:dump scopes themes

  2. That creates the needed settings for scopes and themes but skips system core config data

  3. We also add shared settings needed for PRD and Build environments

    bin/magento config:set --lock-config dev/js/merge_files 1
    bin/magento config:set --lock-config dev/css/merge_css_files 1
    bin/magento config:set --lock-config dev/static/sign 1
    
  4. As project evolves, we add a new stores and themes, so we need to update our config.php settings.

    bin/magento app:config:dump  scopes themes
    
  5. At the same time, if we ever need to share system settings on all environments, we can use the command bin/magento config:set --lock-config without needing to dump all hundreds of settings into the config.php

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

@ihor-sviziev ihor-sviziev deleted the 2.3-develop-PR-port-12410 branch May 31, 2018 13:31
magento-engcom-team pushed a commit that referenced this pull request Jul 3, 2018
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.

4 participants