Skip to content

test(selfhost): sync grafana dashboard assertions with #6779's gittensory_ fallback exprs - #6785

Merged
JSONbored merged 1 commit into
mainfrom
test/sync-grafana-dashboard-assertions-6779
Jul 17, 2026
Merged

test(selfhost): sync grafana dashboard assertions with #6779's gittensory_ fallback exprs#6785
JSONbored merged 1 commit into
mainfrom
test/sync-grafana-dashboard-assertions-6779

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • PR fix(observability): restore historical continuity in the Self-Host dashboard #6779 ("fix(observability): restore historical continuity in the Self-Host dashboard") intentionally changed most Prometheus expr query strings in grafana/dashboards/gittensory.json to add a legacy-metric fallback, e.g. "loopover_queue_backlog_convergence_pending" became "(loopover_queue_backlog_convergence_pending or gittensory_queue_backlog_convergence_pending)" — a migration-period dual-read of the old gittensory_-prefixed metric names alongside the new loopover_-prefixed ones.
  • That dashboard JSON change is correct, shipped production behavior. But test/unit/selfhost-grafana-dashboard.test.ts was never updated to match, so its exact-string expr/legendFormat assertions started failing against current main (6 failing test cases, ~30 assertions affected).
  • This PR updates only the test file's expected string literals to match the dashboard JSON's real, current, shipped values. grafana/dashboards/gittensory.json itself is untouched — it does not need to change.
  • 25 expect(...) assertions changed across 6 it(...) blocks: the GitHub response cache counters test, the Orb zero-safe panels test, the Postgres/backup freshness test, the Maintenance Admission Deferrals test, the self-host runtime-drift signals test, and the backlog-vs-fresh-intake lane fairness test. Assertions that were already accurate (e.g. Postgres exporter metrics, which fix(observability): restore historical continuity in the Self-Host dashboard #6779 didn't touch) were left as-is.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

No linked issue: this is a maintainer-authored, test-only fix restoring a currently-broken test file to green against already-merged, correct production code (PR #6779). There is no behavior change and nothing to file a contributor issue against.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • The last Validation box is N/A: this PR fixes existing test assertions to match already-shipped code, it adds no new behavior/branches. test/unit/selfhost-grafana-dashboard.test.ts (30/30 tests) and the full npm run test:ci chain (all drift checks, typecheck, coverage, engine/live-gate/driver parity, workers, mcp/miner pack, ui lint/typecheck/build) ran clean end-to-end locally, plus npm audit --audit-level=moderate (0 vulnerabilities).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no such changes in this PR.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP changes.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. (N/A — no visible UI changes; test-file-only PR.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (N/A — no doc/changelog changes needed.)

UI Evidence

N/A — this PR only changes test/unit/selfhost-grafana-dashboard.test.ts; there is no visible UI/frontend change.

Notes

  • Root cause + fix are entirely test-only: grafana/dashboards/gittensory.json is not modified by this PR.

…sory_ fallback exprs

PR #6779 changed most Prometheus expr query strings in
grafana/dashboards/gittensory.json to add a legacy-metric fallback
(e.g. "loopover_x" became "(loopover_x or gittensory_x)"), a dual-read
migration for the old gittensory_-prefixed metric names alongside the
new loopover_-prefixed ones. That change to the dashboard JSON was
intentional and correct, but test/unit/selfhost-grafana-dashboard.test.ts
was never updated to match, so its exact-string expr/legendFormat
assertions started failing on main.

Updates the 25 affected assertions across 6 describe/it blocks (GitHub
response cache counters, Orb zero-safe panels, Postgres/backup
freshness, maintenance admission deferrals, self-host runtime-drift
signals, and backlog-vs-fresh-intake lane fairness) to match the
dashboard JSON's current, shipped expr values. No behavior change --
grafana/dashboards/gittensory.json is untouched.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.63%. Comparing base (67af510) to head (3324a9d).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6785       +/-   ##
===========================================
+ Coverage   82.21%   93.63%   +11.41%     
===========================================
  Files         682      682               
  Lines       68115    68115               
  Branches    18692    18692               
===========================================
+ Hits        56003    63779     +7776     
+ Misses       9998     3350     -6648     
+ Partials     2114      986     -1128     
Flag Coverage Δ
shard-1 43.60% <ø> (-0.09%) ⬇️
shard-2 36.89% <ø> (+0.09%) ⬆️
shard-3 32.37% <ø> (+0.04%) ⬆️
shard-4 34.21% <ø> (-0.60%) ⬇️
shard-5 31.43% <ø> (?)
shard-6 45.76% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 216 files with indirect coverage changes

@JSONbored JSONbored self-assigned this Jul 17, 2026
@JSONbored
JSONbored merged commit ab84f78 into main Jul 17, 2026
18 checks passed
@JSONbored
JSONbored deleted the test/sync-grafana-dashboard-assertions-6779 branch July 17, 2026 06:23
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant