public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/3] Mergify Enhancements
@ 2021-07-08  3:48 Michael D Kinney
  2021-07-08  3:49 ` [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py Michael D Kinney
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Michael D Kinney @ 2021-07-08  3:48 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Liming Gao, Bob Feng, Yuwei Chen

* Removed FINISHED and FAILED states with 10 second delays
* Update PatchCheck.py to ignore commit message format issues
  in merge commeits added by Merfigy.
* Enable Mergify queue feature to support auto rebase when
  'push' label is set and gauarntee that all EDK II CI checks
  are run before merging in changes with linear history.
* Use status checks configured in GitHub branch protections
* Allow non EDK II Maintainers to create a PR
  Requires an EDK II Maintainer to accept the change and
  request merge by adding 'push' label.  Only EDK II Maintainers
  have ability to set/clear labels.
* Do not automatically close PRs for personal builds.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (3):
  BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
  .mergify: Simplify Mergify rules using GitHub status checks
  .azurepipelines: Remove FINISHED and FAILED states

 .../templates/pr-gate-build-job.yml           | 20 ------
 .mergify/config.yml                           | 71 ++++---------------
 BaseTools/Scripts/PatchCheck.py               | 18 +++--
 3 files changed, 24 insertions(+), 85 deletions(-)

-- 
2.32.0.windows.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
  2021-07-08  3:48 [Patch 0/3] Mergify Enhancements Michael D Kinney
@ 2021-07-08  3:49 ` Michael D Kinney
  2021-07-08  3:55   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
  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
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Michael D Kinney @ 2021-07-08  3:49 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen

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://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format'
@@ -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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks
  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:49 ` 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-09  5:09 ` 回复: [edk2-devel] [Patch 0/3] Mergify Enhancements gaoliming
  3 siblings, 1 reply; 9+ messages in thread
From: Michael D Kinney @ 2021-07-08  3:49 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Sean Brogan, Bret Barkelew

* Enable Mergify queue feature to support auto rebase when
  'push' label is set and gauarntee that all EDK II CI checks
  are run before merging in changes with linear history.
* Use status checks configured in GitHub branch protections
* Allow non EDK II Maintainers to create a PR
  Requires an EDK II Maintainer to accept the change and
  request merge by adding 'push' label.  Only EDK II Maintainers
  have ability to set/clear labels.
* Do not automatically close PRs for personal builds.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .mergify/config.yml | 71 ++++++++-------------------------------------
 1 file changed, 12 insertions(+), 59 deletions(-)

diff --git a/.mergify/config.yml b/.mergify/config.yml
index 9774aaf49774..bd6da4c77937 100644
--- a/.mergify/config.yml
+++ b/.mergify/config.yml
@@ -16,7 +16,7 @@
 # * This file must be checked into the 'default' branch of a repo.  Copies
 #   of this file on other branches of a repo are ignored by Mergify.
 #
-# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 # https://github.com/apps/mergify
@@ -24,74 +24,27 @@
 #
 ##
 
+queue_rules:
+  - name: default
+    conditions:
+      - base~=(^main|^master|^stable/)
+      - label=push
+
 pull_request_rules:
-
   - name: Automatically merge a PR when all required checks pass and 'push' label is present
     conditions:
-      - base~=(^master|^stable/)
+      - base~=(^main|^master|^stable/)
       - label=push
-      - author=@tianocore/edk-ii-maintainers
-      - status-success=tianocore.PatchCheck
-      - status-success=Ubuntu GCC5 PR
-      - status-success=Windows VS2019 PR
     actions:
-      merge:
-        strict: true
+      queue:
         method: rebase
-
-  - name: Automatically close a PR when all required checks pass and 'push' label is not present
-    conditions:
-      - base~=(^master|^stable/)
-      - -label=push
-      - -closed
-      - status-success=tianocore.PatchCheck
-      - status-success=Ubuntu GCC5 PR
-      - status-success=Windows VS2019 PR
-      - status-success=Ubuntu GCC5 PR (FINISHED)
-      - status-success=Windows VS2019 PR (FINISHED)
-    actions:
-      close:
-        message: All checks passed. Auto close personal build.
+        rebase_fallback: none
+        name: default
 
   - name: Post a comment on a PR that can not be merged due to a merge conflict
     conditions:
-      - base~=(^master|^stable/)
+      - base~=(^main|^master|^stable/)
       - conflict
     actions:
       comment:
         message: PR can not be merged due to conflict.  Please rebase and resubmit
-
-  - name: Automatically close a PR that fails the EDK II Maintainers membership check and 'push' label is present
-    conditions:
-      - base~=(^master|^stable/)
-      - label=push
-      - -author=@tianocore/edk-ii-maintainers
-    actions:
-      close:
-        message: PR submitter is not a member of the Tianocore EDK II Maintainers team
-
-  - name: Post a comment on a PR if PatchCheck fails
-    conditions:
-      - base~=(^master|^stable/)
-      - status-failure=tianocore.PatchCheck
-    actions:
-      comment:
-        message: PR can not be merged due to a PatchCheck failure.  Please resolve and resubmit
-
-  - name: Post a comment on a PR if Ubuntu GCC5 fails
-    conditions:
-      - base~=(^master|^stable/)
-      - status-failure=Ubuntu GCC5 PR
-      - status-success=Ubuntu GCC5 PR (FAILED)
-    actions:
-      comment:
-        message: PR can not be merged due to an Ubuntu GCC5 failure.  Please resolve and resubmit
-
-  - name: Post a comment on a PR if Windows VS2019 fails
-    conditions:
-      - base~=(^master|^stable/)
-      - status-failure=Windows VS2019 PR
-      - status-success=Windows VS2019 PR (FAILED)
-    actions:
-      comment:
-        message: PR can not be merged due to a Windows VS2019 failure.  Please resolve and resubmit
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states
  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:49 ` [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks Michael D Kinney
@ 2021-07-08  3:49 ` Michael D Kinney
  2021-07-08  3:51   ` [EXTERNAL] " Bret Barkelew
  2021-07-09  5:09 ` 回复: [edk2-devel] [Patch 0/3] Mergify Enhancements gaoliming
  3 siblings, 1 reply; 9+ messages in thread
From: Michael D Kinney @ 2021-07-08  3:49 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Liming Gao

Remove 10 second delay workarounds for issues observed
when Mergify was originally enabled.  These issues are
no longer present when GitHub branch protections are
used for status checks.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../templates/pr-gate-build-job.yml           | 20 -------------------
 1 file changed, 20 deletions(-)

diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipelines/templates/pr-gate-build-job.yml
index 3f9a28024567..207acc76316f 100644
--- a/.azurepipelines/templates/pr-gate-build-job.yml
+++ b/.azurepipelines/templates/pr-gate-build-job.yml
@@ -67,23 +67,3 @@ jobs:
       build_pkgs: $(Build.Pkgs)
       build_targets: $(Build.Targets)
       build_archs: ${{ parameters.arch_list }}
-
-- job: FINISHED
-  dependsOn: Build_${{ parameters.tool_chain_tag }}
-  condition: succeeded()
-  steps:
-  - checkout: none
-  - script: |
-      echo FINISHED
-      sleep 10
-    displayName: FINISHED
-
-- job: FAILED
-  dependsOn: Build_${{ parameters.tool_chain_tag }}
-  condition: failed()
-  steps:
-  - checkout: none
-  - script: |
-      echo FAILED
-      sleep 10
-    displayName: FAILED
-- 
2.32.0.windows.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [EXTERNAL] [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states
  2021-07-08  3:49 ` [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states Michael D Kinney
@ 2021-07-08  3:51   ` Bret Barkelew
  0 siblings, 0 replies; 9+ messages in thread
From: Bret Barkelew @ 2021-07-08  3:51 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Sean Brogan, Liming Gao

[-- Attachment #1: Type: text/plain, Size: 1823 bytes --]

Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret

From: Michael D Kinney<mailto:michael.d.kinney@intel.com>
Sent: Wednesday, July 7, 2021 8:49 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Sean Brogan<mailto:sean.brogan@microsoft.com>; Bret Barkelew<mailto:Bret.Barkelew@microsoft.com>; Liming Gao<mailto:gaoliming@byosoft.com.cn>
Subject: [EXTERNAL] [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states

Remove 10 second delay workarounds for issues observed
when Mergify was originally enabled.  These issues are
no longer present when GitHub branch protections are
used for status checks.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .../templates/pr-gate-build-job.yml           | 20 -------------------
 1 file changed, 20 deletions(-)

diff --git a/.azurepipelines/templates/pr-gate-build-job.yml b/.azurepipelines/templates/pr-gate-build-job.yml
index 3f9a28024567..207acc76316f 100644
--- a/.azurepipelines/templates/pr-gate-build-job.yml
+++ b/.azurepipelines/templates/pr-gate-build-job.yml
@@ -67,23 +67,3 @@ jobs:
       build_pkgs: $(Build.Pkgs)
       build_targets: $(Build.Targets)
       build_archs: ${{ parameters.arch_list }}
-
-- job: FINISHED
-  dependsOn: Build_${{ parameters.tool_chain_tag }}
-  condition: succeeded()
-  steps:
-  - checkout: none
-  - script: |
-      echo FINISHED
-      sleep 10
-    displayName: FINISHED
-
-- job: FAILED
-  dependsOn: Build_${{ parameters.tool_chain_tag }}
-  condition: failed()
-  steps:
-  - checkout: none
-  - script: |
-      echo FAILED
-      sleep 10
-    displayName: FAILED
--
2.32.0.windows.1


[-- Attachment #2: Type: text/html, Size: 4185 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [EXTERNAL] [edk2-devel] [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
  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
  2021-07-09  5:30   ` Bob Feng
  1 sibling, 0 replies; 9+ messages in thread
From: Bret Barkelew @ 2021-07-08  3:55 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kinney, Michael D
  Cc: Feng, Bob C, Liming Gao, Chen, Yuwei

[-- 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&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7C44bf20b900a8463872f608d941c36036%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129659549071%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ScoSoLs0hgaj7DOtCjE1uevYTX2oAHOqJOHKJYZQ%2BGw%3D&amp;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 --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [EXTERNAL] [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks
  2021-07-08  3:49 ` [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks Michael D Kinney
@ 2021-07-08  3:55   ` Bret Barkelew
  0 siblings, 0 replies; 9+ messages in thread
From: Bret Barkelew @ 2021-07-08  3:55 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Liming Gao, Sean Brogan

[-- Attachment #1: Type: text/plain, Size: 5137 bytes --]

Acked-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret

From: Michael D Kinney<mailto:michael.d.kinney@intel.com>
Sent: Wednesday, July 7, 2021 8:49 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Liming Gao<mailto:gaoliming@byosoft.com.cn>; Sean Brogan<mailto:sean.brogan@microsoft.com>; Bret Barkelew<mailto:Bret.Barkelew@microsoft.com>
Subject: [EXTERNAL] [Patch 2/3] .mergify: Simplify Mergify rules using GitHub status checks

* Enable Mergify queue feature to support auto rebase when
  'push' label is set and gauarntee that all EDK II CI checks
  are run before merging in changes with linear history.
* Use status checks configured in GitHub branch protections
* Allow non EDK II Maintainers to create a PR
  Requires an EDK II Maintainer to accept the change and
  request merge by adding 'push' label.  Only EDK II Maintainers
  have ability to set/clear labels.
* Do not automatically close PRs for personal builds.

Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
 .mergify/config.yml | 71 ++++++++-------------------------------------
 1 file changed, 12 insertions(+), 59 deletions(-)

diff --git a/.mergify/config.yml b/.mergify/config.yml
index 9774aaf49774..bd6da4c77937 100644
--- a/.mergify/config.yml
+++ b/.mergify/config.yml
@@ -16,7 +16,7 @@
 # * This file must be checked into the 'default' branch of a repo.  Copies
 #   of this file on other branches of a repo are ignored by Mergify.
 #
-# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 # https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapps%2Fmergify&amp;data=04%7C01%7CBret.Barkelew%40microsoft.com%7Cb73475b4d67744f2e3ce08d941c35a00%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637613129552748468%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=bWUUW1qS2GsSqRMBiZELIj4qlLBe06nkALTz0hkLrLo%3D&amp;reserved=0
@@ -24,74 +24,27 @@
 #
 ##

+queue_rules:
+  - name: default
+    conditions:
+      - base~=(^main|^master|^stable/)
+      - label=push
+
 pull_request_rules:
-
   - name: Automatically merge a PR when all required checks pass and 'push' label is present
     conditions:
-      - base~=(^master|^stable/)
+      - base~=(^main|^master|^stable/)
       - label=push
-      - author=@tianocore/edk-ii-maintainers
-      - status-success=tianocore.PatchCheck
-      - status-success=Ubuntu GCC5 PR
-      - status-success=Windows VS2019 PR
     actions:
-      merge:
-        strict: true
+      queue:
         method: rebase
-
-  - name: Automatically close a PR when all required checks pass and 'push' label is not present
-    conditions:
-      - base~=(^master|^stable/)
-      - -label=push
-      - -closed
-      - status-success=tianocore.PatchCheck
-      - status-success=Ubuntu GCC5 PR
-      - status-success=Windows VS2019 PR
-      - status-success=Ubuntu GCC5 PR (FINISHED)
-      - status-success=Windows VS2019 PR (FINISHED)
-    actions:
-      close:
-        message: All checks passed. Auto close personal build.
+        rebase_fallback: none
+        name: default

   - name: Post a comment on a PR that can not be merged due to a merge conflict
     conditions:
-      - base~=(^master|^stable/)
+      - base~=(^main|^master|^stable/)
       - conflict
     actions:
       comment:
         message: PR can not be merged due to conflict.  Please rebase and resubmit
-
-  - name: Automatically close a PR that fails the EDK II Maintainers membership check and 'push' label is present
-    conditions:
-      - base~=(^master|^stable/)
-      - label=push
-      - -author=@tianocore/edk-ii-maintainers
-    actions:
-      close:
-        message: PR submitter is not a member of the Tianocore EDK II Maintainers team
-
-  - name: Post a comment on a PR if PatchCheck fails
-    conditions:
-      - base~=(^master|^stable/)
-      - status-failure=tianocore.PatchCheck
-    actions:
-      comment:
-        message: PR can not be merged due to a PatchCheck failure.  Please resolve and resubmit
-
-  - name: Post a comment on a PR if Ubuntu GCC5 fails
-    conditions:
-      - base~=(^master|^stable/)
-      - status-failure=Ubuntu GCC5 PR
-      - status-success=Ubuntu GCC5 PR (FAILED)
-    actions:
-      comment:
-        message: PR can not be merged due to an Ubuntu GCC5 failure.  Please resolve and resubmit
-
-  - name: Post a comment on a PR if Windows VS2019 fails
-    conditions:
-      - base~=(^master|^stable/)
-      - status-failure=Windows VS2019 PR
-      - status-success=Windows VS2019 PR (FAILED)
-    actions:
-      comment:
-        message: PR can not be merged due to a Windows VS2019 failure.  Please resolve and resubmit
--
2.32.0.windows.1


[-- Attachment #2: Type: text/html, Size: 9709 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* 回复: [edk2-devel] [Patch 0/3] Mergify Enhancements
  2021-07-08  3:48 [Patch 0/3] Mergify Enhancements Michael D Kinney
                   ` (2 preceding siblings ...)
  2021-07-08  3:49 ` [Patch 3/3] .azurepipelines: Remove FINISHED and FAILED states Michael D Kinney
@ 2021-07-09  5:09 ` gaoliming
  3 siblings, 0 replies; 9+ messages in thread
From: gaoliming @ 2021-07-09  5:09 UTC (permalink / raw)
  To: devel, michael.d.kinney
  Cc: 'Sean Brogan', 'Bret Barkelew',
	'Bob Feng', 'Yuwei Chen'

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Michael D
> Kinney
> 发送时间: 2021年7月8日 11:49
> 收件人: devel@edk2.groups.io
> 抄送: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>; Liming Gao <gaoliming@byosoft.com.cn>;
> Bob Feng <bob.c.feng@intel.com>; Yuwei Chen <yuwei.chen@intel.com>
> 主题: [edk2-devel] [Patch 0/3] Mergify Enhancements
> 
> * Removed FINISHED and FAILED states with 10 second delays
> * Update PatchCheck.py to ignore commit message format issues
>   in merge commeits added by Merfigy.
> * Enable Mergify queue feature to support auto rebase when
>   'push' label is set and gauarntee that all EDK II CI checks
>   are run before merging in changes with linear history.
> * Use status checks configured in GitHub branch protections
> * Allow non EDK II Maintainers to create a PR
>   Requires an EDK II Maintainer to accept the change and
>   request merge by adding 'push' label.  Only EDK II Maintainers
>   have ability to set/clear labels.
> * Do not automatically close PRs for personal builds.
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Michael D Kinney (3):
>   BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
>   .mergify: Simplify Mergify rules using GitHub status checks
>   .azurepipelines: Remove FINISHED and FAILED states
> 
>  .../templates/pr-gate-build-job.yml           | 20 ------
>  .mergify/config.yml                           | 71 ++++---------------
>  BaseTools/Scripts/PatchCheck.py               | 18 +++--
>  3 files changed, 24 insertions(+), 85 deletions(-)
> 
> --
> 2.32.0.windows.1
> 
> 
> 
> 
> 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch 1/3] BaseTools/Scripts: Ignore Mergify merge commits in PatchCheck.py
  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   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
@ 2021-07-09  5:30   ` Bob Feng
  1 sibling, 0 replies; 9+ messages in thread
From: Bob Feng @ 2021-07-09  5:30 UTC (permalink / raw)
  To: Kinney, Michael D, devel@edk2.groups.io; +Cc: Liming Gao, Chen, Christine

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Thursday, July 8, 2021 11:49 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [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://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format'
@@ -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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-07-09  5:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox