diff --git a/nix/module-eval/grafana.nix b/nix/module-eval/grafana.nix index 677cbd83..83fe5d0c 100644 --- a/nix/module-eval/grafana.nix +++ b/nix/module-eval/grafana.nix @@ -414,9 +414,10 @@ let { # The CI runs tab of the forge board is in the directory the provider scans (`bao.json` is the # control that the entries are read at all), and every metric it queries - # is a name the poller pushes: a renamed metric on either side is a board + # is a name the poller pushes, and the default-branch panels query the names + # the controller records: a renamed metric on either side is a board # of empty panels. - name = "the forge dashboard ships, and its CI runs tab queries the metric names the CI run poller pushes"; + name = "the forge dashboard ships, and its CI runs tab queries the metric names the CI run poller and the controller record"; ok = let provider = lib.head grafanaWithAuthelia.containers.swarm-grafana.config.services.grafana.provision.dashboards.settings.providers; @@ -431,6 +432,12 @@ let ) exprs ); pushed = builtins.readFile ../../swarm-ci-metrics/src/sample.rs; + queriedVcs = lib.unique ( + lib.concatMap ( + e: map lib.head (lib.filter lib.isList (builtins.split ''"(hyperhive\.vcs\.[a-z_.]+)"'' e)) + ) exprs + ); + recordedVcs = builtins.readFile ../../swarm-controller/src/vcs_metrics.rs; in lib.elem "forge.json" shipped && lib.elem "bao.json" shipped @@ -440,6 +447,13 @@ let "hyperhive.ci.run.queue_wait" ] && lib.all (m: lib.hasInfix "\"${m}\"" pushed) queried + && + lib.sort lib.lessThan queriedVcs == [ + "hyperhive.vcs.default_branch.lines_added" + "hyperhive.vcs.default_branch.lines_deleted" + "hyperhive.vcs.default_branch.merges" + ] + && lib.all (m: lib.hasInfix "\"${m}\"" recordedVcs) queriedVcs && lib.any (v: v.spec.name == "repo") board.spec.variables; } {