From patchwork Fri May 1 11:00:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2251 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633284; bh=+L3nNBaQo1vV6IFY8YaIbiHYU0n2x0aU3zu8VnQ+q5E=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=DYtpmU5KxHJDzTs4D8XcDx63Ewaho/R+fhILyB/BVUQJ/MaGicQn6RwkWFxq91SIs 50zHYgDhyAxxjX9OfeAS3HKrbY8M8RXwgfthwazh2fn3PtKLyhxpb03T06YXO24SLc /3u0tnWbusXvb5SzH3RkB1BpdgLQrjpYQanSEJl8= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 055D36A834 for ; Fri, 1 May 2026 05:01:24 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8gmjTy6d7JJU for ; Fri, 1 May 2026 05:01:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633283; bh=+L3nNBaQo1vV6IFY8YaIbiHYU0n2x0aU3zu8VnQ+q5E=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jirbI8ubvXpzqRK9h+StywVwGnuge4Wlm5SYyqvQOf8aqDbZVtVi1uf88iUCJgren TlTvbznfsvChm4tGJz8go94vOAOVr+7ug5Wqps9rDmZJh+7Fn38mEXsi/qSIH3LceX 36dsv7HVGWErAz85vWFAvcAgZSam+/oknspRd+Xo= Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E6E6D6A82E for ; Fri, 1 May 2026 05:01:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633281; bh=ZFnf4Uu0WTADdP+6wg57XZu6SxepHpoDrVZ0uAR9axc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qQCzvSS7IfWsPQZ1wtx2phKOLLMbccB5kyLvvm7LvL/Tp5SWuf3mpRpSbDul5WTmF TvKQs+VwgPyGqYkgI0/ceiXTrkV68VRqVIHHJ9lx/dFwx02Ga5k1uwA8M9LszHl0IV pWOVVb+xrXHoQHZeImP0mZpmT+LHMcMeo9cuNC9k= Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B08BF6A82E; Fri, 1 May 2026 05:01:21 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 205eRdsgvsMf; Fri, 1 May 2026 05:01:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1777633277; bh=l3xoWo7BuuvsjUDKC8iqYVfeIRPc95lDuX1Nbu0VKPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LjgAiXP+GQ6dthjkrDTIWzla5s/zgeCSJ8BqrTjTyDSbtxXSzmIdQUdGOj/PKyYRG ulizjQJxPM8xEhAvj6njNoI5MvF+Rn90X4YheUv34RUaRCqXD7JYsDYmeBDiKy/OQs 3bkegj1hcxjPxD1VNm30i3LnkakFwv3U6qm/yrHs= Received: from u-boot.org (unknown [174.51.25.52]) by mail.u-boot.org (Postfix) with ESMTPSA id 509C96A7AF; Fri, 1 May 2026 05:01:17 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 1 May 2026 05:00:00 -0600 Message-ID: <20260501110040.1874719-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260501110040.1874719-1-sjg@u-boot.org> References: <20260501110040.1874719-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ITG4IY5MZ7FL4DIDDXQRUI2YY3YYQF2I X-Message-ID-Hash: ITG4IY5MZ7FL4DIDDXQRUI2YY3YYQF2I X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/29] patman: Fix patchwork search for titles containing '+' List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The query_series() method replaces spaces with '+' for the patchwork API query string. This means a literal '+' in a series title (e.g. 'FS and FW loader + FIP loader') becomes a space, corrupting the search. Use urllib.parse.quote() for proper URL encoding so that special characters like '+' are escaped as '%2B'. Signed-off-by: Simon Glass --- tools/patman/patchwork.py | 4 +++- tools/patman/test_cseries.py | 39 ++++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/tools/patman/patchwork.py b/tools/patman/patchwork.py index 46bacee50d2..f71214d4b8f 100644 --- a/tools/patman/patchwork.py +++ b/tools/patman/patchwork.py @@ -7,6 +7,7 @@ import asyncio import re +from urllib.parse import quote_plus import aiohttp from collections import namedtuple @@ -281,8 +282,9 @@ class Patchwork: Return: list of series matches, each a dict, see get_series() """ - query = desc.replace(' ', '+') + query = quote_plus(desc, safe=':') subpath = f'series/?project={self.proj_id}&q={query}' + tout.info(f"Searching for '{desc}'") tout.debug(f' GET {self.url}/api/1.2/{subpath}') return await self._request(client, subpath) diff --git a/tools/patman/test_cseries.py b/tools/patman/test_cseries.py index 7d6a6179c1e..2d56b409a57 100644 --- a/tools/patman/test_cseries.py +++ b/tools/patman/test_cseries.py @@ -1101,16 +1101,19 @@ Tested-by: Mary Smith # yak self.assertFalse(cser.project_get()) cser.project_set(pwork, 'U-Boot', quiet=True) - self.assertEqual( - (self.SERIES_ID_SECOND_V1, None, 'second', 1, - 'Series for my board'), - cser.link_search(pwork, 'second', 1)) + with terminal.capture(): + self.assertEqual( + (self.SERIES_ID_SECOND_V1, None, 'second', 1, + 'Series for my board'), + cser.link_search(pwork, 'second', 1)) with terminal.capture(): cser.increment('second') - self.assertEqual((457, None, 'second', 2, 'Series for my board'), - cser.link_search(pwork, 'second', 2)) + with terminal.capture(): + self.assertEqual( + (457, None, 'second', 2, 'Series for my board'), + cser.link_search(pwork, 'second', 2)) def test_series_link_auto_name(self): """Test finding the patchwork link for a cseries with auto name""" @@ -1197,13 +1200,15 @@ Tested-by: Mary Smith # yak self.assertFalse(cser.project_get()) cser.project_set(pwork, 'U-Boot', quiet=True) - self.assertEqual( - (self.SERIES_ID_SECOND_V1, None, 'second', 1, - 'Series for my board'), - cser.link_search(pwork, 'second', 1)) - self.assertEqual((457, None, 'second', 2, 'Series for my board'), - cser.link_search(pwork, 'second', 2)) - res = cser.link_search(pwork, 'second', 3) + with terminal.capture(): + self.assertEqual( + (self.SERIES_ID_SECOND_V1, None, 'second', 1, + 'Series for my board'), + cser.link_search(pwork, 'second', 1)) + self.assertEqual( + (457, None, 'second', 2, 'Series for my board'), + cser.link_search(pwork, 'second', 2)) + res = cser.link_search(pwork, 'second', 3) self.assertEqual( (None, [{'id': self.SERIES_ID_SECOND_V1, 'name': 'Series for my board', @@ -1444,7 +1449,9 @@ Tested-by: Mary Smith # yak with terminal.capture() as (out, _): self.run_args('series', 'autolink-all', '-a', '--no-update', pwork=pwork) - itr = iter(out.getvalue().splitlines()) + lines = [ln for ln in out.getvalue().splitlines() + if not ln.startswith('Searching for ')] + itr = iter(lines) self.assertEqual( '1 series linked, 1 already linked, 1 not found (3 requests)', next(itr)) @@ -3784,7 +3791,9 @@ Date: .* cser.set_fake_time(h_sleep) with terminal.capture() as (out, _): cser.link_auto(pwork, 'second3', 3, True, 50) - itr = iter(out.getvalue().splitlines()) + lines = [ln for ln in out.getvalue().splitlines() + if not ln.startswith('Searching for ')] + itr = iter(lines) # Matches shown only once (they don't change between retries) self.assertEqual(