Feature: Add command to detect new queues #188
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.
Description
The
setup:db:statuscommand does not pick up newly defined or missing queues, this means anyone trying to get close to true green/blue deployments has no quick way to check if a setup:upgrade is required if a new queue (mysql or amqp) has been added and no other changes are made.This PR adds the console command
queue:config:status, which checks for new queues. In line with other status commands; 0 = no new queues, exit code 2 = new unconfigured queues.Important architecture info: The command resides in MessageQueue, and it uses DI to hydrate any ChangeDetectors - which there are 2 of, one in MysqlMq and one on Amqp, this avoids any additional module dependency. MysqlMq checks if the queue exists in the DB; Amqp, if you have rabbitmq/amazonmq/etc, checks if the queue exists in the broker.
Related Pull Requests
Follows on from the similar PR #186 as a concentrated effort to improve Blue/Green deployment efforts.
Manual testing scenarios
bin/magento queue:config:status## exit code 2bin/magento setup:upgradebin/magento queue:config:status## exit code 0git checkout -- app/code/Magento/ImportExport/etc/queue_topology.xmlQuestions or comments
Contribution checklist (*)
Prexisting unit & integration test failures stop me from checking all tests passing box - though the unit tests related to new code do all pass.