Skip to content

Commit 95f878f

Browse files
committed
Fixed grafana-wtf log subcommand for Grafana >= 11.6.0
1 parent 51f24f9 commit 95f878f

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
"9.5.21",
3535
"10.3.12",
3636
"10.4.17",
37+
"11.5.8",
3738
"11.6.5",
3839
"12.1.1",
3940
]

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ grafana-wtf changelog
55

66
in progress
77
===========
8+
- Fixed ``grafana-wtf log`` subcommand for Grafana >= 11.6.0.
89

910
2025-07-28 0.23.2
1011
=================

grafana_wtf/core.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,11 @@ def search_items(self, expression, items, results):
464464
def get_dashboard_versions(self, dashboard_id):
465465
# https://grafana.com/docs/http_api/dashboard_versions/
466466
get_dashboard_versions_path = "/dashboards/id/%s/versions" % dashboard_id
467-
return self.grafana.dashboard.client.GET(get_dashboard_versions_path)
467+
data = self.grafana.dashboard.client.GET(get_dashboard_versions_path)
468+
if "continueToken" in data:
469+
return data["versions"]
470+
else:
471+
return data
468472

469473
def explore_datasources(self):
470474
# Prepare indexes, mapping dashboards by uid, datasources by name

tests/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@
55
#GRAFANA_VERSION=10.1.9
66
#GRAFANA_VERSION=10.3.5
77
#GRAFANA_VERSION=10.4.1
8+
#GRAFANA_VERSION=11.2.2
9+
#GRAFANA_VERSION=11.4.8
10+
#GRAFANA_VERSION=11.5.8
11+
#GRAFANA_VERSION=11.6.0
812
#GRAFANA_VERSION=11.6.5
913
GRAFANA_VERSION=12.1.1

tests/test_commands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import re
44
import shlex
55
import sys
6+
from unittest import mock
67

78
import docopt
89
import grafana_client
@@ -337,7 +338,7 @@ def test_log_json_success(ldi_resources, capsys, caplog):
337338
reference = {
338339
"version": 1,
339340
# "datetime": "2021-09-29T17:32:23Z",
340-
"message": "",
341+
"message": mock.ANY,
341342
"folder": "Testdrive",
342343
"title": "luftdaten.info generic trend v27",
343344
"url": "http://localhost:33333/d/ioUrPwQiz/luftdaten-info-generic-trend-v27",

0 commit comments

Comments
 (0)