diff --git a/app/app.py b/app/app.py index f2bd47f..56636c1 100644 --- a/app/app.py +++ b/app/app.py @@ -53,7 +53,11 @@ def appci_branch(branch): app_results = sort_test_results(branch.most_recent_tests_per_app()) - return render_template("appci_branch.html", tests=AppCI.tests, + tests = AppCI.tests.copy() + if "Malformed path" in tests: + tests.remove("Malformed path") + + return render_template("appci_branch.html", tests=tests, branch=branch, app_results=app_results) @@ -68,7 +72,10 @@ def appci_app(app): for r in branch_results: r.level = -1 if r.level in ["?", None] else int(r.level) - return render_template("appci_app.html", tests=AppCI.tests, + tests = AppCI.tests.copy() + if "Malformed path" in tests: + tests.remove("Malformed path") + return render_template("appci_app.html", tests=tests, app=app, branch_results=branch_results) diff --git a/app/models/appci.py b/app/models/appci.py index 463e785..eeb93ac 100644 --- a/app/models/appci.py +++ b/app/models/appci.py @@ -46,13 +46,6 @@ class AppCIBranch(db.Model): display_name='Unstable (x86)', url='https://ci-apps-unstable.yunohost.org/ci/logs/list_level_unstable.json', url_per_app='https://ci-apps-unstable.yunohost.org/ci/apps/{}/') - - yield AppCIBranch(name='buster', - arch="x86", - branch="buster", - display_name='buster (x86)', - url='https://ci-buster.nohost.me/ci/logs/list_level_stable.json', - url_per_app='https://ci-buster.nohost.me/ci/apps/{}/') def last_build_url(self, app): return self.url_per_app.format(app.name) @@ -104,6 +97,10 @@ class AppCIResult(db.Model): s_dict = { True: +1, False: -1, None: 0 } return sum([ s_dict[result] for result in self.results.values() ]) + @property + def outdated(self): + return (datetime.datetime.now() - self.date).days > 45 + class AppCI(): diff --git a/app/models/applists.py b/app/models/applists.py index 6fbf7d3..578dca6 100644 --- a/app/models/applists.py +++ b/app/models/applists.py @@ -97,10 +97,11 @@ class AppList(db.Model): known_app.opened_issues = 0 known_app.opened_prs = 0 - try: - db.session.commit() - except Exception as e: - print(e) + try: + db.session.commit() + except Exception as e: + print(e) + db.session.rollback() class App(db.Model): diff --git a/app/scripts/maintenancePing/maintenancePing.py b/app/scripts/maintenancePing/maintenancePing.py index d54bc99..8e2c969 100755 --- a/app/scripts/maintenancePing/maintenancePing.py +++ b/app/scripts/maintenancePing/maintenancePing.py @@ -141,12 +141,9 @@ def get_status_and_todo(repo): def get_apps_to_check(): - #official="https://raw.githubusercontent.com/YunoHost/apps/master/official.json" - community="https://raw.githubusercontent.com/YunoHost/apps/master/community.json" + community="https://raw.githubusercontent.com/YunoHost/apps/master/apps.json" - raw_apps = [] - #raw_apps += json.loads(requests.get(official).text).values() - raw_apps += json.loads(requests.get(community).text).values() + raw_apps = json.loads(requests.get(community).text).values() return [ app["url"].replace("https://github.com/","") \ for app in raw_apps \ @@ -196,7 +193,7 @@ def run_todolist(todolist): def update_community_list(status, workdir): - filename = workdir + "/community.json" + filename = workdir + "/apps.json" j = json.loads(open(filename).read()) @@ -253,7 +250,7 @@ def create_pull_request(repo, watdo, pr_infos): cmds = [ "cd .work/{reponame} && git add .", "cd .work/{reponame} && git commit -a -m '{title}'", - "cd .work/{reponame} && git push origin {branch}" + "cd .work/{reponame} && git push origin {branch} --force" ] for cmd in cmds: diff --git a/app/templates/appci_app.html b/app/templates/appci_app.html index 20432dd..22ac0eb 100644 --- a/app/templates/appci_app.html +++ b/app/templates/appci_app.html @@ -24,7 +24,7 @@ {% for result in branch_results %} - + @@ -45,10 +45,10 @@ {% else %} {% endif %} - {% if result.commit != result.app.master_commit %} + {% if result.outdated %} + title="This test is outdated"> {% endif %} diff --git a/app/templates/appci_branch.html b/app/templates/appci_branch.html index 1ad8c00..e4df843 100644 --- a/app/templates/appci_branch.html +++ b/app/templates/appci_branch.html @@ -43,7 +43,6 @@ 8 -
@@ -60,11 +59,8 @@ {% for result in app_results %} - +
- {% if result.app.list.name == "official" %} - - {% endif %} {{ result.app.name }} @@ -84,10 +80,10 @@ {% else %} {% endif %} - {% if result.commit != result.app.master_commit %} + {% if result.outdated %} + title="This test is outdated"> {% endif %} {% if result.app.public_commit != 'HEAD' and result.app.public_commit != result.app.master_commit %}