Commit 80e31365 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat(qa): badges from qa to cubes \^-^/

parent ccbbd58ef5a7
Pipeline #18312 passed with stages
in 6 minutes and 16 seconds
...@@ -2,7 +2,7 @@ import os ...@@ -2,7 +2,7 @@ import os
import gitlab import gitlab
gl = gitlab.Gitlab("https://forge.extranet.logilab.fr", oauth_token=os.environ.get("TOKEN")) gl = gitlab.Gitlab("https://forge.extranet.logilab.fr", oauth_token=os.environ.get("GITLAB_TOKEN"))
all_core_projects = [x for x in gl.projects.list(all=True) if "cw-core" in x.tag_list] all_core_projects = [x for x in gl.projects.list(all=True) if "cw-core" in x.tag_list]
all_cubes = [x for x in gl.projects.list(all=True) if x.namespace["name"] == "cubes"] all_cubes = [x for x in gl.projects.list(all=True) if x.namespace["name"] == "cubes"]
...@@ -17,3 +17,19 @@ for project in all_core_projects + all_cubes: ...@@ -17,3 +17,19 @@ for project in all_core_projects + all_cubes:
"link_url": "https://forge.extranet.logilab.fr/%{project_path}/-/pipelines", "link_url": "https://forge.extranet.logilab.fr/%{project_path}/-/pipelines",
"image_url": "https://forge.extranet.logilab.fr/%{project_path}/badges/%{default_branch}/pipeline.svg" "image_url": "https://forge.extranet.logilab.fr/%{project_path}/badges/%{default_branch}/pipeline.svg"
}) })
# projects aren't in the qa dashboard yet :(
for project in all_cubes:
existing_badges = {x.name for x in project.badges.list(all=True)}
# for badge in ("doc", "readthedocs", "ew_format", "tox", "gitlab_ci", "readme_rst", "py2_tests", "py3_tests", "pytest", "check_manifest", "black", "mypy", "flake8", "from_forge", "capture_deprecated_warnings",):
for badge in ("doc", "readthedocs", "is_new_format", "tox", "gitlab_ci", "py2_tests", "py3_tests", "check_manifest", "black", "mypy", "flake8", "from_forge"):
if badge in existing_badges:
continue
print(f"{project.name_with_namespace} -> {badge} ({project.web_url})")
project.badges.create({
"name": badge,
"link_url": "https://cubicweb.pages.logilab.fr/dashboards/qa.html",
"image_url": "https://cubicweb.pages.logilab.fr/dashboards/qa/badges/%{project_id}/" + badge + ".svg"
})
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