b7dd4d
From cd8518b7f4ebfda9955bf0b649cf759c45e729f1 Mon Sep 17 00:00:00 2001
b7dd4d
From: Jan Macku <jamacku@redhat.com>
b7dd4d
Date: Mon, 6 Jun 2022 15:40:20 +0200
b7dd4d
Subject: [PATCH] ci(Mergify): configuration update
b7dd4d
b7dd4d
Add rules for needs-ci label management
b7dd4d
b7dd4d
RHEL-only
b7dd4d
b7dd4d
Related: #2087152
b7dd4d
---
b7dd4d
 .mergify.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
b7dd4d
 1 file changed, 48 insertions(+)
b7dd4d
 create mode 100644 .mergify.yml
b7dd4d
b7dd4d
diff --git a/.mergify.yml b/.mergify.yml
b7dd4d
new file mode 100644
b7dd4d
index 0000000000..6fa400effd
b7dd4d
--- /dev/null
b7dd4d
+++ b/.mergify.yml
b7dd4d
@@ -0,0 +1,48 @@
b7dd4d
+# doc: https://docs.mergify.com
b7dd4d
+---
b7dd4d
+
b7dd4d
+pull_request_rules:
b7dd4d
+  - name: Add `needs-ci` label on CI fail
b7dd4d
+    conditions:
b7dd4d
+      - or:
b7dd4d
+        # Unit tests
b7dd4d
+        - -check-success=build (stream8, GCC)
b7dd4d
+        - -check-success=build (stream8, GCC_ASAN)
b7dd4d
+        # CentOS Stream CI
b7dd4d
+        - -check-success=CentOS CI (CentOS Stream 8)
b7dd4d
+        # LGTM
b7dd4d
+        - and:
b7dd4d
+          - "-check-success=LGTM analysis: JavaScript"
b7dd4d
+          - "-check-neutral=LGTM analysis: JavaScript"
b7dd4d
+        - and:
b7dd4d
+          - "-check-success=LGTM analysis: Python"
b7dd4d
+          - "-check-neutral=LGTM analysis: Python"
b7dd4d
+        - and:    
b7dd4d
+          - "-check-success=LGTM analysis: C/C++"
b7dd4d
+          - "-check-neutral=LGTM analysis: C/C++"
b7dd4d
+    actions:
b7dd4d
+      label:
b7dd4d
+        add:
b7dd4d
+          - needs-ci
b7dd4d
+
b7dd4d
+  - name: Remove `needs-ci` label on CI success
b7dd4d
+    conditions:
b7dd4d
+      # Unit tests
b7dd4d
+      - check-success=build (stream8, GCC)
b7dd4d
+      - check-success=build (stream8, GCC_ASAN)
b7dd4d
+      # CentOS Stream CI
b7dd4d
+      - check-success=CentOS CI (CentOS Stream 8)
b7dd4d
+      # LGTM
b7dd4d
+      - or:
b7dd4d
+        - "check-success=LGTM analysis: JavaScript"
b7dd4d
+        - "check-neutral=LGTM analysis: JavaScript"
b7dd4d
+      - or:
b7dd4d
+        - "check-success=LGTM analysis: Python"
b7dd4d
+        - "check-neutral=LGTM analysis: Python"
b7dd4d
+      - or:    
b7dd4d
+        - "check-success=LGTM analysis: C/C++"
b7dd4d
+        - "check-neutral=LGTM analysis: C/C++"
b7dd4d
+    actions:
b7dd4d
+      label:
b7dd4d
+        remove:
b7dd4d
+          - needs-ci