mgr/dashboard: docs gen tags sort

When generating tags the order of endpoints wasn't taken into account.
Two endpoints with the same url prefix, for example `/api/cluster/` and
`/api/cluster/user`, have different docs and the tags is generated from
a doc of one of these two, and since the order of these endpoints might
vary it is imperative to sort them to have a deterministic output.

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
Pere Diaz Bou 2022-09-09 11:18:42 +02:00
parent 0a60e89992
commit 9673ed1869
2 changed files with 2 additions and 8 deletions

View File

@ -33,7 +33,7 @@ class Docs(BaseController):
list_of_ctrl.add(endpoint.ctrl)
tag_map: Dict[str, str] = {}
for ctrl in list_of_ctrl:
for ctrl in sorted(list_of_ctrl, key=lambda ctrl: ctrl.__name__):
tag_name = ctrl.__name__
tag_descr = ""
if hasattr(ctrl, 'doc_info'):

View File

@ -30,6 +30,7 @@ deps =
-rrequirements-lint.txt
[testenv]
basepython=python3
deps =
{[base]deps}
{[base-test]deps}
@ -47,7 +48,6 @@ commands =
pytest {posargs}
[testenv:run]
basepython=python3
deps =
{[base]deps}
{[base-test]deps}
@ -99,7 +99,6 @@ commands =
rstcheck --report info --debug -- {[rstlint]dirs}
[testenv:lint]
basepython=python3
deps =
{[base]deps}
{[base-lint]deps}
@ -112,13 +111,11 @@ commands =
{[base-rst]commands}
[testenv:flake8]
basepython = python3
deps = {[base-lint]deps}
commands =
flake8 --config=tox.ini {posargs}
[testenv:pylint]
basepython = python3
deps =
{[base]deps}
{[base-lint]deps}
@ -126,7 +123,6 @@ commands =
pylint {[pylint]addopts} {posargs:{[pylint]dirs}}
[testenv:rst]
basepython = python3
deps = {[base-lint]deps}
commands =
rstcheck --report info --debug -- {posargs:{[rstlint]dirs}}
@ -142,7 +138,6 @@ addopts =
# --aggressive
[testenv:fix]
basepython=python3
deps =
{[base-lint]deps}
commands =
@ -156,7 +151,6 @@ commands =
python ci/check_grafana_dashboards.py frontend/src/app ../../../../monitoring/ceph-mixin/dashboards_out
[testenv:openapi-{check,fix}]
basepython = python3
allowlist_externals = diff
description =
check: Ensure that auto-generated OpenAPI Specification matches the current version