Misc fixes after testing in prod @_@

This commit is contained in:
Alexandre Aubin 2021-03-21 22:58:04 +01:00
parent 47dee6a0af
commit 1e7d2f92a2
3 changed files with 23 additions and 19 deletions

View file

@ -63,16 +63,16 @@ class AppCatalog():
known_app.master_commit_date = g.commit_date(known_app, known_app.master_commit) known_app.master_commit_date = g.commit_date(known_app, known_app.master_commit)
known_app.testing_pr = g.testing_pr(known_app) known_app.testing_pr = g.testing_pr(known_app)
#issues_and_prs = g.issues(known_app) issues_and_prs = g.issues(known_app)
#known_app.opened_issues = issues_and_prs["nb_issues"] known_app.opened_issues = issues_and_prs["nb_issues"]
#known_app.opened_prs = issues_and_prs["nb_prs"] known_app.opened_prs = issues_and_prs["nb_prs"]
else: else:
known_app.public_commit = "???" known_app.public_commit = "???"
known_app.master_commit = "???" known_app.master_commit = "???"
known_app.testing_pr = None known_app.testing_pr = None
#known_app.opened_issues = 0 known_app.opened_issues = 0
#known_app.opened_prs = 0 known_app.opened_prs = 0
try: try:
db.session.commit() db.session.commit()
@ -97,8 +97,8 @@ class App(db.Model):
public_commit_date = db.Column(db.DateTime, nullable=True) public_commit_date = db.Column(db.DateTime, nullable=True)
master_commit_date = db.Column(db.DateTime, nullable=True) master_commit_date = db.Column(db.DateTime, nullable=True)
testing_pr = db.Column(db.PickleType, default=None) testing_pr = db.Column(db.PickleType, default=None)
#opened_issues = db.Column(db.Integer, default=-1) opened_issues = db.Column(db.Integer, default=-1)
#opened_prs = db.Column(db.Integer, default=-1) opened_prs = db.Column(db.Integer, default=-1)
long_term_good_quality = db.Column(db.Boolean) long_term_good_quality = db.Column(db.Boolean)
long_term_broken = db.Column(db.Boolean) long_term_broken = db.Column(db.Boolean)
@ -115,7 +115,7 @@ class App(db.Model):
def most_recent_tests_per_branch(self): def most_recent_tests_per_branch(self):
from app.models.appci import AppCIBranch, AppCIResult, AppCI from app.models.appci import AppCIBranch, AppCIResult, AppCI, test_categories
branches = AppCIBranch.query.all() branches = AppCIBranch.query.all()
for branch in branches: for branch in branches:
most_recent_test = AppCIResult.query \ most_recent_test = AppCIResult.query \
@ -126,11 +126,13 @@ class App(db.Model):
if most_recent_test: if most_recent_test:
yield most_recent_test yield most_recent_test
else: else:
yield AppCIResult(app = self, yield AppCIResult({"app": self.name,
branch = branch, "architecture": branch.arch,
level = None, "yunohost_branch": branch.branch,
date = datetime.datetime.fromtimestamp(0), "commit": "",
results = { t:None for t in AppCI.tests }) "level": None,
"timestamp": 0,
"tests": {}})
class Github(): class Github():

View file

@ -49,11 +49,13 @@ class AppCIBranch(db.Model):
if most_recent_test: if most_recent_test:
yield most_recent_test[0] yield most_recent_test[0]
else: else:
yield AppCIResult(app = app, yield AppCIResult({"app": app.name,
branch = self, "architecture": self.arch,
level = None, "yunohost_branch": self.branch,
date = datetime.datetime.fromtimestamp(0), "commit": "",
results = { t:None for t in AppCI.tests }) "level": None,
"timestamp": 0,
"tests": {}})
test_categories = [] test_categories = []

View file

@ -94,7 +94,7 @@ window.onload = function () {
startAngle: -90, startAngle: -90,
//innerRadius: 60, //innerRadius: 60,
indexLabelFontSize: 17, indexLabelFontSize: 17,
indexLabel: "{label} - {y}%", indexLabel: "{label} - {y}",
toolTipContent: "<b>{label}:</b> {y}", toolTipContent: "<b>{label}:</b> {y}",
dataPoints: [ dataPoints: [
{ y: $(".ci-app-level[value=-1]").length, label: "Unknown", color: "#cccccc" }, { y: $(".ci-app-level[value=-1]").length, label: "Unknown", color: "#cccccc" },