Skip to content

fix(test): update grafana dashboard assertions for the historical-continuity query rewrite#6787

Merged
JSONbored merged 1 commit into
mainfrom
fix/grafana-dashboard-test-drift
Jul 17, 2026
Merged

fix(test): update grafana dashboard assertions for the historical-continuity query rewrite#6787
JSONbored merged 1 commit into
mainfrom
fix/grafana-dashboard-test-drift

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • fix(observability): restore historical continuity in the Self-Host dashboard #6779 rewrote 71 panel expr queries in grafana/dashboards/gittensory.json, wrapping each in an (new_metric or gittensory_old_metric) union so the Self-Host dashboard keeps showing pre-rebrand history. That PR's own local test run didn't catch it, but test/unit/selfhost-grafana-dashboard.test.ts pins 38 exact target.expr === "..." string assertions against this same file — 25 of them were still asserting the pre-fix(observability): restore historical continuity in the Self-Host dashboard #6779 query text and have been silently red on main since that PR merged (each it() block only reports its first failing assertion, so CI only surfaced 6 failing tests, not the full 25 broken assertions).
  • Verified programmatically: wrote every asserted expr string against the real dashboard JSON's actual panel targets, confirmed the exact mismatch set, cross-checked every proposed replacement exists byte-for-byte in the dashboard before editing.
  • No production code changed — this is a test-only fix reconciling assertions with the dashboard content that's already live and already verified against Prometheus.

Scope

  • Narrow, single-purpose change (test file only)
  • No secrets/private terms touched
  • No changelog edit

Validation

…tinuity query rewrite

#6779 wrapped 71 panel queries in this dashboard with an
(new_metric or gittensory_old_metric) union for historical Prometheus
continuity across the rebrand, but didn't update this test file's exact
target.expr string assertions to match -- 25 of them were pinned to the
pre-#6779 query text and have been silently failing since that PR merged.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 17, 2026
@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 (07c1c91).
⚠️ Report is 14 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6787       +/-   ##
===========================================
+ 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.22% <ø> (-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 merged commit 8cd0b24 into main Jul 17, 2026
18 checks passed
@JSONbored
JSONbored deleted the fix/grafana-dashboard-test-drift branch July 17, 2026 06:36
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
thomasalvaedison7777-lgtm pushed a commit to thomasalvaedison7777-lgtm/loopover that referenced this pull request Jul 17, 2026
…hboard

JSONbored#5522's hard-cutover rename of the gittensory_ metric prefix to loopover_
left this dashboard's 9 loopover_ai_* queries with no fallback to their
pre-rebrand names, so every panel here only ever showed data recorded
after that cutover -- confirmed live, both metric names have real
historical series in Prometheus going back well past the cutover.

Applies the same (loopover_x or gittensory_x) union fix already shipped
for grafana/dashboards/gittensory.json (JSONbored#6779/JSONbored#6787), including that
fix's own lesson: a label matcher like {provider="codex"} must bind to
each side of the union individually, never to the closing paren of the
union as a whole -- verified all 9 rewritten queries directly against
live Prometheus before deploying.

Deployed to edge-nl-01 and restarted Grafana to force a clean reprovision.
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