From: "Bret Barkelew" <bret.barkelew@microsoft.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Feng, Bob C" <bob.c.feng@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
"Chen, Yuwei" <yuwei.chen@intel.com>
Subject: Re: [EXTERNAL] [edk2-devel] [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
Date: Thu, 8 Jul 2021 03:55:16 +0000 [thread overview]
Message-ID: <MW4PR21MB1907E6C8AAFF3D0E5AA29B95EF199@MW4PR21MB1907.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20210708034902.1608-2-michael.d.kinney@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3578 bytes --]
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
- Bret
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Michael D Kinney via groups.io <michael.d.kinney=intel.com@groups.io>
Sent: Wednesday, July 7, 2021 8:49:00 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Yuwei <yuwei.chen@intel.com>
Subject: [EXTERNAL] [edk2-devel] [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
Mergify adds merge commits to a PR when processing PRs using
the queue feature with auto rebase. Update PatchCheck.py
to ignore commit message issues with these merge commits.
These merge commits are not added to the base branch when
the PR is merged by Mergify.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
BaseTools/Scripts/PatchCheck.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index 80754e763c5a..63e6223f8ebc 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -1,7 +1,7 @@
## @file
# Check a patch for various format issues
#
-# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (C) 2020, Red Hat, Inc.<BR>
# Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
#
@@ -89,22 +89,28 @@ class EmailAddressCheck:
class CommitMessageCheck:
"""Checks the contents of a git commit message."""
- def __init__(self, subject, message):
+ def __init__(self, subject, message, author_email):
self.ok = True
if subject is None and message is None:
self.error('Commit message is missing!')
return
+ MergifyMerge = False
+ if "mergify[bot]@users.noreply.github.com" in author_email:
+ if "Merge branch" in subject:
+ MergifyMerge = True
+
self.subject = subject
self.msg = message
print (subject)
self.check_contributed_under()
- self.check_signed_off_by()
- self.check_misc_signatures()
- self.check_overall_format()
+ if not MergifyMerge:
+ self.check_signed_off_by()
+ self.check_misc_signatures()
+ self.check_overall_format()
self.report_message_result()
url = 'https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FCommit-Message-Format&data=04%7C01%7CBret.Barkelew%40microsoft.com%7C44bf20b900a8463872f608d941c36036%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129659549071%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ScoSoLs0hgaj7DOtCjE1uevYTX2oAHOqJOHKJYZQ%2BGw%3D&reserved=0'
@@ -522,7 +528,7 @@ class CheckOnePatch:
email_check = EmailAddressCheck(self.author_email, 'Author')
email_ok = email_check.ok
- msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg)
+ msg_check = CommitMessageCheck(self.commit_subject, self.commit_msg, self.author_email)
msg_ok = msg_check.ok
diff_ok = True
--
2.32.0.windows.1
[-- Attachment #2: Type: text/html, Size: 7487 bytes --]
next prev parent reply other threads:[~2021-07-08 3:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-08 3:48 [Patch 0/3] Mergify Enhancements Michael D Kinney
2021-07-08 3:49 ` [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py Michael D Kinney
2021-07-08 3:55 ` Bret Barkelew [this message]
2021-07-09 5:30 ` Bob Feng
2021-07-08 3:49 ` [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks Michael D Kinney
2021-07-08 3:55 ` [EXTERNAL] " Bret Barkelew
2021-07-08 3:49 ` [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states Michael D Kinney
2021-07-08 3:51 ` [EXTERNAL] " Bret Barkelew
2021-07-09 5:09 ` 回复: [edk2-devel] [Patch 0/3] Mergify Enhancements gaoliming
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=MW4PR21MB1907E6C8AAFF3D0E5AA29B95EF199@MW4PR21MB1907.namprd21.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