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