[Concept,27/37] patman: Add notes field to SerVer namedtuple

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

Commit Message

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

The notes column exists in the ser_ver table but the SerVer namedtuple
and its SELECT queries do not include it. Add the field and update all
queries to select it. Also fix SerVer construction in cser_helper to
include the extra None for the notes position.

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

 tools/patman/cser_helper.py | 4 ++--
 tools/patman/database.py    | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)
  

Patch

diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py
index 7979deda6dc..31a5e3663dc 100644
--- a/tools/patman/cser_helper.py
+++ b/tools/patman/cser_helper.py
@@ -1370,10 +1370,10 @@  class CseriesHelper:
                     updated += 1
         if cover:
             info = SerVer(svid, None, None, None, cover.id,
-                           cover.num_comments, cover.name, None, None)
+                           cover.num_comments, cover.name, None, None, None)
         else:
             info = SerVer(svid, None, None, None, None, None, patches[0].name,
-                           None, None)
+                           None, None, None)
         self.db.ser_ver_set_info(info)
 
         return updated, 1 if cover else 0
diff --git a/tools/patman/database.py b/tools/patman/database.py
index 8a96030b68f..50b9ea0dca5 100644
--- a/tools/patman/database.py
+++ b/tools/patman/database.py
@@ -39,7 +39,7 @@  Review = namedtuple(
 SerVer = namedtuple(
     'SER_VER',
     'idnum,series_id,version,link,cover_id,cover_num_comments,name,'
-    'archive_tag,desc')
+    'archive_tag,desc,notes')
 
 # Record from the pcommit table:
 # idnum (int): record ID
@@ -783,7 +783,7 @@  class Database:  # pylint:disable=R0904
             ValueError: There is no matching idnum/version
         """
         base = ('SELECT id, series_id, version, link, cover_id, '
-                'cover_num_comments, name, archive_tag, desc '
+                'cover_num_comments, name, archive_tag, desc, notes '
                 'FROM ser_ver WHERE series_id = ?')
         if version:
             res = self.execute(base + ' AND version = ?',
@@ -825,7 +825,8 @@  class Database:  # pylint:disable=R0904
         """
         res = self.execute(
             'SELECT id, series_id, version, link, cover_id, '
-            'cover_num_comments, name, archive_tag, desc FROM ser_ver')
+            'cover_num_comments, name, archive_tag, desc, notes '
+            'FROM ser_ver')
         items = res.fetchall()
         return [SerVer(*x) for x in items]