Skip to content

Instantly share code, notes, and snippets.

@bonzini
Last active March 9, 2018 19:52
Show Gist options
  • Save bonzini/f9caabc4dce69bf071278e3316e6891e to your computer and use it in GitHub Desktop.
Save bonzini/f9caabc4dce69bf071278e3316e6891e to your computer and use it in GitHub Desktop.
Prototype patchew documentation

Patchew design and flow

Patchew is designed around three components:

  • a web server, which hosts the Patchew user interface and also exposes API endpoints for use from the other parts;

  • one or more importers, which read email from an IMAP server, send them to the server, and pushes the messages to a git tree;

  • and a set of testers, which poll for git trees that have been pushed and runs a shell script on the cloned tree.

The flow can be represented as follows

      IMAP              API
Mail ------> Importer -----> Patchew server

          API                           git
Importer ----> Unapplied series (mbox) ----> Git Server
                                     |
                                     '-----> Patchew server
                                        API

        API                         git        shell         API
Tester -----> Untested series (tag) ----> Tree ----> Result -----> Patchew server

While the importer's two tasks could in principle be split to two separate components, usually a single person can be the point of contact for both of them. One importer can handle one or more patchew projects, and similarly for testers. However, while one project will typically get email from one importer only, it can be served by multiple testers (for example for different architectures or operating systems).

Setting up patchew

Deploying the server

./scripts/deploy -s root@patchew.example.com

If you do not have public key access configured on the host, add "-k".

(TODO)

Creating users

  • Create importer user

  • Create tester user

  • Create maintainer user

Creating a project

(TODO)

Configuring git plugin

??? Can you configure the git plugin after the importer has been created ???

Deploying the importer

Get IMAP server fingerprint:

openssl s_client -connect imap.gmail.com:993 |
openssl x509 -fingerprint |
grep Fingerprint

(may need to add "-starttls imap")

./scripts/deploy -i root@patchew.example.com

If you do not have public key access configured on the host, add "-k".

./scripts/deploy -i root@patchew.example.com -e "
    instance_name=patchew-importer-example
    patchew_server=http://patchew.example.com/
    importer_user=importer
    importer_pass=gotsomepatches
    imap_server=imap.example.com
    imap_user=username@example.com
    imap_pass=hunter2
    imap_cert_fingerprint=00112233445566778899aabbccddeeff
    imap_folders=INBOX
    imap_delete_after_import=n"

systemctl status patchew-importer-dcaratti.service

The importer starts importing messages from the IMAP server to local storage and from there to git repo, watch it with

journalctl -f -u patchew-importer-dcaratti

Deploying the tester

Unlike the importer and server, the tester does not run in a container; it is simply a cron job on one or more hosts. Like the importer and server, however, testers are deployed with Ansible. The cron job runs as a user named "patchew".

./scripts/deploy -t root@patchew-tester1.example.com -e " instance_name=patchew-tester1 patchew_server=http://patchew.example.com/ tester_user=tester tester_pass=wantsomepatches tester_project=frobnicator

Continuous integration

Testing

"More information about wpa_supplicant..." -> Login -> ...

Requirements

(TODO)

Email notifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment