From patchwork Thu May 25 20:10:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13255621 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AF372415C for ; Thu, 25 May 2023 20:11:12 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-30a8fa6e6fcso1805732f8f.1 for ; Thu, 25 May 2023 13:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1685045471; x=1687637471; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s3dIUL9quv0epIFTeV7Zm+XcdN5CdArA7z2rZlmGDu0=; b=KgfNCX0bSiRsutkwj5c5Rm1Ls6VobQpAHkN+y3o1BuXI37S342f4yW3jPbtEIMUZNj mE1aMhnbucmAoqGNFX2TO2WYEV1LhRdnE8NDS/YKSmBVXMshq7dhlUVDPZwV/5TexMyU vripf29S1nkBoz5s4h2OiEDTidipEv2oceXH0IkLdqf8mK2XDda5Ruq0ye/LVs4Bn1DC MlYQzUFdqAryio8aLLsmKNA9zASY+PkEN2Gi/F2e85oG6vFiXP7fVnV65HP6WpZjIT7j 6X5TmfETWZRz0PEs/f99/taMCQK88blM+VbnMEsPEf1PDe6tdJ01a7auZRZ890qj7t17 jlkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685045471; x=1687637471; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s3dIUL9quv0epIFTeV7Zm+XcdN5CdArA7z2rZlmGDu0=; b=b95vIh5TZtq89esPcVXMX0vli1Jpkg0VW6nZIlh1vGYc1f+j//itnmE73yb3x+dSPc 1+pNYrKA/LrBCmofFCC1SgXK1nDnutwmHk21GtDGkw38ngxlzl7MCsTOLOTyzfpiRJ0h kzlEBbLyBRZZDdiPZVS4s+iimkPNvVlNcaTLZ49scCD9HMF5lgOnxqiSuPOwWZEyfPa+ doqStWqQrxTRZkeJEF7mxVNhZwB8NKYpCXP3WtzaUvRxB5TIYlsOQChfkIlrD4CdAC/V YSlDppRe0nAh7/uxwW/HXQ5Ko4vQ8ZSZ2ohqxikKkTSUb2VWFTSwtvOWjWXWqJ0FZQBb YdQA== X-Gm-Message-State: AC+VfDyp9K7DSP4hHjwKV/O+zYpYS41bkYRojVzXcsWJxMXM8cOxCik9 dDVxupxkc/dnyVyghjTticlYrw== X-Google-Smtp-Source: ACHHUZ7hbjlFul9BhQ6lsFkY6iiT8IZW8bhnKF8+uWKmg2aPtdDCUoOQ4BzCjgUf8788AI2sQCH6Ag== X-Received: by 2002:adf:fa87:0:b0:309:36e9:5834 with SMTP id h7-20020adffa87000000b0030936e95834mr3407382wrr.61.1685045471078; Thu, 25 May 2023 13:11:11 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id f6-20020adff986000000b00306281cfa59sm2802772wrr.47.2023.05.25.13.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 13:11:10 -0700 (PDT) From: Matthieu Baerts Date: Thu, 25 May 2023 22:10:36 +0200 Subject: [PATCH b4 1/2] trailers: accept recognized link trailers Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230525-closes-tags-v1-1-ed41b1773cb6@tessares.net> References: <20230525-closes-tags-v1-0-ed41b1773cb6@tessares.net> In-Reply-To: <20230525-closes-tags-v1-0-ed41b1773cb6@tessares.net> To: "Kernel.org Tools" Cc: Nick Desaulniers , Konstantin Ryabitsev , Matthieu Baerts , Follow Upper , Cover Upper , Test Override X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3135; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=yyNBdgf2YDpZ9rnvnECQ6UVhsIDwg/Rc2bCW8YqiZik=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkb8Dd97avaLfwaNieieEc8MH8OaFhidLoohM2m JmznCrvavuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZG/A3QAKCRD2t4JPQmmg c1qnEACvuFFYBtnYXjqpzSqfhc+GWapoYnfSp0RskRAenBfdgOVdq+TdMNaREvpGPBesSeIOzVC yZ5yUH0nPU9O8DH4ZWXWdp5f+TBlBuNP2pFaaHgFi69n8xQ8/sKAT5Lg6vmlRtS/7b9/jDI3gPC AP5zEvnUGhACH1F8Gcp8aQYH5p5agqIqpcz7A34G/61ZScSOP2tyGcpcwkVMieVqA64NPFxMqoc qgObihAOFWHeJ/S9fTgCcNjPoFfhOFgI9enEJrHPkfjHZwVhw6V5QTbWjxd7r+56vLShxt6Q+jG m78CG6q9BrcNHvFfvoAWn9aKnbhD1Q5lKljG1FVlDP3PoE93brUanrTSZuD6+r4WS2yQG//MjZS 4OkvfwQ18S9CkuuHlE4jefLrlXXezdWM8vqsLOzrwnlV6hbCmQLMuXsE5VR0ny/360xuNg3ConR 61a0j8TKbGLTuoJQnFnjlcj95BoSnV7tqoudubPxxjwzogRbgdaikTIAEVFHUVleHUWiORlp2HL wDg/zZLPffjnypQn+/KN4hFmwdrOtbLTBPG+vv/WAn7B9s9RnHcgRyQbDSyEbZjn1dWAIzxwbOn GSiUylI6/hFO7U+IGToUhLYs3LmA6WPq9zl02j5hWMsdT6qGJdpeteOIgITUnwse5kItBn09xPH eUTMqlal6wO5XSA== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 It looks like all all link trailers were ignored. Now we accept 'link' and 'buglink' that were already in the list of non person categories. Note that existing test files have been modified. You will probably need to run "pytest --cache-clear" to avoid using the previous version. Fixes: 7d1a05e ("trailers: ignore non-recognized link trailers") Signed-off-by: Matthieu Baerts --- b4/__init__.py | 6 ++++-- tests/samples/trailers-thread-with-cover-followup.mbox | 1 + tests/samples/trailers-thread-with-cover-followup.verify | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index 1af6993..e9e7b64 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1656,7 +1656,8 @@ class LoreMessage: def find_trailers(body: str, followup: bool = False) -> Tuple[List[LoreTrailer], List[str]]: ignores = {'phone', 'email'} headers = {'subject', 'date', 'from'} - nonperson = {'fixes', 'subject', 'date', 'link', 'buglink', 'obsoleted-by', 'change-id', 'base-commit'} + links = {'link', 'buglink'} + nonperson = links | {'fixes', 'subject', 'date', 'obsoleted-by', 'change-id', 'base-commit'} # Ignore everything below standard email signature marker body = body.split('\n-- \n', 1)[0].strip() + '\n' # Fix some more common copypasta trailer wrapping @@ -1695,7 +1696,8 @@ class LoreMessage: if not mperson and lname not in nonperson: logger.debug('Ignoring %s (not a recognized non-person trailer)', line) continue - if re.search(r'https?://', ovalue): + mlink = re.search(r'https?://', ovalue) + if mlink and lname not in links: logger.debug('Ignoring %s (not a recognized link trailer)', line) continue diff --git a/tests/samples/trailers-thread-with-cover-followup.mbox b/tests/samples/trailers-thread-with-cover-followup.mbox index d9dc64a..bbdeeeb 100644 --- a/tests/samples/trailers-thread-with-cover-followup.mbox +++ b/tests/samples/trailers-thread-with-cover-followup.mbox @@ -225,6 +225,7 @@ To: list@example.org > Signed-off-by: Konstantin Ryabitsev Tested-by: Follow Upper +Link: https://example.org -- Follow Upper diff --git a/tests/samples/trailers-thread-with-cover-followup.verify b/tests/samples/trailers-thread-with-cover-followup.verify index 6478e6f..b42e1ed 100644 --- a/tests/samples/trailers-thread-with-cover-followup.verify +++ b/tests/samples/trailers-thread-with-cover-followup.verify @@ -4,6 +4,7 @@ Life imitatus artem. Signed-off-by: Konstantin Ryabitsev Tested-by: Follow Upper +Link: https://example.org Reviewed-by: Cover Upper Signed-off-by: Test Override --- From patchwork Thu May 25 20:10:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13255622 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 460B624E81 for ; Thu, 25 May 2023 20:11:13 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-309382efe13so1786761f8f.2 for ; Thu, 25 May 2023 13:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1685045472; x=1687637472; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bCTpzvfx7kMb0Rk0cOn8T1ud6scqYziwc1+D7IhMx7M=; b=CascnhaMDh27fz4oROiNMwEeHIZDbgpF2Pse0gC6obZu9ew2xZl/zYItA639wQYI99 hA6rN9fym/gJqMRnEHxNTBPOhPLpDhhV16Y2c2surXriRfcr6ZI8uX5TAjoG0s75hGt8 rtD4+Zc/wObYCye9ZOGL5u/lgVq8u4H1OkK8wO7K1cldhkq8atJb1TwV2VO0/0vr17CP hWm2vSILk8MU2YCSOdGpxG8yDnM2oG11s30ce5/GR2HkUMw5eSp7t6ampHEchuqP4ya2 sti0IEL/w23kR/J651eBaGFChv9AOulccgmINLd34BAGKPV+6KSsED2KhxCDAIRtG9J1 dKqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685045472; x=1687637472; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bCTpzvfx7kMb0Rk0cOn8T1ud6scqYziwc1+D7IhMx7M=; b=cOrCKmLYjj/AblhsmLrjAkrk8zivwuHu1nIxuhigKUQpWH0h3yywj+AKzvODeKdZ63 LfIBMRB+iqBswxEjazSb4m0GqkdJgewKhPWSnD7MqtZgrHJpXVWINykwbJlLn4wrQc/D MPb/EsrA2j7+x5T1cORiqvoSkKcZLlZghLaaqR1O/1t2C8HhJ6lkCNw3R89af9B1Vty6 UqU1/RNgQ2Nb+Un2XWeS/wTrMfxsmA1P1amfHYPR+eoBAUmc8zWSDZOuF9QtwnRA+w86 5miSX2LkEEjZJPqIyCL18+1EYE0xGylg8ZLAKdz77J3knxm1/ezQbAcEXEKftH6Ng6el Urng== X-Gm-Message-State: AC+VfDyK/00MEbeTqqRlJBOcJGb9SWLpNafLJdYybT7Hi1sK/pZlBBiq GeSpDT3co1by/rnaggevG+wuDQ== X-Google-Smtp-Source: ACHHUZ7HJB1r6XY65EzXNB6Jfpi8B6KkDs735yjxb5ZQ8snOW2iEQNPil05c8OBRR9NbJf5+iRH7gA== X-Received: by 2002:adf:ec0b:0:b0:306:34e4:be40 with SMTP id x11-20020adfec0b000000b0030634e4be40mr3374965wrn.33.1685045472094; Thu, 25 May 2023 13:11:12 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id f6-20020adff986000000b00306281cfa59sm2802772wrr.47.2023.05.25.13.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 13:11:11 -0700 (PDT) From: Matthieu Baerts Date: Thu, 25 May 2023 22:10:37 +0200 Subject: [PATCH b4 2/2] trailers: add 'Closes' as recognized link trailer Precedence: bulk X-Mailing-List: tools@linux.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20230525-closes-tags-v1-2-ed41b1773cb6@tessares.net> References: <20230525-closes-tags-v1-0-ed41b1773cb6@tessares.net> In-Reply-To: <20230525-closes-tags-v1-0-ed41b1773cb6@tessares.net> To: "Kernel.org Tools" Cc: Nick Desaulniers , Konstantin Ryabitsev , Matthieu Baerts , Follow Upper , Cover Upper , Test Override X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4011; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=A8sFO7NQ7u+LbrO5sC8hk8YXHm9J1zrfb0CF9TbQmLM=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkb8DdYHOAfjf0OMqrcd8gjtAkjbo1zi9mAuv0p 2N+g/VZb7aJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZG/A3QAKCRD2t4JPQmmg c8poD/9YwYBtg9rFuuqu3Wp+uKDIX7xoZiQzNJFrWJefWylD/kYT6qCX39/rpStM7Mw+MpHRGiz BVjfRIYFXbqnl8tfTV72dHXM1ASkJI+Y7t6AtBSMx/kQVPSSM8h7BHKRLuYWlY5nBklArXTU8Tg G7msWUNYLbgbMd/Sdz6NfRQbHC+53P9oy8kgVUUTyOvQJ6nwX5ggQJeJswuFU80BROlqXBkHbzX k+yIDjAjJuXgF9g2/tAz/dSk50lLfl/2CZfosi4HPWhj63c0DJy/Rdi3f2SepFfBRnYhNFQbkHT beHT51mXcKBdYxBUF908VO4wDSCZFs6kQEaMBFAJYFpH6pUV2FAWhcVWHETmQzP2WO/9WUWFirM YXW/+lYK/lLMbGL/nnjJIuWeTkWtbnguSgc05hyVd40QboBFYvmeZTzxBwOLYI1IIlDI4cXZs9e 2lntHW0aFnCGeCZSVh59/y0Y31uhyb1uLbl/5KA5rXTVSCx8zvYrk1cqjT/emYKppG0UHHVX+8S vxL2/t8/Zs21ZCsOoOYYn/cyoBpCvxHnoZ5Ofoxq+lA5APTlTl3JsCYdxpXNUKhNtwDiukaUqj3 72fpdpH4iJrui95RQcM4jaIZaEZk2LVBeZ4+OO4bkFGXpGs6VixJGX42RW0G8eklJ6LfyUjFKF+ 3xJCy2XKML5FEkQ== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The Closes tag has been used for quite a long time in the Linux kernel, mainly by DRM and MPTCP subsystems. It is used by some bug trackers like GitHub, GitLab and bugzilla.kernel.org to automate the closure of issues when a patch is accepted. In Linux 6.3, checkpatch started to complain about this tag because it has never been described in the documentation. The situation has changed in Linux 6.4 [1]: I initially just wanted to allow the Closes tag but some reviewers pointed out that bots reading mailing lists like RegzBot would be interested to have it instead of the Link tag when any kind of bug is being closed. So now after a Reported-by, checkpatch.pl now suggests to add a Closes with a link. In other words, it is now more common to see this Closes tag in the Linux kernel. It is certainly used in many other projects than the Linux kernel. This Closes tag is treated as a Link tag. Note that existing test files have been modified. You will probably need to run "pytest --cache-clear" to avoid using the previous version. Link: https://lore.kernel.org/all/20230314-doc-checkpatch-closes-tag-v4-0-d26d1fa66f9f@tessares.net/ [1] Reported-by: Nick Desaulniers Closes: https://lore.kernel.org/all/CAKwvOdm=Zk8YhrPptN3k7UQo+1n7Ws=Qox=BwTR9bbjPJJYz8A@mail.gmail.com/ Signed-off-by: Matthieu Baerts --- b4/__init__.py | 4 ++-- tests/samples/trailers-thread-with-cover-followup.mbox | 1 + tests/samples/trailers-thread-with-cover-followup.verify | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index e9e7b64..44deacd 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -885,7 +885,7 @@ class LoreTrailer: addr: Optional[Tuple[str, str]] = None lmsg = None # Small list of recognized utility trailers - _utility: Set[str] = {'fixes', 'link', 'buglink', 'obsoleted-by', 'message-id', 'change-id', 'base-commit'} + _utility: Set[str] = {'fixes', 'link', 'buglink', 'closes', 'obsoleted-by', 'message-id', 'change-id', 'base-commit'} def __init__(self, name: Optional[str] = None, value: Optional[str] = None, extinfo: Optional[str] = None, msg: Optional[email.message.Message] = None): @@ -1656,7 +1656,7 @@ class LoreMessage: def find_trailers(body: str, followup: bool = False) -> Tuple[List[LoreTrailer], List[str]]: ignores = {'phone', 'email'} headers = {'subject', 'date', 'from'} - links = {'link', 'buglink'} + links = {'link', 'buglink', 'closes'} nonperson = links | {'fixes', 'subject', 'date', 'obsoleted-by', 'change-id', 'base-commit'} # Ignore everything below standard email signature marker body = body.split('\n-- \n', 1)[0].strip() + '\n' diff --git a/tests/samples/trailers-thread-with-cover-followup.mbox b/tests/samples/trailers-thread-with-cover-followup.mbox index bbdeeeb..5c4e64e 100644 --- a/tests/samples/trailers-thread-with-cover-followup.mbox +++ b/tests/samples/trailers-thread-with-cover-followup.mbox @@ -226,6 +226,7 @@ To: list@example.org Tested-by: Follow Upper Link: https://example.org +Closes: https://example.org/bug/1234 -- Follow Upper diff --git a/tests/samples/trailers-thread-with-cover-followup.verify b/tests/samples/trailers-thread-with-cover-followup.verify index b42e1ed..acd6278 100644 --- a/tests/samples/trailers-thread-with-cover-followup.verify +++ b/tests/samples/trailers-thread-with-cover-followup.verify @@ -5,6 +5,7 @@ Life imitatus artem. Signed-off-by: Konstantin Ryabitsev Tested-by: Follow Upper Link: https://example.org +Closes: https://example.org/bug/1234 Reviewed-by: Cover Upper Signed-off-by: Test Override ---