From: Pere Diaz Bou Date: Fri, 9 Sep 2022 09:18:42 +0000 (+0200) Subject: mgr/dashboard: docs gen tags sort X-Git-Tag: v17.2.6~494^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dec33199ef307f48bef1d1290c7ebef88f490968;p=ceph.git 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 (cherry picked from commit 9673ed18699cdca3f032fd131d4248b010750ef6) --- diff --git a/src/pybind/mgr/dashboard/controllers/docs.py b/src/pybind/mgr/dashboard/controllers/docs.py index ab9f5687b532..866863cff913 100644 --- a/src/pybind/mgr/dashboard/controllers/docs.py +++ b/src/pybind/mgr/dashboard/controllers/docs.py @@ -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'): diff --git a/src/pybind/mgr/dashboard/tox.ini b/src/pybind/mgr/dashboard/tox.ini index 4ba95ac24d7c..1f5d28f66611 100644 --- a/src/pybind/mgr/dashboard/tox.ini +++ b/src/pybind/mgr/dashboard/tox.ini @@ -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