Patchwork tools

May 31, 2026 ยท View on GitHub

This repository contains some tools meant to be used with Patchwork.

pw-checks.py

This small tool allows get/set CI checks for a patchwork patch. It works with pwclient's configuration file (~/.pwclientrc). Only rest API mode (version 1.3) is supported, and requires a token to be set.

An example of a ~/.pwclientrc file is this one:

[options]
default = kernel-org

[kernel]
backend = rest
url = https://patchwork.kernel.org/api/
token = some_token

[linuxtv]
backend = rest
url = https://patchwork.linuxtv.org/api/
token = some_other_token

The location of the configuration file can be overriden using an ENV var:

set PWCLIENTRC=/some/other/config/file

The script has two commands:

Get checks

Usage:

get <message-id or patch-id>

Show checks for a specific patch.

Get checks

Usage:

  set <message-id or patch-id> <context> <state> <URL> <description>

Set check status for a specific patch.

Examples:

Set success:

At default project:

pw-checks.py set 12345 MyCI success https://ci.example.com "Build passed"

On another project:

pw-checks.py -p project2 set 12345 MyCI success https://ci.example.com "Build passed"

Set warning:

pw-checks.py set patch-id-12345@example.com warning https://lint.example.com "See link for details"

add_bot_checks.py

Checks the content of a file or maildir, searching for known CI bots.

If a CI bot e-mail is found with proper data, add a new checker if it doesn't exist yet.

pw_patches.py

Script to get and update patch status at patchwork. It uses a patch cache to avoid needing to access patchwork repository, at the expense on taking several seconds to pick all pending patches from patchwork.

It is not worth using the script itself if the goal is to just get/update status of a single patch. Its main goal is to actually test pw_class.py library, which can be used as basis for a local patchwork GUI/TUI interface with cache handling.