From 9673ed18699cdca3f032fd131d4248b010750ef6 Mon Sep 17 00:00:00 2001 From: Pere Diaz Bou Date: Fri, 9 Sep 2022 11:18:42 +0200 Subject: [PATCH] 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 --- src/pybind/mgr/dashboard/controllers/docs.py | 2 +- src/pybind/mgr/dashboard/tox.ini | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/docs.py b/src/pybind/mgr/dashboard/controllers/docs.py index d5c71383e340b..2ade4ef9bad4c 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 f412c0bdf18e9..47756e946e125 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 -- 2.39.5