From 64f31188ebc68bf6c82b2a69454cc3c7a3a53fa6 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Thu, 23 May 2019 15:58:29 +0800 Subject: [PATCH] mgr/dashboard: check embedded Grafana dashboard references Add a script to check a cd-grafana component always refers to an existing Grafana dashboard. The check is added as a new tox command. Fixes: http://tracker.ceph.com/issues/40008 Signed-off-by: Kiefer Chang --- .../mgr/dashboard/ci/check_grafana_uids.py | 154 ++++++++++++++++++ src/pybind/mgr/dashboard/run-tox.sh | 4 +- src/pybind/mgr/dashboard/tox.ini | 5 +- 3 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 src/pybind/mgr/dashboard/ci/check_grafana_uids.py diff --git a/src/pybind/mgr/dashboard/ci/check_grafana_uids.py b/src/pybind/mgr/dashboard/ci/check_grafana_uids.py new file mode 100644 index 00000000000..0b74d089e96 --- /dev/null +++ b/src/pybind/mgr/dashboard/ci/check_grafana_uids.py @@ -0,0 +1,154 @@ +# -*- coding: utf-8 -*- +# pylint: disable=F0401 +""" +This script does: +* Scan through Angular html templates and extract tags +* Check if every tag has a corresponding Grafana dashboard by `uid` + +Usage: + python