[PATCH 1/2] pw_maintainers_cli: debug patchwork requests

David Marchand david.marchand at redhat.com
Fri Jul 24 18:21:41 CEST 2026


Add a --debug option to track patchwork API requests.
This helps verify the number of requests made to patchwork
and troubleshoot connectivity issues.

Example:
$ ./pw_maintainers_cli.py --debug --type series list-trees 12345

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 tools/pw_maintainers_cli.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py
index b35f4bb..15ec0a7 100755
--- a/tools/pw_maintainers_cli.py
+++ b/tools/pw_maintainers_cli.py
@@ -40,6 +40,7 @@ Or if you want to use inside other scripts:
     maintainers = maintainers.get_maintainers(tree_url)
 """
 
+import logging
 import os
 import sys
 import re
@@ -53,6 +54,10 @@ from git_pw import api
 from git_pw import utils
 from git_pw import patch as git_pw_patch
 
+
+LOG = logging.getLogger(__name__)
+
+
 MAINTAINERS_FILE_PATH = os.environ.get('MAINTAINERS_FILE_PATH')
 if not MAINTAINERS_FILE_PATH:
     print('MAINTAINERS_FILE_PATH is not set.', file=sys.stderr)
@@ -61,7 +66,6 @@ if not MAINTAINERS_FILE_PATH:
 
 class GitPW(object):
     CONF = config.CONF
-    CONF.debug = False
 
     def __init__(self, conf_obj=None):
         # Configure git-pw.
@@ -347,6 +351,10 @@ if __name__ == '__main__':
             '--skip-delegated',
             action='store_true', required=False,
             help='Skip patches that are already delegated')
+    parser.add_argument(
+            '--debug',
+            action='store_true', required=False,
+            help='Enable debug output (shows patchwork API requests)')
     parser.add_argument(
             'command',
             choices=[
@@ -362,6 +370,10 @@ if __name__ == '__main__':
     resource_type = args.type
     _id = args.id
 
+    if args.debug:
+        logging.basicConfig(level=logging.DEBUG)
+        config.CONF.debug = True
+
     # Pass the needed configurations to git-pw.
     conf_obj = {
             key: value for key, value in args.__dict__.items() if
-- 
2.54.0



More information about the ci mailing list