🌱 Add CI test guarding cluster-objects manifests against metrics drift - #6804
🌱 Add CI test guarding cluster-objects manifests against metrics drift#6804kubestellar-hive[bot] wants to merge 1 commit into
Conversation
Fixes #6803 Adds src/__tests__/cluster-objects-metrics-consistency.test.ts, which parses cluster-objects/servicemonitor.yaml, prometheusrule.yaml, and deployment.yaml with the existing js-yaml dependency and: - fails on plain YAML syntax errors in these manifests (previously nothing parsed them in CI before a kubectl apply would) - cross-checks that prometheusrule.yaml's alert expressions only reference metric/label names that actually exist in src/lib/metrics.ts, so a future rename there can't silently leave DocsApiHighErrorRate / DocsApiHighRequestLatency permanently non-firing - checks servicemonitor.yaml and deployment.yaml agree on namespace Runs under the existing vitest.yml workflow (triggered on src/** changes) with no changes to .github/workflows/*. No exporter, backend, or external data flow added — this only validates manifests that already describe a pull-only, in-cluster-only scrape/alert setup. Signed-off-by: kubestellar-hive[bot] <223556219+Copilot@users.noreply.github.com>
|
Important Held for human sign-off on the direction, not on the code. This PR's only tracked rationale is #6803, which the hive filed itself — issue #6803 was filed by kubestellar-hive[bot] and no human has acknowledged it. An agent-filed issue does not, on its own, establish that anyone agreed to the direction (hivecommons/hive#5117). The change may well be right; nothing here is a review of it. To release the hold, acknowledge the direction on that issue — comment on it, assign yourself, or add the |
✅ Deploy Preview for kubestellar-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @kubestellar-hive[bot]. Thanks for your PR. I'm waiting for a kubestellar member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Fixes #6803
What
Adds
src/__tests__/cluster-objects-metrics-consistency.test.ts, which parsescluster-objects/servicemonitor.yaml,prometheusrule.yaml, anddeployment.yamlwith the existingjs-yamldependency and:kubectl applywould.prometheusrule.yaml's alert expressions only reference metric/label names that actually exist insrc/lib/metrics.ts(docs_api_requests_total{route,method,status_class},docs_api_request_duration_seconds), so a future rename there can't silently leaveDocsApiHighErrorRate/DocsApiHighRequestLatencypermanently non-firing with no signal.servicemonitor.yamlanddeployment.yamlagree onnamespace.Verified the drift check actually fires: temporarily renaming a label in
prometheusrule.yamlmakes the new test fail, then reverted before committing.Why this shape
vitest.ymlworkflow (triggered onsrc/**changes) — no.github/workflows/*edits, since agent tokens can't write there (see [operations] SLO-required healthz-monitor alert workflow (proposed in #6684) was never tracked or implemented #6701).cluster-objects/*.yamlalready documents itself as pull-only / no-op without an in-cluster Prometheus Operator; this PR only adds test coverage for manifests that already exist.Verification
npx vitest run src/__tests__/cluster-objects-metrics-consistency.test.ts— 4/4 passnpx vitest run— full suite, 790/790 passnpx eslint src/__tests__/cluster-objects-metrics-consistency.test.ts— cleannpx tsc --noEmit— no new errors— hive: agent=telemetry backend=copilot model=claude-sonnet-4-6