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

refactor(qa): extract special case logic

parent 32057c1fe53f
......@@ -21,6 +21,11 @@ for number, cube in enumerate(all_cubes):
# safety
# deprecation warnings ?
if cube.name.startswith("cubicweb-"):
cube_normalized_name = cube.name.split("-", 1)[1].replace("-", "_")
else:
cube_normalized_name = cube.name.replace("-", "_")
try:
cube_files = {x["name"] for x in cube.repository_tree()}
except (gitlab.GitlabHttpError, gitlab.GitlabGetError):
......@@ -32,10 +37,7 @@ for number, cube in enumerate(all_cubes):
has_readme_rst = bool({"README.rst", "README.md"} & cube_files) # set intersection
has_doc = bool({"doc", "docs"} & cube_files) # set intersection
if cube.name.startswith("cubicweb-"):
has_readthedocs = requests.get(f"https://{cube.name}.readthedocs.io").status_code == 200
else:
has_readthedocs = requests.get(f"https://cubicweb-{cube.name}.readthedocs.io").status_code == 200
has_readthedocs = requests.get(f"https://cubicweb-{cube_normalized_name}.readthedocs.io").status_code == 200
if has_tox:
tox_content = cube.files.get("tox.ini", ref="branch/default").decode().decode("Utf-8")
......
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