Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: "Kernel.org Tools" <tools@kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	 "Christian Brauner (Amutable)" <brauner@kernel.org>
Subject: [PATCH RFC 05/11] review-tui: guarantee the tracked revision in revision lists
Date: Sat, 18 Jul 2026 00:37:41 +0200	[thread overview]
Message-ID: <20260718-work-b4-multiver-rows-v1-5-3c539d2a3095@kernel.org> (raw)
In-Reply-To: <20260718-work-b4-multiver-rows-v1-0-3c539d2a3095@kernel.org>

The revisions catalog is not guaranteed a row for the tracked revision
(manual linking can record only newer versions), so per-version views
built from series['_revisions'] could silently omit the version the
maintainer is actually tracking.  Add _merge_tracked_revision(), which
appends a synthesized entry built from the series row when the catalog
lacks it.

Assisted-by: LLM
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
 src/b4/review_tui/_tracking_app.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/src/b4/review_tui/_tracking_app.py b/src/b4/review_tui/_tracking_app.py
index 7bf9530..3057367 100644
--- a/src/b4/review_tui/_tracking_app.py
+++ b/src/b4/review_tui/_tracking_app.py
@@ -1561,6 +1561,41 @@ class TrackingApp(LoreNodeShutdownMixin, CheckRunnerMixin, App[Optional[str]]):
             )
         )
 
+    def _merge_tracked_revision(self, series: Dict[str, Any]) -> List[Dict[str, Any]]:
+        """Known revisions of a series, guaranteed to include the tracked one.
+
+        The revisions catalog is not guaranteed a row for the tracked
+        revision (manual linking can record only newer versions), so a
+        synthesized entry built from the series row is appended when it
+        is missing.
+        """
+        revs = list(series.get('_revisions') or [])
+        tracked = series.get('revision', 1)
+        if any(r.get('revision') == tracked for r in revs):
+            return revs
+        if not series.get('message_id'):
+            return revs
+        revs.append(
+            {
+                'change_id': series.get('change_id', ''),
+                'revision': tracked,
+                'message_id': series.get('message_id', ''),
+                'subject': series.get('subject'),
+                'link': '',
+                'found_at': series.get('added_at') or '',
+                'thread_blob': '',
+                'fingerprint': series.get('fingerprint'),
+                'source': 'tracked',
+                'is_rethreaded': bool(series.get('is_rethreaded')),
+                'message_count': series.get('message_count'),
+                'seen_message_count': series.get('seen_message_count'),
+                'last_update_check': series.get('last_update_check'),
+                'last_activity_at': series.get('last_activity_at'),
+            }
+        )
+        revs.sort(key=lambda r: r.get('revision') or 0)
+        return revs
+
     def _checkout_new_series(self) -> None:
         """Retrieve series, build am-ready mbox, and show base selection."""
         series = self._selected_series

-- 
2.53.0


  parent reply	other threads:[~2026-07-17 22:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 22:37 [PATCH RFC 00/11] review: track and browse every version of a tracked series Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 01/11] review-tui: fix rethreaded series thread viewing Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 02/11] review: track message counts for all revisions of a series Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 03/11] review: test per-revision message tracking Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 04/11] review-tui: poll every revision on u/U updates Christian Brauner
2026-07-17 22:37 ` Christian Brauner [this message]
2026-07-17 22:37 ` [PATCH RFC 06/11] review: add backward discovery of older series revisions Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 07/11] review-tui: add a "Find older revisions" action Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 08/11] review: test backward revision discovery Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 09/11] review-tui: extract the Msgs column renderer from TrackedSeriesItem Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 10/11] review-tui: expand tracked series into per-version rows Christian Brauner
2026-07-17 22:37 ` [PATCH RFC 11/11] review-tui: test per-version tracker rows Christian Brauner
2026-07-27 20:43 ` [PATCH RFC 00/11] review: track and browse every version of a tracked series Konstantin Ryabitsev
2026-07-27 21:27   ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260718-work-b4-multiver-rows-v1-5-3c539d2a3095@kernel.org \
    --to=brauner@kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox