From 682c7435ac434f8e5e847148580d9ca23911b5b9 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 1 Sep 2018 05:51:45 +0000 Subject: [PATCH] Fix a few issue with maintenancePing + move criteria to 1 year --- .../maintenancePing/maintenancePing.py | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/scripts/maintenancePing/maintenancePing.py b/app/scripts/maintenancePing/maintenancePing.py index adfc601..d54bc99 100755 --- a/app/scripts/maintenancePing/maintenancePing.py +++ b/app/scripts/maintenancePing/maintenancePing.py @@ -53,7 +53,14 @@ def look_for_old_maintenance_ping(issues): def get_commit_days_ago(repo, branch): - ref = get_github("/repos/{repo}/git/refs/heads/{branch}".format(repo=repo, branch=branch)) + try: + ref = get_github("/repos/{repo}/git/refs/heads/{branch}".format(repo=repo, branch=branch)) + except Exception as e: + if branch != "master": + return 99999 + else: + raise e + if not "object" in ref: return 99999 @@ -116,9 +123,9 @@ def get_status_and_todo(repo): # no - > maintained ! (but status being questionned) return (True, None) - # Commit in master or testing in last 18 months ? - if get_commit_days_ago(repo, "master") < 18*30 \ - or get_commit_days_ago(repo, "testing") < 18*30: + # Commit in master or testing in last 12 months ? + if get_commit_days_ago(repo, "master") < 12*30 \ + or get_commit_days_ago(repo, "testing") < 12*30: # ok, maintained return (True, None) @@ -282,6 +289,12 @@ def main(): monitored, maintained, todolist = analyze_apps() + for app, todo in todolist.items(): + if todo is None: + continue + else: + print("[%s] %s" % (app, str(todo)[:40])) + run_todolist(todolist) create_pull_request("YunoHost/apps",