[PATCH b4] review: Fix sashiko patchset URL format
Sven Eckelmann <[email protected]>
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <[email protected]> |
The sashiko server does not expose a direct `/patch/{ps_id}` endpoint.
Requesting https://sashiko.dev/patch/93 returns a 404, because the frontend
is a JavaScript single page application (SPA) that relies on the API to
fetch and render content dynamically.
The correct approach is to load the root page and pass the resource as a
URL fragment (anchor), e.g. https://sashiko.dev/#/patchset/93, so the SPA
can query the API and display the patchset accordingly.
Fixes: 5154a8c9934c ("review: integrate sashiko and follow-up inline comments")
Signed-off-by: Sven Eckelmann <[email protected]>
---
Just noticed this while playing around with the Check functionality of
`b4 review tui`. I didn't actually ran the test suite.
---
src/b4/review/checks.py | 2 +-
src/tests/test_review_checks.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/b4/review/checks.py b/src/b4/review/checks.py
index 36c0780..51378a9 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 ''
# Build a map from patch message-id to sashiko patch id
patch_id_by_msgid: Dict[str, int] = {}
diff --git a/src/tests/test_review_checks.py b/src/tests/test_review_checks.py
index 1469bf3..9a43a76 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='[email protected]')
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'
class TestSashikoAutoWire:
---
base-commit: d5d981426ead3f490713ef5d2fd1aa3d0f13b005
change-id: 20260429-sashiko-patchset-url-65ce710be1e0
Best regards,
--
Sven Eckelmann <[email protected]>