Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: "Kernel.org Tools" <tools@kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
	 "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH b4 2/3] review: sashiko: fix URLs
Date: Tue, 28 Apr 2026 11:29:15 +0200	[thread overview]
Message-ID: <20260428-sashiko-patchset-api-v1-2-24d4ac34b4ae@kernel.org> (raw)
In-Reply-To: <20260428-sashiko-patchset-api-v1-0-24d4ac34b4ae@kernel.org>

The displayed URL is currently leading to a 404, e.g.

  https://sashiko.dev/patch/93

I don't know if this URL was working at some points, but it is no longer
now. This one works:

  https://sashiko.dev/#/patchset/93

And in case of a series, ?part=X can be used, e.g.

  https://sashiko.dev/#/patchset/93?part=2

Assisted-by: My-reading-glasses
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 src/b4/review/checks.py         | 5 ++++-
 src/tests/test_review_checks.py | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/b4/review/checks.py b/src/b4/review/checks.py
index 2ff825f..942935e 100644
--- a/src/b4/review/checks.py
+++ b/src/b4/review/checks.py
@@ -462,7 +462,7 @@ def _run_builtin_sashiko(msg: EmailMessage, sashiko_url: str) -> List[Dict[str,
     reviews = data.get('reviews', [])
     patches = data.get('patches', [])
     base_url = sashiko_url.rstrip('/')
-    patchset_url = f'{base_url}/patch/{ps_id}' if ps_id else ''
+    patchset_url = f'{base_url}/#/patchset/{ps_id if ps_id else msgid}'
 
     # Build a map from patch message-id to sashiko patch id
     patch_id_by_msgid: Dict[str, int] = {}
@@ -526,8 +526,10 @@ def _run_builtin_sashiko(msg: EmailMessage, sashiko_url: str) -> List[Dict[str,
     if sashiko_patch_id is None:
         return []
 
+    i = 1
     for review in reviews:
         if review.get('patch_id') == sashiko_patch_id:
+            patchset_url += f'?part={i}'
             review_status = review.get('status', '')
             if review_status == 'Skipped':
                 result_msg = review.get('result', '') or 'Skipped'
@@ -570,6 +572,7 @@ def _run_builtin_sashiko(msg: EmailMessage, sashiko_url: str) -> List[Dict[str,
             if findings:
                 result['details'] = json.dumps(findings)
             return [result]
+        i += 1
 
     # No review found for this patch
     return [
diff --git a/src/tests/test_review_checks.py b/src/tests/test_review_checks.py
index 1469bf3..ad0f222 100644
--- a/src/tests/test_review_checks.py
+++ b/src/tests/test_review_checks.py
@@ -861,7 +861,7 @@ class TestRunBuiltinSashiko:
         assert '1 critical' in results[0]['summary']
         assert '1 high' in results[0]['summary']
         assert '1 low' in results[0]['summary']
-        assert results[0]['url'] == 'https://sashiko.dev/patch/93'
+        assert results[0]['url'] == 'https://sashiko.dev/#/patchset/93'
         # Details should be valid JSON
         details = json.loads(results[0]['details'])
         assert len(details) == 3  # 1 low + 1 critical + 1 high
@@ -992,7 +992,7 @@ class TestRunBuiltinSashiko:
         msg = _make_msg(msgid='patch1@example.com')
         results = checks._run_builtin_sashiko(msg, 'https://sashiko.dev/')
         # Trailing slash should not cause double slash
-        assert results[0]['url'] == 'https://sashiko.dev/patch/93'
+        assert results[0]['url'] == 'https://sashiko.dev/#/patchset/93?part=1'
 
 
 class TestSashikoAutoWire:

-- 
2.53.0


  parent reply	other threads:[~2026-04-28  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28  9:29 [PATCH b4 0/3] review: avoid downloading logs and fix URLs Matthieu Baerts (NGI0)
2026-04-28  9:29 ` [PATCH b4 1/3] review: sashiko: switch to patchset endpoint Matthieu Baerts (NGI0)
2026-04-28  9:29 ` Matthieu Baerts (NGI0) [this message]
2026-04-28  9:29 ` [PATCH b4 3/3] review: patchwork: use the target URL Matthieu Baerts (NGI0)

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=20260428-sashiko-patchset-api-v1-2-24d4ac34b4ae@kernel.org \
    --to=matttbe@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