]> git.proxmox.com Git - mirror_edk2.git/commitdiff
.mergify: Add Mergify YML pull request rules configuration file
authorMichael D Kinney <michael.d.kinney@intel.com>
Fri, 18 Oct 2019 22:22:36 +0000 (15:22 -0700)
committerMichael D Kinney <michael.d.kinney@intel.com>
Mon, 11 Nov 2019 21:02:51 +0000 (13:02 -0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=2315

Add directory for the Mergify YML configuration files that
provides rules and actions used to process a pull request.

* Auto commit a PR from EDK II Maintainer with 'push' label
  set and all CI checks pass
* Auto close a PR from any developers without 'push' label
  set and all CI checks pass.
* Auto close a PR from a non EDK II Maintainer that has
  the 'push' label set.
* Post a comment to a PR that has a merge conflict.
  Submitter can resolved conflicts and reopen the PR.
* Post a comment to a PR that fails PatchCheck.py
  Submitter can resolve PatchCheck.py issues and
  reopen the PR.

Cc: Liming Gao <liming.gao@intel.com>
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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
.mergify/config.yml [new file with mode: 0644]

diff --git a/.mergify/config.yml b/.mergify/config.yml
new file mode 100644 (file)
index 0000000..26583de
--- /dev/null
@@ -0,0 +1,97 @@
+## @file\r
+# Mergify YML file that automatically merges a GitHub pull request against\r
+# edk2-ci if all of the GitHub branch protections have passed.  It also\r
+# contains rules to:\r
+# * auto close branches that are not from an EDK II Maintainer\r
+# * post a comment on pull requests that have merge conflicts.\r
+# * post a comment on pull requests that have PatchCheck.py errors.\r
+#\r
+# Configuration Notes:\r
+# * Update the 'base=edk2-ci' statements with the name of the branch to merge\r
+#   pull requests.\r
+#\r
+# * Update the 'status-failure' statement with the name of the name of the Azure\r
+#   Pipelines Build that performs the EDK II Maintainer check.\r
+#\r
+# * This file must be checked into the 'default' branch of a repo.  Copies\r
+#   of this file on other branches of a repo are ignored by Mergify.\r
+#\r
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
+#\r
+# https://github.com/apps/mergify\r
+# https://doc.mergify.io/\r
+#\r
+##\r
+\r
+pull_request_rules:\r
+\r
+  - name: Automatically merge a PR when all required checks pass and 'push' label is present\r
+    conditions:\r
+      - base=master\r
+      - label=push\r
+      - author=@tianocore/edk-ii-maintainers\r
+      - status-success=tianocore.PatchCheck\r
+      - status-success=Ubuntu GCC5 PR\r
+      - status-success=Windows VS2019 PR\r
+    actions:\r
+      merge:\r
+        strict: true\r
+        method: rebase\r
+\r
+  - name: Automatically close a PR when all required checks pass and 'push' label is not present\r
+    conditions:\r
+      - base=master\r
+      - -label=push\r
+      - -closed\r
+      - status-success=tianocore.PatchCheck\r
+      - status-success=Ubuntu GCC5 PR\r
+      - status-success=Windows VS2019 PR\r
+      - status-success=Ubuntu GCC5 PR (FINISHED)\r
+      - status-success=Windows VS2019 PR (FINISHED)\r
+    actions:\r
+      close:\r
+        message: All checks passed. Auto close personal build.\r
+\r
+  - name: Post a comment on a PR that can not be merged due to a merge conflict\r
+    conditions:\r
+      - base=master\r
+      - conflict\r
+    actions:\r
+      comment:\r
+        message: PR can not be merged due to conflict.  Please rebase and resubmit\r
+\r
+  - name: Automatically close a PR that fails the EDK II Maintainers membership check and 'push' label is present\r
+    conditions:\r
+      - base=master\r
+      - label=push\r
+      - -author=@tianocore/edk-ii-maintainers\r
+    actions:\r
+      close:\r
+        message: PR submitter is not a member of the Tianocore EDK II Maintainers team\r
+\r
+  - name: Post a comment on a PR if PatchCheck fails\r
+    conditions:\r
+      - base=master\r
+      - status-failure=tianocore.PatchCheck\r
+    actions:\r
+      comment:\r
+        message: PR can not be merged due to a PatchCheck failure.  Please resolve and resubmit\r
+\r
+  - name: Post a comment on a PR if Ubuntu GCC5 fails\r
+    conditions:\r
+      - base=master\r
+      - status-failure=Ubuntu GCC5 PR\r
+      - status-success=Ubuntu GCC5 PR (FAILED)\r
+    actions:\r
+      comment:\r
+        message: PR can not be merged due to an Ubuntu GCC5 failure.  Please resolve and resubmit\r
+\r
+  - name: Post a comment on a PR if Windows VS2019 fails\r
+    conditions:\r
+      - base=master\r
+      - status-failure=Windows VS2019 PR\r
+      - status-success=Windows VS2019 PR (FAILED)\r
+    actions:\r
+      comment:\r
+        message: PR can not be merged due to a Windows VS2019 failure.  Please resolve and resubmit\r