From 620ff4b0331971dbaa011bacc12ca23cc0b96d00 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 30 Dec 2020 22:34:48 +0000 Subject: [PATCH] Misc adaptation for new level 9 --- app/app.py | 2 +- app/scripts/appListsHistory/script.py | 4 ++-- app/templates/appci_branch.html | 5 +++-- app/templates/applist_history.html | 5 +++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/app.py b/app/app.py index 45dd892..d3d5570 100644 --- a/app/app.py +++ b/app/app.py @@ -136,7 +136,7 @@ def badge(app): badge = "level%s.svg" % level if not level is None else "unknown.svg" - if not app.ci_enabled: + if app.state != "working": badge = "unknown.svg" svg = open("./app/static/badges/%s" % badge).read() diff --git a/app/scripts/appListsHistory/script.py b/app/scripts/appListsHistory/script.py index 76c639a..8f31997 100644 --- a/app/scripts/appListsHistory/script.py +++ b/app/scripts/appListsHistory/script.py @@ -92,7 +92,7 @@ def make_count_summary(): for state in states: summary[state] = len([k for k, infos in j.items() if infos["state"] == state]) - for level in range(0, 9): + for level in range(0, 10): summary["level-%s" % level] = len([k for k, infos in j.items() if infos["state"] in ["working", "official"] and infos.get("level", None) == level]) @@ -138,7 +138,7 @@ def update_catalog_stats(app, history): except: return - app_in_db.long_term_good_quality = len([d for d in history[-24:] if d["level"] > 5]) > 12 + app_in_db.long_term_good_quality = len([d for d in history[-24:] if d["level"] > 5]) > 0.90 * 24 app_in_db.long_term_broken = history[-1]["level"] == 0 and len([d for d in history[-24:] if d["level"] == 0]) > 12 db.session.add(app_in_db) diff --git a/app/templates/appci_branch.html b/app/templates/appci_branch.html index 04e7846..0b9e94b 100644 --- a/app/templates/appci_branch.html +++ b/app/templates/appci_branch.html @@ -24,7 +24,7 @@ {% for result in app_results %} - + {% if result.app.long_term_good_quality %} @@ -106,7 +106,8 @@ window.onload = function () { { y: $(".ci-app-level[value=5]").length, label: "Level 5", color: "#A6B255" }, { y: $(".ci-app-level[value=6]").length, label: "Level 6", color: "#7AB659" }, { y: $(".ci-app-level[value=7]").length, label: "Level 7", color: "#5cb85c" }, - { y: $(".ci-app-level[value=8]").length, label: "Level 8", color: "#4695d5" } + { y: $(".ci-app-level[value=8]").length, label: "Level 8", color: "#4695d5" }, + { y: $(".ci-app-level[value=9]").length, label: "Level 9", color: "#8960b3" } ] }] }); diff --git a/app/templates/applist_history.html b/app/templates/applist_history.html index 7e44faa..43a43a9 100644 --- a/app/templates/applist_history.html +++ b/app/templates/applist_history.html @@ -17,7 +17,8 @@ window.onload = function () { "#A6B255", "#7AB659", "#5cb85c", - "#4695d5" + "#4695d5", + "#8960b3" ]; var colors_per_state = { @@ -37,7 +38,7 @@ window.onload = function () { shared: true }, data: [ - {% for level in range(8,-1,-1) %} + {% for level in range(9,-1,-1) %} { color: colors_per_level[{{ level }}], type: "stackedArea",