public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: Ard Biesheuvel <ardb@kernel.org>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	"Demeter, Miki" <miki.demeter@intel.com>,
	"Kasbekar, Saloni" <saloni.kasbekar@intel.com>,
	Nickle Wang <nicklew@nvidia.com>,
	"Clark-williams, Zachary" <zachary.clark-williams@intel.com>,
	Abner Chang <abner.chang@amd.com>,
	"Igor Kulchytskyy" <igork@ami.com>,
	Nick Ramirez <nramirez@nvidia.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver binding start issue.
Date: Mon, 24 Jul 2023 21:53:17 +0000	[thread overview]
Message-ID: <CO1PR11MB4929877717963E36AB9D5329D202A@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAMj1kXHh8_nJUY-2cpuDu4aQDqi+RdjG9yumG17uW=QCvEbG6Q@mail.gmail.com>

Hi Ard,

I did a search for invalid tags in commit messages.  Here is what I suggest as 
a change to PatchCheck.py to catch the cases I observe that includes the fix
the to logic you suggested to find email addresses from edk2 groups/io mailing
lists.

=============================
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 900226f18fe5..1c432f9d5688 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -54,36 +54,55 @@ class EmailAddressCheck:
             print(prefix, line)
             count += 1

-    email_re1 = re.compile(r'(?:\s*)(.*?)(\s*)<(.+)>\s*$',
+    email_re1 = re.compile(r'(?:\s*)(.*?)(\s*)<(.+)>\s*(.*?)$',
                            re.MULTILINE|re.IGNORECASE)

     def check_email_address(self, email):
         email = email.strip()
         mo = self.email_re1.match(email)
+
+        # Check for too few fields
         if mo is None:
-            self.error("Email format is invalid: " + email.strip())
+            self.error("Email format is invalid: " + email)
+            return
+        if len (mo.groups()) < 3:
+            self.error("Email format is missing fields: " + email)
             return

+        # Check the name
         name = mo.group(1).strip()
-        if name == '':
-            self.error("Name is not provided with email address: " +
-                       email)
-        else:
-            quoted = len(name) > 2 and name[0] == '"' and name[-1] == '"'
-            if name.find(',') >= 0 and not quoted:
-                self.error('Add quotes (") around name with a comma: ' +
-                           name)
+        if ',' in name:
+            self.error('Change order of name and remove comma: ' + name)
+        if '"' in name:
+            self.error('Remove double quotes around name: ' + name)
+        if ' via ' in name:
+            self.error('Remove via from another source from name: ' + name)

-        if mo.group(2) == '':
-            self.error("There should be a space between the name and " +
+        # Check whitespace between name and email address
+        if len(mo.group(2)) != mo.group(2).count(' '):
+            self.error("There should only be spaces between the name and " +
                        "email address: " + email)

-        if mo.group(3).find(' ') >= 0:
-            self.error("The email address cannot contain a space: " +
+        # Check the email address
+        if mo.group(3).count(' ') >= 1:
+            self.error("The email address must not contain any spaces: " +
                        mo.group(3))

-        if ' via Groups.Io' in name and mo.group(3).endswith('@groups.io'):
-            self.error("Email rewritten by lists DMARC / DKIM / SPF: " +
+        if mo.group(3).count('=') >= 1:
+            self.error("The email address must not contain any '=': " +
+                       mo.group(3))
+
+        if mo.group(3).count('@') != 1:
+            self.error("The email address must contain a single @: " +
+                       mo.group(3))
+
+        if '@edk2.groups.io' in mo.group(3):
+            self.error("The email address cannot be from @edk2.groups.io: " +
+                       mo.group(3))
+
+        # Check for too many fields
+        if len(mo.groups()) > 3 and len(mo.group(4)) > 0:
+            self.error("Email format has too many fields: " +
                        email)
=============================

With this change I looked at the last 500 commits to edk2 repo and it finds
the following issues:

 * Remove double quotes around name: "devel@edk2.groups.io"
 * The email address cannot be from @edk2.groups.io: devel@edk2.groups.io
 * Change order of name and remove comma: "Xie, Yuanhao"
 * Remove double quotes around name: "Xie, Yuanhao"
 * Change order of name and remove comma: "Xie, Yuanhao"
 * Remove double quotes around name: "Xie, Yuanhao"
 * Change order of name and remove comma: "Xie, Yuanhao"
 * Remove double quotes around name: "Xie, Yuanhao"
 * Change order of name and remove comma: "Xie, Yuanhao"
 * Remove double quotes around name: "Xie, Yuanhao"
 * Change order of name and remove comma: "Xie, Yuanhao"
 * Remove double quotes around name: "Xie, Yuanhao"
 * Change order of name and remove comma: "Zhang, Hongbin1"
 * Remove double quotes around name: "Zhang, Hongbin1"
 * Remove double quotes around name: "devel@edk2.groups.io"
 * The email address cannot be from @edk2.groups.io: devel@edk2.groups.io
 * Change order of name and remove comma: "Aishwarya, KurugoduMelmatamX"
 * Remove double quotes around name: "Aishwarya, KurugoduMelmatamX"
 * Email format is invalid: Jiewen.yao@intel.com
 * Email format has too many fields: Jiewen Yao <jiewen.yao@intel.com> [jyao1]
 * Email format has too many fields: Yi Li <yi1.li@intel.com> [liyi77]
 * Email format has too many fields: Xiaoyu Lu <xiaoyu1.lu@intel.com> [xiaoyuxlu]
 * Email format has too many fields: Guomin Jiang <guomin.jiang@intel.com> [guominjia]
 * Change order of name and remove comma: "Ni, Ray"
 * Remove double quotes around name: "Ni, Ray"
 * Remove double quotes around name: "Mikolaj Lisik via groups.io"
 * Remove via from another source from name: "Mikolaj Lisik via groups.io"
 * The email address must not contain any '=': lisik=google.com@groups.io
 * Change order of name and remove comma: "Kinney, Michael D"
 * Remove double quotes around name: "Kinney, Michael D"
 * Change order of name and remove comma: "Liu, Zhiguang"
 * Remove double quotes around name: "Liu, Zhiguang"
 * Change order of name and remove comma: "Liu, Zhiguang"
 * Remove double quotes around name: "Liu, Zhiguang"
 * Change order of name and remove comma: "Liu, Zhiguang"
 * Remove double quotes around name: "Liu, Zhiguang"
 * Change order of name and remove comma: "Liu, Zhiguang"
 * Remove double quotes around name: "Liu, Zhiguang"
 * Change order of name and remove comma: "Tan, Ming"
 * Remove double quotes around name: "Tan, Ming"
 * The email address must not contain any spaces: igork @ami.com
 * The email address must not contain any spaces: igork @ami.com
 * The email address must not contain any spaces: igork @ami.com
 * The email address must not contain any spaces: igork @ami.com
 * The email address must not contain any spaces: igork @ami.com
 * Change order of name and remove comma: "Roth, Michael via groups.io"
 * Remove double quotes around name: "Roth, Michael via groups.io"
 * Remove via from another source from name: "Roth, Michael via groups.io"
 * The email address must not contain any '=': Michael.Roth=amd.com@groups.io
 * Change order of name and remove comma: "Roth, Michael via groups.io"
 * Remove double quotes around name: "Roth, Michael via groups.io"
 * Remove via from another source from name: "Roth, Michael via groups.io"
 * The email address must not contain any '=': Michael.Roth=amd.com@groups.io
 * Change order of name and remove comma: "Roth, Michael via groups.io"
 * Remove double quotes around name: "Roth, Michael via groups.io"
 * Remove via from another source from name: "Roth, Michael via groups.io"
 * The email address must not contain any '=': Michael.Roth=amd.com@groups.io
 * Change order of name and remove comma: "Duggapu, Chinni B"
 * Remove double quotes around name: "Duggapu, Chinni B"
 * Remove double quotes around name: "devel@edk2.groups.io"
 * The email address cannot be from @edk2.groups.io: devel@edk2.groups.io
 * Change order of name and remove comma: "Lin, MillerX"
 * Remove double quotes around name: "Lin, MillerX"
 * Change order of name and remove comma: "Lendacky, Thomas via groups.io"
 * Remove double quotes around name: "Lendacky, Thomas via groups.io"
 * Remove via from another source from name: "Lendacky, Thomas via groups.io"
 * The email address must not contain any '=': thomas.lendacky=amd.com@groups.io
 * Change order of name and remove comma: "Lendacky, Thomas via groups.io"
 * Remove double quotes around name: "Lendacky, Thomas via groups.io"
 * Remove via from another source from name: "Lendacky, Thomas via groups.io"
 * The email address must not contain any '=': thomas.lendacky=amd.com@groups.io
 * Change order of name and remove comma: "Albecki, Mateusz"
 * Remove double quotes around name: "Albecki, Mateusz"
 * Change order of name and remove comma: "Xie, Yuanhao"
 * Remove double quotes around name: "Xie, Yuanhao"

Let me know if you think this is too strict.

Mike

> -----Original Message-----
> From: Ard Biesheuvel <ardb@kernel.org>
> Sent: Thursday, July 20, 2023 10:19 AM
> To: devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>; Demeter, Miki
> <miki.demeter@intel.com>; Kasbekar, Saloni <saloni.kasbekar@intel.com>;
> Nickle Wang <nicklew@nvidia.com>; Clark-williams, Zachary <zachary.clark-
> williams@intel.com>; Abner Chang <abner.chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: Re: [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver
> binding start issue.
> 
> On Thu, 20 Jul 2023 at 19:10, Michael D Kinney
> <michael.d.kinney@intel.com> wrote:
> >
> > Hi Ard,
> >
> > This is my mistake.  I usually check the Author field when
> > adding Rb/Ab tags because I have seen lots of cases where
> > the Author field needs updating as well.  I forgot to do this
> > step in this one.
> >
> > I agree a CI check against the Author field being a valid
> > email address and not one of the mailing addresses would be
> > valuable.  Perhaps in PatchCheck.py?
> >
> 
> Yeah, and actually, a test seems to exist already but it didn't catch
> this particular case:
> 
>         if ' via Groups.Io' in name and
> mo.group(3).endswith('@groups.io'):
>             self.error("Email rewritten by lists DMARC / DKIM / SPF: " +
>                        email)
> 
> I suppose replacing the 'and' with 'or' would be sufficient here? I
> don't think @groups.io is ever a valid author email domain.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107191): https://edk2.groups.io/g/devel/message/107191
Mute This Topic: https://groups.io/mt/99821789/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



      reply	other threads:[~2023-07-24 21:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <174276A45CE2816B.5513@groups.io>
2023-06-28  0:55 ` [edk2-devel] [PATCH 2/2] NetworkPkg/HttpDxe: fix driver binding start issue Nickle Wang
2023-06-28 19:06   ` Saloni Kasbekar
2023-06-28 22:29     ` Nickle Wang
2023-06-29 22:28       ` Saloni Kasbekar
2023-07-13  6:54         ` Nickle Wang
2023-07-13 16:12           ` Saloni Kasbekar
2023-07-20  0:26             ` Michael D Kinney
2023-07-20  1:41               ` Michael D Kinney
2023-07-20 16:42                 ` Ard Biesheuvel
2023-07-20 17:07                   ` Michael D Kinney
2023-07-20 17:19                     ` Ard Biesheuvel
2023-07-24 21:53                       ` Michael D Kinney [this message]

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-list 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=CO1PR11MB4929877717963E36AB9D5329D202A@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /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