-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Update Console Tool Usage for Cache and Index Operations #1440
Update Console Tool Usage for Cache and Index Operations #1440
Conversation
…lied by default - The commands cache:flush, cache:clear, cache:enable and cache:disable now properly default to use --all when no types explicitly given - Unit tests for cache management commands have been made simpler, resulting in less duplicate test code - Unit tests added to verify --all is applied by default
…lied by default - Unit tests for cache management commands have been made simpler, resulting in less duplicate test code - Unit tests added to verify --all is applied by default
Hello @davidalger, thank you for your input. From my point of view this improvement is questionable. Please, let me check this behavior with our PO. |
@vancoz Thanks for the note. I do realize that it's effectively changes existing behavior of cache:flush. I'm calling it a bug because the help text says it should behave that way this PR causes it to now behave, and also brings it inline with the existing behavior of similar commands. The following is current behavior of cache:flush with nothing specified:
Note that it says "Flushed cache types" The folks I've been working closely with on Magento 2 for the last month and a half find this very confusing, and if it's going to do nothing, it should ask you to specify cache types to flush. How does it bring it inline with similar commands? The index:reindex one is a good example. It has a similar check which implies the
And why would I call this a bug fix vs an enhancement? Simple. Read the
I hope you can see both why I fixed this, as well as that it is not deviating from existing practice, but pulling the command in-line with existing and normally expected behavior. If there is documentation on devdocs that indicates otherwise, I'd be happy to update that as well. |
Hi @davidalger, I think with this approach (clear all types if any type is specified) we do not need --all option at all. Btw, we need to have discussion about this and in case if we decide to change behavior my proposal is to remove --all option and make decision what to clear based on types only. Also would be good to remove --all option from indexer:reindex command or fix current behavior. What do you thunk about that? Thank you. |
Hi @davidalger , thanks for pointing to the issue. |
@vancoz The --all option should remain, if only intended as an internal switching mechanism and/or explicit flag used for scripting purposes. I do not want to see this option removed. If it is removed, you will have to have functional switching logic in the execution body of commands vs being implemented at a more surface level. @buskamuza This is a developer tool in an developer only environment. It is no more dangerous than allowing them SSH access where they could accidentally run Beyond that though, if a command line tools is considered dangerous because the default behavior of a command might impact performance if accidentally run on a large production site under heavy load, then more concerning to me would be these giant buttons in the admin…where folks are working who really can't be expected to know that a cache flush could immediately tank performance when under heavy load. |
Hello @davidalger, we have response from PO team, and they decided to remove --all option from cache:flush and index:reindex commands. Execution logic should be based on parameters, if array of particular types/caches is empty - the default behavior should be flush/reindex all. Would you like to change it in scope of this PR? |
@vancoz I'll update the PR accordingly for both commands. Thanks for taking the time internally to determine forward direction on this |
…ole-default-types
…w cache:disable usage
34482fd
to
3b6b546
Compare
@vancoz I've updated the PR, build is passing and I believe it's ready for your review. Following the updates I've made this PR effects the following:
|
Thanks, we'll update documentation in sync with this PR. |
@davidalger thank you very much. Let me review changes and accept it 👍 |
Internal ticket MAGETWO-40553 |
… Operations #1440 Merge commit 'refs/pull/1440/head' of https://github.com/magento/magento2 into MAGETWO-39841-pull-request-1440
… Operations #1440 - removed --all option from testing framework
… Operations #1440 - fixed static and code integrity tests
… Operations #1440 - fixed static code issue
… Operations #1440 - changes according to CR
Fixes bug in cache management console commands where --all is not applied by default