[Concept,14/37] patman: Make patchwork query_series() and get_patch_comments() public

Message ID 20260404213020.372253-15-sjg@u-boot.org
State New
Headers
Series patman: Autolink fixes and AI-assisted patch review |

Commit Message

Simon Glass April 4, 2026, 9:28 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Rename _query_series() to query_series() and _get_patch_comments() to
get_patch_comments() so that review.py can call them without accessing
protected members. Update all internal callers.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/patchwork.py | 10 +++++-----
 tools/patman/status.py    |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/tools/patman/patchwork.py b/tools/patman/patchwork.py
index 5192b817968..de676161eee 100644
--- a/tools/patman/patchwork.py
+++ b/tools/patman/patchwork.py
@@ -270,7 +270,7 @@  class Patchwork:
         async with aiohttp.ClientSession() as client:
             return await self._request(client, 'projects/')
 
-    async def _query_series(self, client, desc):
+    async def query_series(self, client, desc):
         """Query series by name
 
         Args:
@@ -306,7 +306,7 @@  class Patchwork:
         name_found = []
 
         # Do a series query on the description
-        res = await self._query_series(client, desc)
+        res = await self.query_series(client, desc)
         for pws in res:
             if pws['name'] == desc:
                 if int(pws['version']) == version:
@@ -317,7 +317,7 @@  class Patchwork:
         # series name
         cmt = ser.commits[0]
 
-        res = await self._query_series(client, cmt.subject)
+        res = await self.query_series(client, cmt.subject)
         for pws in res:
             patch = Patch(0)
             patch.parse_subject(pws['name'])
@@ -523,7 +523,7 @@  class Patchwork:
         """
         return await self._request(client, f'patches/{patch_id}/')
 
-    async def _get_patch_comments(self, client, patch_id):
+    async def get_patch_comments(self, client, patch_id):
         """Read comments about a patch
 
         Args:
@@ -783,7 +783,7 @@  On Tue, 4 Mar 2025 at 06:09, Simon Glass <sjg@chromium.org> wrote:
         """
         data = await self.get_patch(client, patch_id)
         state = data['state']
-        comment_data = await self._get_patch_comments(client, patch_id)
+        comment_data = await self.get_patch_comments(client, patch_id)
 
         return Patch(patch_id, state, data, comment_data)
 
diff --git a/tools/patman/status.py b/tools/patman/status.py
index 967fef3ad6e..2828e4a3bfc 100644
--- a/tools/patman/status.py
+++ b/tools/patman/status.py
@@ -28,7 +28,7 @@  def process_reviews(content, comment_data, base_rtags):
     Args:
         content (str): Content text of the patch itself - see pwork.get_patch()
         comment_data (list of dict): Comments for the patch - see
-            pwork._get_patch_comments()
+            pwork.get_patch_comments()
         base_rtags (dict): base review tags (before any comments)
             key: Response tag (e.g. 'Reviewed-by')
             value: Set of people who gave that response, each a name/email