[network-manager-applet/ac/gitlab-triage] gitlab-ci: add scheduled pipeline to triage inactive issues and MRs



commit 2852d59763c3a8a0e49ebd115f819a58c849dd8b
Author: Antonio Cardace <acardace redhat com>
Date:   Mon Apr 6 11:20:33 2020 +0200

    gitlab-ci: add scheduled pipeline to triage inactive issues and MRs

 .gitlab-ci.yml       | 14 +++++++++++
 .triage-policies.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ec762a73..841d4cae 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,6 +4,11 @@
 # If things don't seem to work, this can help:
 # https://gitlab.gnome.org/GNOME/network-manager-applet/-/ci/lint
 
+stages:
+  - build
+  - test
+  - triage
+
 .dist: &dist
   dependencies:
     - fedora30_dist
@@ -110,3 +115,12 @@ fedora_autotools_full:
     - make -j$(nproc) uninstall
   image: fedora:latest
   stage: test
+
+triage:issues:
+  stage: triage
+  image: ruby:2.7
+  script:
+    - gem install gitlab-triage
+    - gitlab-triage -n -d --token $API_TOKEN --source-id $SOURCE_ID
+  only:
+    - schedules
diff --git a/.triage-policies.yml b/.triage-policies.yml
new file mode 100644
index 00000000..bd672a9e
--- /dev/null
+++ b/.triage-policies.yml
@@ -0,0 +1,67 @@
+host_url: https://gitlab.gnome.org
+
+resource_rules:
+  issues:
+    rules:
+      - name: Close issues with no activity for 6 months
+        conditions:
+          date:
+            attribute: updated_at
+            condition: older_than
+            interval_type: months
+            interval: 6
+          state: opened
+        actions:
+            comment: |
+                This issue has been inactive for 6 months, closing automatically, please reopen if you think 
the issue is still relevant.
+            status: close
+            labels:
+                - auto-closed
+      - name: Close RFE with no activity for 12 months
+        conditions:
+          date:
+            attribute: updated_at
+            condition: older_than
+            interval_type: months
+            interval: 12
+          state: opened
+          labels:
+              - 1. Enhancement
+        actions:
+            comment: |
+                This enhancement issue has been inactive for 12 months, closing automatically, please reopen 
if you think the issue is still relevant.
+            status: close
+            labels:
+                - auto-closed
+      - name: Clear auto-closed label for open issues
+        conditions:
+          state: opened
+          labels:
+                - auto-closed
+        actions:
+            remove_labels:
+                - auto-closed
+  merge_requests:
+    rules:
+      - name: Close MRs with no activity after 2 month
+        conditions:
+          date:
+            attribute: updated_at
+            condition: older_than
+            interval_type: months
+            interval: 2
+          state: opened
+        actions:
+            comment: |
+                This MR has been inactive for more than 2 months, closing automatically, please reopen if 
you think it is still relevant.
+            status: close
+            labels:
+                - auto-closed
+      - name: Clear auto-closed label for open MRs
+        conditions:
+          state: opened
+          labels:
+                - auto-closed
+        actions:
+            remove_labels:
+                - auto-closed


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]