patchq is an email patch processing service which can monitor mailing list(s) for single patches or a series of patches, run tests on them ("does it compile", "does it pass the test suite"), and then sends a follow up email with the results. It requires: - Python 2 (because we need to run on RHEL 6 which doesn't have python3-pika) - python-pika (https://pypi.python.org/pypi/pika) - A RabbitMQ server running somewhere on your network. You have to open port 5672 on the server, and provide the hostname of the server in ‘config.py’. - Procmail or similar to feed email into the system. To understand how patchq works, please read these blog posts: - https://rwmj.wordpress.com/2017/07/06/patch-review-and-message-brokers/ Installation: - There is no Makefile and nothing to build or install. You can run everything from the local directory. - Edit ‘config.py’ to configure a few things. - Write some tests! For every test listed in the ‘config.tests’ list, you will need to write a corresponding ‘test-name.sh’. Don't forget to make it executable. See also: ‘perform-tests.py’. - Run ‘./create-queues.py’ to set up the RabbitMQ exchanges, queues and other objects. All RabbitMQ objects are prefixed by ‘patchq_...’, so to reverse this script you just have to delete everything in RabbitMQ with that prefix. - If you want, you can manually test that everything works: * Run ‘rabbitmqctl list_queues‘ => All queues should have 0 messages. * Save some patch series into an mbox and inject them: ./inject-mbox.py mbox * ‘rabbitmqctl list_queues’ should show the number of injected emails in the ‘patchq_input’ queue. * Run ‘./threader.py’ which should combine single emails into threads and move all the patches to ‘patchq_test_*’. If you check again with ‘rabbitmqctl list_queues’ you should see one message per patch series in every test queue. * Run ‘./perform-tests.py’ which should start testing. * Modify ‘config.py’ so that ‘reply_override’ is set to your own email address and run ‘./send-reports.py’. This should send out report emails to you containing the results of the tests. Once you are happy that report emails are correct, you can set ‘reply_override’ to ‘None’ for production use. * Run ‘./drain-queues.py’ to drop any messages remaining in all the queues, if you need to. * Note because of the wonders of message brokers, you can run email, threader and testing on different hosts or a single host. - Set up cron jobs: * Set up a cron job to run ‘./threader.py’ periodically. At least once every hour for light usage, and more often for mailing lists with heavy traffic. * Set up a cron job to run ‘./perform-tests.py’ on your test system(s). You can run different tests on different machines if you want. Read the script to see how it works. * Set up a cron job to run ‘./send-reports.py’ periodically. - Set up procmail (or equivalent) to pick up emails sent to the mailing list and inject them into patchq. See ‘procmail-example’ for some ideas. This code is released under the GNU General Public License v2 or any later version. See ‘COPYING’ for details. Development: - Written by Richard W.M. Jones - Send patches to the virt-tools mailing list: https://www.redhat.com/mailman/listinfo/virt-tools-list To do: - Handle multiple mailing lists and projects. - Allow dependencies between tests (ie. test if the code compiles first before running other tests). Similar projects: - The 0-day test service is a very comprehensive set of tests which are run on kernel trees and patches posted to LKML https://01.org/lkp/documentation/0-day-test-service