Message Queue Changes Tracking in `setup:db:status` Command
Description (*)
- Message Queue changes is getting tracked in the
setup:db:statuscommand
Related Pull Requests
Fixed Issues (if relevant)
- Fixes https://github.com/magento/magento2/issues/38225
Manual testing scenarios (*)
- Introduced a new queue using
queue_consumer.xmland verify thatsetup:db:statusreturningsetup:upgradeneeded message - Run the unit test and verified that all the tests are passed
Questions or comments
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)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Hi @ajith107. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment. :exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EEFunctional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento run all tests
I believe it's suboptimal to update this command with db unrelated stuff. As an alternative you can introduce new setup::amgp:statuscommand
I like the idea behind this but there are 2, non insurmountable, flaws in its design.
1: The MysqlMQ model reads from topology not consumer when running through setup:upgrade so you could miss a queue or 2 (practically not an issue if no consumer really). You could update to using use Magento\Framework\MessageQueue\Topology\Config\CompositeReader;
2: Queues don't get deleted from the queue table, so once a queue is removed from the code base for any reason, the command would always come back as out of date. You could get by this by switching from a === to a diff of read vs db queues and checking if empty as you would be only looking for new queues being missing.
I made a quick module for anyone to use in the midterm if they wish to get the benefits of checking for new queues. And shows off how I tackled the 2 above points.
https://github.com/furan917/Magento2-QueueConfigStatus
Thank you @carlos-reynosa, I would not have seen this if you had not tagged it in your Deployer PR
@magento run all tests