Magento2: CLI command missing `config:delete`

Created on 13 Mar 2020  路  16Comments  路  Source: magento/magento2

Description (*)

The same way that we have config:set for setting configuration value globally or for a specific value, we should have option to remove the configuration value with config:delete with the same set of flags that config:set has.

Expected behaviour (*)

The result of such action would be Use system value where applicable or rolling back the default value provided in config.xml by default.

Benefits

For me, it's useful for Functional Tests, as we run some environmental configurations during tests, and then I'd love to have the possibility of rolling back settings to defaults.

Additional information


CC: @dmytro-ch

Config ready for confirmation P3 ready for grooming Reproduced on 2.4.x S3 Dev.Experience feature request

Most helpful comment

@lbajsarowicz thank you for the report!
I'm working on this issue.

All 16 comments

Hi @lbajsarowicz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@lbajsarowicz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @dmytro-ch. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [x] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [x] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [x] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

@lbajsarowicz thank you for the report!
I'm working on this issue.

@VladimirZaets Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again.
Thanks!

@VladimirZaets Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again.
Thanks!

Hello @lbajsarowicz and @dmytro-ch

This issue looks like a feature request/improvement but not bug that should be fixed.
And according to the rules I am going to transfer it to the Magento Feature Request public repo.

Also, such changes(new functionality) seem should be approved before development and mering.
@naydav could you please have a look from Arch perspective and advise the next steps?

@sdzhepa Sure, do what you have to do :-)

@sdzhepa Any update there?

Hi @lbajsarowicz,
In general, I like the idea.

What do you think about a clearer name fo command?

Something like config:reset or config:set-to-default. Because for me, config:delete is a little bit ambiguous.

@naydav config:reset sounds fine.

@sdzhepa I don't have objections about this proposal. Looks sensible.

@naydav thank you for your feedback.

@lbajsarowicz could I ask you to add some user example flow with steps and desire results?
it will help a lot to understand the business value during triage for guys who are not developers

Thank you in advance

Case 1: MFTF Tests

  1. For the scope of Acceptance Test I need to change number of products per page to 1, for store fr_FR, having default value untouched
  2. I perform the tests
  3. The rule of Test Isolation requires me to revert the previous state of application after test finished ("Use default" items per page value)

I'll list more of them soon

Hi @lbajsarowicz
I like this feature, should simplify test creation and help with test isolation issues.

I would prefer to have command called config:use-default to align it what see on the Config Page. Should be more obvious then reset or delete.

The other thing I think would be helpful to have command config:get path/to/config which will return value which is set right now. It should help writing tests for customized Magento stores.
Basically you'll be able to do following:

  1. Run <magentoCli command="config:get path/to/config" stepKey="currentConfig" />
  2. Do whatever you want in your test.
  3. In after block just set everything back <magentoCli command="config:set path/to/config {$currentConfig}" stepKey="rollbackConfig" />

@okolesnyk I like the idea, but... still, you are setting the value, so if you change the global value, the store-specific value won't follow anymore.

Hello @lbajsarowicz @okolesnyk @naydav

Guys, could you please summarize the final agreement about naming and other things in the description as clear requirements(expected result)?

It will really help to triage and prioritize this issue

Thank you in advance!

Was this page helpful?
0 / 5 - 0 ratings