Misc updates and stuff /o\

This commit is contained in:
Alexandre Aubin 2020-09-03 17:33:59 +00:00
parent b37a80a51f
commit 2e24e858ee
11 changed files with 34 additions and 51 deletions

View file

@ -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)

View file

@ -47,13 +47,6 @@ class AppCIBranch(db.Model):
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():

View file

@ -101,6 +101,7 @@ class AppList(db.Model):
db.session.commit()
except Exception as e:
print(e)
db.session.rollback()
class App(db.Model):

View file

@ -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:

View file

@ -24,7 +24,7 @@
</thead>
<tbody>
{% for result in branch_results %}
<tr branch="{{ result.branch.name }}">
<tr branch="{{ result.branch.name }}" {% if result.outdated %}style="opacity: 0.5"{% endif %} >
<td class="ci-app-row-title">
<a href="{{ url_for('main.appci_branch', branch=result.branch.name) }}">
<span title="Branch">
@ -45,10 +45,10 @@
{% else %}
<span class="daysAgo" timestamp="{{ result.date.timestamp() }}" href="{{ result.branch.last_build_url(app) }}"></span>
{% endif %}
{% if result.commit != result.app.master_commit %}
{% if result.outdated %}
<span class="oi oi-clock text-warning"
aria-hidden="true"
title="This test is outdated : a more recent commit exists in master than the one tested."></span>
title="This test is outdated"></span>
{% endif %}
</td>
</tr>

View file

@ -43,7 +43,6 @@
<input type="radio" name="options" level="8" autocomplete="off"> 8
</label>
</div>
<button id="filter_onlyOfficials" type="button" class="btn btn-light btn-sm" href="javascript:void(0)" onclick="toggle(this)" style="margin-left:30px;">Show only officials</button>
</div>
<div>
<table class="table table-responsive ci-app-table">
@ -60,11 +59,8 @@
</thead>
<tbody>
{% for result in app_results %}
<tr app="{{ result.app.name }}" class="resultline {% if result.app.list.name == "official" %}official{% endif %}" level="{{ result.level if result.level >= 0 else "?" }}">
<tr app="{{ result.app.name }}" class="resultline" level="{{ result.level if result.level >= 0 else "?" }}" {% if result.outdated %}style="opacity: 0.5"{% endif %} >
<td class="ci-app-row-title">
{% if result.app.list.name == "official" %}
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
{% endif %}
<a href="{{ url_for('main.appci_app', app=result.app.name) }}">
<span class="font-weight-bold" title="More tests / info for this app">
{{ result.app.name }}</span>
@ -84,10 +80,10 @@
{% else %}
<span class="daysAgo" timestamp="{{ result.date.timestamp() }}" href="{{ branch.last_build_url(result.app) }}"></span>
{% endif %}
{% if result.commit != result.app.master_commit %}
{% if result.outdated %}
<span class="oi oi-clock text-warning"
aria-hidden="true"
title="This test is outdated : a more recent commit exists in master than the one tested."></span>
title="This test is outdated"></span>
{% endif %}
{% if result.app.public_commit != 'HEAD' and result.app.public_commit != result.app.master_commit %}
<!--
@ -159,10 +155,8 @@ function toggle(e) {
}
function update_filters() {
var onlyOfficials = $("#filter_onlyOfficials").hasClass("btn-primary");
var levelFilter = $("input[type='radio']:checked").attr("level");
$(".resultline").show();
if (onlyOfficials) { $(".resultline:not(.official)").hide(); }
if (levelFilter != "all") { $(".resultline[level!='"+levelFilter+"']").hide(); }
}

View file

@ -8,7 +8,6 @@
<div class="mx-auto">
<div style="text-align:center;">
<button id="filter_onlyDiffs" type="button" class="btn btn-primary btn-sm" href="javascript:void(0)" onclick="toggle(this)">Show only diffs</button>
<button id="filter_onlyOfficials" type="button" class="btn btn-light btn-sm" href="javascript:void(0)" onclick="toggle(this)">Show only officials</button>
</div>
<div>
<table class="table table-responsive ci-app-table">
@ -22,11 +21,8 @@
</thead>
<tbody>
{% for result in results %}
<tr class="ci-branch-comparison {% if result.app.list.name == "official" %}official{% endif %}" value="{{ result.compare }}" app="{{ result.app.name }}">
<tr class="ci-branch-comparison" value="{{ result.compare }}" app="{{ result.app.name }}">
<td class="ci-app-row-title">
{% if result.app.list.name == "official" %}
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
{% endif %}
<a href="{{ url_for('main.appci_app', app=result.app.name) }}">
<span title="App">
<strong>{{ result.app.name }}</strong></span>
@ -89,10 +85,8 @@ function toggle(e) {
}
function update_filters() {
var onlyDiffs = $("#filter_onlyDiffs").hasClass("btn-primary");
var onlyOfficials = $("#filter_onlyOfficials").hasClass("btn-primary");
$(".ci-branch-comparison").show();
if (onlyDiffs) { $(".ci-branch-comparison[value='same']").hide(); }
if (onlyOfficials) { $(".ci-branch-comparison:not(.official)").hide(); }
}
</script>

View file

@ -30,7 +30,7 @@ window.onload = function () {
var chart = new CanvasJS.Chart("levelHistory", {
animationEnabled: false,
title:{
text: "Apps level (officials + community working)"
text: "Apps quality level (from automatic tests)"
},
toolTip: {
reversed: true,
@ -58,7 +58,7 @@ window.onload = function () {
var chart2 = new CanvasJS.Chart("stateHistory", {
animationEnabled: false,
title:{
text: "Apps state"
text: "Apps state (declared by packager)"
},
toolTip: {
reversed: true,

View file

@ -35,13 +35,11 @@
<a class="dropdown-item" href="{{ url_for('main.appci_branch', branch="testing")}}">Testing</a>
<a class="dropdown-item" href="{{ url_for('main.appci_branch', branch="unstable")}}">Unstable</a>
<a class="dropdown-item" href="{{ url_for('main.appci_branch', branch="arm")}}">ARM</a>
<a class="dropdown-item" href="{{ url_for('main.appci_branch', branch="buster")}}">Buster</a>
<div class="dropdown-divider"></div>
<span class="dropdown-header">Branch comparisons</span>
<a class="dropdown-item" href="{{ url_for('main.appci_compare', ref="stable", target="testing")}}">Stable vs. Testing</a>
<a class="dropdown-item" href="{{ url_for('main.appci_compare', ref="stable", target="unstable")}}">Stable vs. Unstable</a>
<a class="dropdown-item" href="{{ url_for('main.appci_compare', ref="stable", target="arm")}}">Stable vs. ARM</a>
<a class="dropdown-item" href="{{ url_for('main.appci_compare', ref="stable", target="buster")}}">Stable vs. Buster</a>
</div>
</li>
<li class="nav-item dropdown">

View file

@ -45,9 +45,7 @@ Active maintainers :
<td>
{% if app.list.name == "official" %}
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
{% elif app.state == "working" %}
{% if app.state == "working" %}
<span class="text-success oi oi-circle-check" title="Working" aria-hidden="true"></span>
{% elif app.state == "inprogress" %}
<span class="text-warning oi oi-wrench" title="In progress" aria-hidden="true"></span>
@ -78,7 +76,7 @@ Active maintainers :
table-active
{% elif app.public_level <= 0 %}
table-danger
{% elif app.public_level <= 2 %}
{% elif app.public_level <= 4 %}
table-warning
{% else %}
table-success
@ -93,7 +91,7 @@ Active maintainers :
table-active
{% elif app.ci_level <= 0 %}
table-danger
{% elif app.ci_level <= 2 %}
{% elif app.ci_level <= 4 %}
table-warning
{% else %}
table-success

View file

@ -20,9 +20,6 @@
<tr class="appline" app="{{ app.name }}">
<td class="ci-app-row-title">
{% if app.list.name == "official" %}
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
{% endif %}
<a href="{{ url_for('main.appci_app', app=app.name) }}">
<span class="font-weight-bold" title="More tests / info for this app">
{{ app.name }}</span>