Commit ca331593 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat: sort all the listings

parent 7fe5d4e1411e
Pipeline #12333 passed with stages
in 1 minute and 45 seconds
......@@ -8,7 +8,7 @@ gl = gitlab.Gitlab("https://forge.extranet.logilab.fr", oauth_token=os.environ.g
all_core_projects = [x for x in gl.projects.list(all=True) if "cw-core" in x.tag_list]
context = {"projects": {}, "cubes": {}}
context = {"projects": [], "cubes": []}
for project in all_core_projects:
......@@ -32,11 +32,13 @@ for project in all_core_projects:
merge_request["pipeline"] = pipelines[0] if pipelines else None
merge_requests.append(merge_request)
context["projects"][project.name] = {
context["projects"].append({
"project": project.attributes,
"merge_requests": merge_requests,
"labels": {x.name: x.attributes for x in project.labels.list(all=True)}
}
})
context["projects"] = sorted(context["projects"], key=lambda x: x["project"]["name"].lower())
all_cubes = [x for x in gl.projects.list(all=True) if x.namespace["name"] == "cubes"]
......@@ -62,11 +64,13 @@ for cube in all_cubes:
merge_request["pipeline"] = pipelines[0] if pipelines else None
merge_requests.append(merge_request)
context["cubes"][cube.name] = {
context["cubes"].append({
"cube": cube.attributes,
"merge_requests": merge_requests,
"labels": {x.name: x.attributes for x in project.labels.list(all=True)}
}
})
context["cubes"] = sorted(context["cubes"], key=lambda x: x["cube"]["name"].lower())
os.system("mkdir -p public") # XXX lazy
result = jinja2.Template(open("template/mr.html", "r").read()).render(**context)
......
......@@ -8,7 +8,7 @@ gl = gitlab.Gitlab("https://forge.extranet.logilab.fr", oauth_token=os.environ.g
all_core_projects = [x for x in gl.projects.list(all=True) if "cw-core" in x.tag_list]
context = {"projects": {}, "cubes": {}}
context = {"projects": [], "cubes": []}
for project in all_core_projects:
......@@ -27,11 +27,13 @@ for project in all_core_projects:
assert pipeline_for_default is not None
context["projects"][project.name] = {
context["projects"].append({
"project": project.attributes,
"pipeline": pipeline.attributes,
"jobs": [job.attributes for job in pipeline_for_default.jobs.list(all=True)],
}
})
context["projects"] = sorted(context["projects"], key=lambda x: x["project"]["name"].lower())
all_cubes = [x for x in gl.projects.list(all=True) if x.namespace["name"] == "cubes"]
......@@ -55,11 +57,13 @@ for cube in all_cubes:
else:
jobs = None
context["cubes"][cube.name] = {
context["cubes"].append({
"project": cube.attributes,
"pipeline": pipeline.attributes,
"jobs": jobs,
}
})
context["cubes"] = sorted(context["cubes"], key=lambda x: x["project"]["name"].lower())
os.system("mkdir -p public") # XXX lazy
result = jinja2.Template(open("template/pipelines.html", "r").read()).render(**context)
......
......@@ -9,7 +9,7 @@ from tox.config import parseconfig
gl = gitlab.Gitlab("https://forge.extranet.logilab.fr", oauth_token=os.environ.get("TOKEN"))
context = {"cubes": {}}
context = {"cubes": []}
all_cubes = [x for x in gl.projects.list(all=True) if x.namespace["name"] == "cubes"]
......@@ -69,7 +69,7 @@ for number, cube in enumerate(all_cubes):
has_flake8 = False
has_from_forge = False
context["cubes"][cube.name] = {
context["cubes"].append({
"cube": cube.attributes,
"has_tox": has_tox,
"has_gitlab_ci": has_gitlab_ci,
......@@ -81,7 +81,9 @@ for number, cube in enumerate(all_cubes):
"has_mypy": has_mypy,
"has_flake8": has_flake8,
"has_from_forge": has_from_forge,
}
})
context["cubes"] = sorted(context["cubes"], key=lambda x: x["cube"]["name"].lower())
os.system("mkdir -p public") # XXX lazy
result = jinja2.Template(open("template/qa.html", "r").read()).render(**context)
......
......@@ -8,7 +8,7 @@
<h1>MR Center <small>all PR that needs attention</small></h1>
<h2>CubicWeb Core Projects</h2>
{% for project in projects.values() %}
{% for project in projects %}
{% if project["merge_requests"] %}
<h3>{{ project["project"]["name"] }}</h3>
......@@ -47,7 +47,7 @@
<hr>
<h2>Project Cubes</h2>
{% for cube in cubes.values() %}
{% for cube in cubes %}
{% if cube["merge_requests"] and "project-dependency" in cube["cube"]["tag_list"] %}
<h3>{{ cube["cube"]["name"] }}</h3>
......@@ -86,7 +86,7 @@
<hr>
<h2>Unused Cubes</h2>
{% for cube in cubes.values() %}
{% for cube in cubes %}
{% if cube["merge_requests"] and "project-dependency" not in cube["cube"]["tag_list"] %}
<h3>{{ cube["cube"]["name"] }}</h3>
......
......@@ -9,7 +9,7 @@
<h2>CubicWeb Core Projects</h2>
<table class="pipelines">
{% for project in projects.values() %}
{% for project in projects %}
<tr>
<th>
<a target="_blank" href="{{ project["project"]["web_url"] }}">
......@@ -34,7 +34,7 @@
<h2>Project Cubes</h2>
<table class="pipelines">
{% for cube in cubes.values() %}
{% for cube in cubes %}
{% if "project-dependency" in cube["project"]["tag_list"] %}
<tr>
<th>
......@@ -66,7 +66,7 @@
<h2>Unused Cubes</h2>
<table class="pipelines">
{% for cube in cubes.values() %}
{% for cube in cubes %}
{% if "project-dependency" not in cube["project"]["tag_list"] %}
<tr>
<th>
......
......@@ -52,7 +52,7 @@
<h2>Project Cubes</h2>
<table class="qa">
{{ table_header() }}
{% for cube in cubes.values() %}
{% for cube in cubes %}
{% if "project-dependency" in cube["cube"]["tag_list"] %}
{{ render_cube(cube) }}
{% endif %}
......@@ -64,7 +64,7 @@
<h2>Unused Cubes</h2>
<table class="qa">
{{ table_header() }}
{% for cube in cubes.values() %}
{% for cube in cubes %}
{% if "project-dependency" not in cube["cube"]["tag_list"] %}
{{ render_cube(cube) }}
{% endif %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment