Watch
0
0
Fork
You've already forked hyperhive
0

module-eval: the CI metric names are pinned from the forge board's CI runs tab

This commit is contained in:
iris 2026-11-04 23:49:36 +01:00 • committed by mara
commit d86ecd68a8

View file

@ -411,17 +411,19 @@ let
== "https://auth.example.invalid/api/oidc/token";
}
{
# The CI board is in the directory the provider scans (`bao.json` is the
# 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
# of empty panels.
name = "the CI dashboard ships, and 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 pushes";
ok =
let
provider = lib.head grafanaWithAuthelia.containers.swarm-grafana.config.services.grafana.provision.dashboards.settings.providers;
shipped = lib.attrNames provider.options.path.entries;
board = builtins.fromJSON (builtins.readFile ../host-modules/swarm-grafana/dashboards/ci.json);
exprs = lib.concatMap (p: map (t: t.expr or "") (p.targets or [ ])) board.panels;
board = builtins.fromJSON (builtins.readFile ../host-modules/swarm-grafana/dashboards/forge.json);
exprs = lib.concatMap (el: map (q: q.spec.query.spec.expr or "") el.spec.data.spec.queries) (
lib.attrValues board.spec.elements
);
queried = lib.unique (
lib.concatMap (
e: map lib.head (lib.filter lib.isList (builtins.split ''"(hyperhive\.ci\.[a-z_.]+)"'' e))
@ -429,7 +431,7 @@ let
);
pushed = builtins.readFile ../../swarm-ci-metrics/src/sample.rs;
in
lib.elem "ci.json" shipped
lib.elem "forge.json" shipped
&& lib.elem "bao.json" shipped
&&
lib.sort lib.lessThan queried == [
@ -437,7 +439,7 @@ let
"hyperhive.ci.run.queue_wait"
]
&& lib.all (m: lib.hasInfix "\"${m}\"" pushed) queried
&& lib.any (v: v.name == "repo") board.templating.list;
&& lib.any (v: v.spec.name == "repo") board.spec.variables;
}
{
# The review classifier board ships, and every metric it queries is a name