aboutsummaryrefslogtreecommitdiff
path: root/b4/pr.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-06-21 16:17:22 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-06-21 16:17:22 -0400
commitb7d71d8de67bd238f65db6d142a22d7d5a79206d (patch)
treed125ec42dfe65d63cc066d5974b1ae008c8e5c18 /b4/pr.py
parent409c865175bf8f103bf5633331e8a1d77a446814 (diff)
downloadb4-b7d71d8de67bd238f65db6d142a22d7d5a79206d.tar.gz
Initial patchwork integration support
A lot of maintainers use patchwork alongside b4, to make it easier to track patches and rely on some CI integration. This commit adds some basic patchwork integration: - on "b4 am", "b4 shazam", "b4 pr" we will mark the relevant patchwork entries as "Under Review" - on "b4 ty" we can set these patches as "Accepted" - on "b4 ty -d" we can set them as "Deferred" To make it work, the following entries must be present in the repository used with b4: [b4] pw-key = (your API token) pw-url = https://patchwork.kernel.org pw-project = (your project, e.g. linux-usb) pw-review-state = under-review pw-accept-state = accepted pw-discard-state = deferred To get your patchwork API token, go to your patchwork profile page. The pw-accept-state and pw-discard-state can be overridden using the --pw-set-state flag to "b4 ty". E.g. if you wanted to mark the patches as "Not applicable": b4 ty -d 5 --pw-set-state not-applicable Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/pr.py')
-rw-r--r--b4/pr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/b4/pr.py b/b4/pr.py
index 6918a6d..825391e 100644
--- a/b4/pr.py
+++ b/b4/pr.py
@@ -256,6 +256,11 @@ def thanks_record_pr(lmsg):
json.dump(out, fh, ensure_ascii=False, indent=4)
logger.debug('Wrote %s for thanks tracking', filename)
+ config = b4.get_main_config()
+ pwstate = config.get('pw-review-state')
+ if pwstate:
+ b4.patchwork_set_state(lmsg.msgid, pwstate)
+
def explode(gitdir, lmsg, mailfrom=None, retrieve_links=True, fpopts=None):
ecode = fetch_remote(gitdir, lmsg, check_sig=False, ty_track=False)