[sysadmin-bin] Remove users who created a single repo that is not a fork



commit ca4c8c20336517c295b3dd162f1ec1ed294ea44d
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Mon Nov 29 13:15:30 2021 +0100

    Remove users who created a single repo that is not a fork

 gitlab/inactive-gitlab-users.py | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gitlab/inactive-gitlab-users.py b/gitlab/inactive-gitlab-users.py
index 2c6ec1c..8a7f01f 100755
--- a/gitlab/inactive-gitlab-users.py
+++ b/gitlab/inactive-gitlab-users.py
@@ -136,6 +136,14 @@ def get_inactive_users(gl, timedelta_unit, timedelta_value):
                 results.append(userdata)
                 continue
 
+        user_projects = user.projects.list(all=True)
+        if len(user_projects) == 1:
+            proj = user_projects[0]
+            if not proj.attributes.get("forked_from_project"):
+                userdata["reason"] = "inactivity"
+                results.append(userdata)
+                continue
+
         if attrs["bio"] and len(attrs["bio"]) > 0:
             # Some users set URL in bio, check it against surbl
             if re.match("http[s]?://", attrs["bio"], re.IGNORECASE):


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