add git repo init instructions to readme
git push after applying
add #[serde(default)] to approval-related config
Patchy is an email bot that aids software maintenance. It was born out of some opinions:
Patchy keeps track of reviews and approvals and can be told to apply a patchset via email if certain conditions are met.
Patchy assumes mails follow a certain structure, and builds its features on top of this. It recognises the following message types by their subject line:
Type | Meaning | Valid in reply to |
---|---|---|
Review | Raise a question/comment about the patchset | Patch |
Resolve | Close a review | Review |
Approve | Indicate that you want the patchset to be applied | Patch |
Apply | Instruct Patchy to apply the patchset | Patch |
Subject lines must be of the form $type: ...
(where ...
can be anything you want) to be
recognised. Patchy also recognises patches as formatted by git-send-email.
For Patchy to apply a patchset, the set must have no open reviews and at least required_approvals
approvals from approvers
. These values are specified in the config file as described below.
If an Apply fails due to these constraints, Patchy will reply to it and explain.
If the Apply succeeds, Patchy will reply with the resulting commit info from git log --oneline
.
Patchy is not yet able to initialise a git repository for itself, so you must clone your repository
to the configured location manually. Make sure that git push
succeeds when run under the same user
account as Patchy, perhaps by ensuring that the user's SSH keys have the correct permissions.
patchy [<config-path>]
If the config path is not specified, ./patchy.toml
is assumed.
Patchy's configuration uses TOML.
# Path to the git repository managed by Patchy.
repo = "/home/patchy/patchy"
# Path to Patchy's maildir, where it picks up and processes incoming mails.
maildir = "/var/spool/mail/patchy"
# Outgoing address for Patchy's responses.
list_address = "~roseh/patchy-devel@lists.sr.ht"
# The identity to use in Patchy's responses.
self_identity = "Patchy <patchy@krx.sh>"
# sendmail(-compatible) command for sending responses.
sendmail = ["msmtp", "-C", "/home/patchy/msmtp.conf"]
# List of email addresses whose approvals count towards the required_approvals check.
# If this is empty, every approval counts.
approvers = ["rose@krx.sh", "someone.else@gmail.com"]
# Number of approvals required from different people before a patchset can be applied.
required_approvals = 1
# List of email addresses permitted to apply patchsets. Must be present and non-empty.
committers = ["rose@krx.sh", "someone.else@gmail.com"]