594167
From caf80cd558222a08687e8db95e3e1fcad0d69946 Mon Sep 17 00:00:00 2001
594167
From: Jan Macku <jamacku@redhat.com>
594167
Date: Mon, 30 May 2022 15:19:16 +0200
594167
Subject: [PATCH] ci(Mergify): configuration update
594167
594167
Add rules for `needs-ci` label management
594167
594167
RHEL-only
594167
594167
Related: #2087652
594167
---
594167
 .mergify.yml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++
594167
 1 file changed, 76 insertions(+)
594167
 create mode 100644 .mergify.yml
594167
594167
diff --git a/.mergify.yml b/.mergify.yml
594167
new file mode 100644
594167
index 0000000000..c06e0fb1be
594167
--- /dev/null
594167
+++ b/.mergify.yml
594167
@@ -0,0 +1,76 @@
594167
+# doc: https://docs.mergify.com
594167
+---
594167
+
594167
+pull_request_rules:
594167
+  - name: Add `needs-ci` label on CI fail
594167
+    conditions:
594167
+      - or:
594167
+        # Build test
594167
+        - -check-success=build (gcc, 10, bfd)
594167
+        - -check-success=build (gcc, 11, gold)
594167
+        - -check-success=build (clang, 11, bfd)
594167
+        - -check-success=build (clang, 12, gold)
594167
+        - -check-success=build (clang, 13, lld)
594167
+        # Unit tests
594167
+        - -check-success=build (GCC, auto)
594167
+        - -check-success=build (GCC_ASAN_UBSAN, auto)
594167
+        - -check-success=build (CLANG, auto)
594167
+        - -check-success=build (CLANG_ASAN_UBSAN, auto)
594167
+        - -check-success=build (GCC, openssl)
594167
+        - -check-success=build (CLANG, gcrypt)
594167
+        # CentOS CI
594167
+        - -check-success=CentOS CI (CentOS Stream 9)
594167
+        - -check-success=CentOS CI (CentOS Stream 9 + sanitizers)
594167
+        # LGTM
594167
+        - and:
594167
+          - "-check-success=LGTM analysis: JavaScript"
594167
+          - "-check-neutral=LGTM analysis: JavaScript"
594167
+        - and:
594167
+          - "-check-success=LGTM analysis: Python"
594167
+          - "-check-neutral=LGTM analysis: Python"
594167
+        - and:    
594167
+          - "-check-success=LGTM analysis: C/C++"
594167
+          - "-check-neutral=LGTM analysis: Python"
594167
+      # Packit
594167
+      - -check-success=rpm-build:centos-stream-9-aarch64
594167
+      - -check-success=rpm-build:centos-stream-9-x86_64
594167
+    actions:
594167
+      label:
594167
+        add:
594167
+          - needs-ci
594167
+          
594167
+  - name: Remove `needs-ci` label on CI success
594167
+    conditions:
594167
+      # Build test
594167
+      - check-success=build (gcc, 10, bfd)
594167
+      - check-success=build (gcc, 11, gold)
594167
+      - check-success=build (clang, 11, bfd)
594167
+      - check-success=build (clang, 12, gold)
594167
+      - check-success=build (clang, 13, lld)
594167
+      # Unit tests
594167
+      - check-success=build (GCC, auto)
594167
+      - check-success=build (GCC_ASAN_UBSAN, auto)
594167
+      - check-success=build (CLANG, auto)
594167
+      - check-success=build (CLANG_ASAN_UBSAN, auto)
594167
+      - check-success=build (GCC, openssl)
594167
+      - check-success=build (CLANG, gcrypt)
594167
+      # CentOS CI
594167
+      - check-success=CentOS CI (CentOS Stream 9)
594167
+      - check-success=CentOS CI (CentOS Stream 9 + sanitizers)
594167
+      # LGTM
594167
+      - or:
594167
+        - "check-success=LGTM analysis: JavaScript"
594167
+        - "check-neutral=LGTM analysis: JavaScript"
594167
+      - or:
594167
+        - "check-success=LGTM analysis: Python"
594167
+        - "check-neutral=LGTM analysis: Python"
594167
+      - or:    
594167
+        - "check-success=LGTM analysis: C/C++"
594167
+        - "check-neutral=LGTM analysis: Python"
594167
+      # Packit
594167
+      - check-success=rpm-build:centos-stream-9-aarch64
594167
+      - check-success=rpm-build:centos-stream-9-x86_64
594167
+    actions:
594167
+      label:
594167
+        remove:
594167
+          - needs-ci