Various fixes / add testing ci

This commit is contained in:
Alexandre Aubin 2019-04-16 15:26:36 +00:00
parent 0cd152242c
commit 318992cec5
5 changed files with 20 additions and 9 deletions

View file

@ -33,6 +33,13 @@ class AppCIBranch(db.Model):
url='https://ci-apps-arm.yunohost.org/ci/logs/list_level_stable.json',
url_per_app='https://ci-apps-arm.yunohost.org/ci/apps/{}/')
yield AppCIBranch(name='testing',
arch="x86",
branch="testing",
display_name='Testing (x86)',
url='https://ci-apps-unstable.yunohost.org/ci/logs/list_level_testing.json',
url_per_app='https://ci-apps-unstable.yunohost.org/ci/apps/{}/')
yield AppCIBranch(name='unstable',
arch="x86",
branch="unstable",
@ -121,6 +128,7 @@ class AppCI():
cleaned_json = [ line for line in result_json.split("\n") if "test_name" in line ]
cleaned_json = [ line.replace('"level": ?,', '"level": null,') for line in cleaned_json ]
cleaned_json = "[" + ''.join(cleaned_json)[:-1] + "]"
cleaned_json = cleaned_json.replace("Binary", '"?"')
j = json.loads(cleaned_json)
for test_summary in j:
if (test_summary["arch"], test_summary["branch"]) != (cibranch.arch, cibranch.branch):

View file

@ -200,6 +200,9 @@ class Github():
def commit_date(self, app, sha):
repo = app.repo.replace("https://github.com/", "")
try:
github_date = self.request('repos/{}/commits/{}'.format(repo, sha))["commit"]["author"]["date"]
except:
import pdb; pdb.set_trace()
parsed_date = datetime.datetime.strptime(github_date, "%Y-%m-%dT%H:%M:%SZ")
return parsed_date

View file

@ -28,12 +28,12 @@ class UnlistedApp(db.Model):
community = json.loads(requests.get("https://raw.githubusercontent.com/YunoHost/apps/master/community.json").text)
known_apps = set()
known_apps = known_apps.union([os.path.basename(app["url"]) for app in official.values() ])
known_apps = known_apps.union([os.path.basename(app["url"]) for app in community.values() ])
known_apps = known_apps.union([os.path.basename(app["url"]).lower() for app in official.values() ])
known_apps = known_apps.union([os.path.basename(app["url"]).lower() for app in community.values() ])
apps = []
for i in range(1,7):
for i in range(1,8):
print("Page " + str(i) + " ... ")
r = requests.get("https://api.github.com/search/repositories?q=_ynh&sort=updated&per_page=100&page="+str(i))
@ -48,7 +48,7 @@ class UnlistedApp(db.Model):
if not item["name"].endswith("_ynh"):
continue
if item["name"] in known_apps:
if item["name"].lower() in known_apps:
continue
owner = item["owner"]["login"]

View file

@ -36,7 +36,7 @@ window.onload = function () {
shared: true
},
data: [
{% for level in range(8) %}
{% for level in range(7,-1,-1) %}
{
color: colors_per_level[{{ level }}],
type: "stackedArea",

View file

@ -32,14 +32,14 @@
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<span class="dropdown-header">Per branch</span>
<a class="dropdown-item" href="{{ url_for('main.appci_branch', branch="stable")}}">Stable</a>
<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="stretch")}}">Stretch</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="arm")}}">Stable vs. ARM</a>
<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="stretch")}}">Stable vs. Stretch</a>
<a class="dropdown-item" href="{{ url_for('main.appci_compare', ref="stable", target="arm")}}">Stable vs. ARM</a>
</div>
</li>
<li class="nav-item dropdown">