From afd6199cff2d5b50c1b9458b0f3dcf35f63d16ae Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 4 Nov 2022 11:40:07 +0100 Subject: nixos/grafana: re-add legacy notifiers test, mention notifiers in release notes --- .../from_md/release-notes/rl-2211.section.xml | 10 ++++++ nixos/doc/manual/release-notes/rl-2211.section.md | 4 +++ nixos/tests/grafana/provision/default.nix | 39 ++++++++++++++++++++++ 3 files changed, 53 insertions(+) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index caeeae1aefa86..e308fb059cb44 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -1309,6 +1309,16 @@ services.github-runner.serviceOverrides.SupplementaryGroups = [ deploy to NixOS. + + + + is not affected by this change because this feature + will is deprecated by Grafana and will probably + removed in Grafana 10. It’s recommended to use + services.grafana.provision.alerting.contactPoints + instead. + + diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 091377d74a6fb..3ae9e341ee301 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -426,6 +426,10 @@ Available as [services.patroni](options.html#opt-services.patroni.enable). provisioning files from non-NixOS Grafana instances that you also want to deploy to NixOS. + - [](#opt-services.grafana.provision.notifiers) is not affected by this change because + this feature will is deprecated by Grafana and will probably removed in Grafana 10. + It's recommended to use `services.grafana.provision.alerting.contactPoints` instead. + - The `services.grafana.provision.alerting` option was added. It includes suboptions for every alerting-related objects (with the exception of `notifiers`), which means it's now possible to configure modern Grafana alerting declaratively. - Matrix Synapse now requires entries in the `state_group_edges` table to be unique, in order to prevent accidentally introducing duplicate information (for example, because a database backup was restored multiple times). If your Synapse database already has duplicate rows in this table, this could fail with an error and require manual remediation. diff --git a/nixos/tests/grafana/provision/default.nix b/nixos/tests/grafana/provision/default.nix index c4cb9a54daa5f..7ff7ed74a977e 100644 --- a/nixos/tests/grafana/provision/default.nix +++ b/nixos/tests/grafana/provision/default.nix @@ -28,6 +28,35 @@ let }; extraNodeConfs = { + provisionLegacyNotifiers = { + services.grafana.provision = { + datasources.settings = { + apiVersion = 1; + datasources = [{ + name = "Test Datasource"; + type = "testdata"; + access = "proxy"; + uid = "test_datasource"; + }]; + }; + dashboards.settings = { + apiVersion = 1; + providers = [{ + name = "default"; + options.path = "/var/lib/grafana/dashboards"; + }]; + }; + notifiers = [{ + uid = "test_notifiers"; + name = "Test Notifiers"; + type = "email"; + settings = { + singleEmail = true; + addresses = "test@test.com"; + }; + }]; + }; + }; provisionNix = { services.grafana.provision = { datasources.settings = { @@ -191,5 +220,15 @@ in { machine.succeed( "curl -sSfN -u testadmin:snakeoilpwd http://127.0.0.1:3000/api/v1/provisioning/mute-timings | grep Test\ Mute\ Timing" ) + + with subtest("Successful notifiers provision"): + provisionLegacyNotifiers.wait_for_unit("grafana.service") + provisionLegacyNotifiers.wait_for_open_port(3000) + print(provisionLegacyNotifiers.succeed( + "curl -sSfN -u testadmin:snakeoilpwd http://127.0.0.1:3000/api/alert-notifications/uid/test_notifiers" + )) + provisionLegacyNotifiers.succeed( + "curl -sSfN -u testadmin:snakeoilpwd http://127.0.0.1:3000/api/alert-notifications/uid/test_notifiers | grep Test\ Notifiers" + ) ''; }) -- cgit 1.4.1