Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Verify support for Grafana 11 #140

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.8", "3.12" ]
grafana-version: [ "6.7.6", "7.5.17", "8.5.27", "9.5.18", "10.3.5", "10.4.1" ]
grafana-version: [ "6.7.6", "7.5.17", "8.5.27", "9.5.18", "10.3.5", "10.4.1", "11.1.0" ]

env:
OS_TYPE: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ grafana-wtf changelog

in progress
===========
- CI: Verify support for Grafana 11

2024-04-20 0.19.1
=================
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ grafana-wtf
.. |license| image:: https://img.shields.io/pypi/l/grafana-wtf.svg
:target: https://github.com/panodata/grafana-wtf/blob/main/LICENSE

.. |grafana-versions| image:: https://img.shields.io/badge/Grafana-6.x%20--%2010.x-blue.svg
.. |grafana-versions| image:: https://img.shields.io/badge/Grafana-6.x%20--%2011.x-blue.svg
:target: https://github.com/grafana/grafana
:alt: Supported Grafana versions

Expand Down
6 changes: 5 additions & 1 deletion grafana_wtf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from tqdm import tqdm
from tqdm.contrib.logging import tqdm_logging_redirect
from urllib3.exceptions import InsecureRequestWarning
from verlib2 import Version

from grafana_wtf import __appname__, __version__
from grafana_wtf.compat import CachedSession
Expand Down Expand Up @@ -167,7 +168,10 @@ def scan_snapshots(self):
self.data.snapshots = self.grafana.snapshots.get_dashboard_snapshots()

def scan_notifications(self):
self.data.notifications = self.grafana.notifications.lookup_channels()
if Version(self.grafana.version) < Version("11"):
self.data.notifications = self.grafana.notifications.lookup_channels()
else:
warnings.warn("Notification channel scanning support for Grafana 11 is not implemented yet", UserWarning)

def scan_datasources(self):
log.info("Scanning datasources")
Expand Down
3 changes: 2 additions & 1 deletion tests/.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
#GRAFANA_VERSION=9.5.18
#GRAFANA_VERSION=10.1.9
#GRAFANA_VERSION=10.3.5
GRAFANA_VERSION=10.4.1
#GRAFANA_VERSION=10.4.1
GRAFANA_VERSION=11.1.0
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def test_connect_non_json_response():
wtf = GrafanaWtf("https://example.org/")
with pytest.raises(ConnectionError) as ex:
_ = wtf.health
assert ex.match("The request to https://example.org/api/health failed: Client Error 404")
assert ex.match("The request to https://example.org/api/health failed")