Skip to content

fix(observability): repo-scope + fix stale data on the Reviews & PRs dashboard#5234

Merged
JSONbored merged 1 commit into
mainfrom
claude/grafana-observability-fixes
Jul 12, 2026
Merged

fix(observability): repo-scope + fix stale data on the Reviews & PRs dashboard#5234
JSONbored merged 1 commit into
mainfrom
claude/grafana-observability-fixes

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Three real bugs in grafana/dashboards/maintainer-reviews.json ("Reviews & PRs (maintainer)"), found via a live screenshot and traced to root cause:

  1. Issues opened/closed/open panels hit GitHub Search's 1000-result cap (hence the round 1000s) via a query hardcoded to org:JSONbored, which would silently break for any other self-hoster. feat(observability): add GitHub Issues stats to the Reviews & PRs maintainer dashboard #3716 (which added these panels) explicitly framed the data source as a tradeoff and never disclosed the cap on this dashboard (unlike its sibling github-prs.json, which does). Switched to the local, webhook-observed issues table via the same gittensory-db datasource the PR panels already use — no cap, no hardcoding, same consistency model as the rest of the dashboard. Confirmed live on the server first that the issues table is actually populated for every tracked repo (18 repos, all with recent timestamps), per feat(observability): add GitHub Issues stats to the Reviews & PRs maintainer dashboard #3716's own pre-check.
  2. "Ignored" panel queried dead values (status='ignored'/verdict='ignore') the export's mapping hasn't been able to produce since a Grafana maintainer dashboard shows verdict=manual for every PR (export CASE ignores state/merged_at) #3511/fix(selfhost): source an open PR's Grafana verdict from review_audit, not dead advisories #3535 migration off the old advisories-table model years ago (git log -p confirms the mapping used to exist and was removed). The displayed count was stale reporting-DB output the incremental fast-path never invalidated, because it only fingerprints source data, never the export script's own mapping logic. Redefined the panel around a value the current model actually produces (no gate decision recorded yet), and fixed the underlying staleness gap with a SCRIPT_VERSION constant folded into the fingerprint, so a future logic-only edit to the export script always forces a fresh rebuild.
  3. No repo filter existed anywhere on the dashboard. Added a dynamic, query-backed $repo template variable (SELECT DISTINCT repo FROM review_targets, Include All) and scoped every panel to it — unlike the one hardcoded-list precedent in this repo (github-prs.json's $scope), this lists whatever repos actually exist in a given self-hoster's own data.

Also relabeled "Commented (advisory)" to "Approved (pending merge)" since the underlying state (gate decided merge, PR not yet merged) was easy to misread as just an advisory comment.

Scope

Validation

  • git diff --check
  • node scripts/validate-observability-configs.mjs
  • npx vitest run test/unit/selfhost-grafana-dashboard.test.ts test/unit/selfhost-grafana-reporting.test.ts — 43/43 pass, including new tests for the issues export (both Postgres and SQLite source paths), the $repo filter actually narrowing results (not just being present), and the SCRIPT_VERSION fingerprint fix actually forcing a rebuild.
  • Full npm run test:ci — not run in full; this diff touches only scripts/**, grafana/**, and two test/unit/** files, none of which are src/** production code, so the broader suites don't apply.

If any required check was skipped, explain why:

  • No src/** change anywhere in this diff — purely a dashboard JSON, its export script, and their existing test files. Codecov's patch gate only measures src/**.

Safety

  • No secrets, tokens, or private values exposed.
  • Public GitHub text stays sanitized.
  • Auth/CORS/GitHub App/session tests — not applicable.
  • API/OpenAPI/MCP — not applicable.
  • UI changes use live data — not applicable (Grafana dashboard JSON, not apps/gittensory-ui).
  • No docs changes needed here (checked: no docs page enumerates these specific panels).

UI Evidence

Not applicable — Grafana dashboard JSON, not a web UI change in this repo's own frontend.

Notes

Phase 1 of 3 in a larger observability accuracy audit the user requested (full dashboard audit + AI-usage dashboard consolidation to follow as separate PRs, verified incrementally). Live pre-checks done before writing any code: confirmed the reporting export is genuinely fresh (not frozen — today's PRs show up with today's timestamps) and confirmed the local issues table has real, recent data across all 18 tracked repos.

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.34%. Comparing base (14c75e2) to head (124553d).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5234   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files         473      473           
  Lines       39968    39968           
  Branches    14570    14570           
=======================================
  Hits        37708    37708           
  Misses       1585     1585           
  Partials      675      675           
Flag Coverage Δ
shard-1 46.42% <ø> (ø)
shard-2 34.47% <ø> (ø)
shard-3 30.97% <ø> (ø)
shard-4 33.31% <ø> (ø)
shard-5 33.69% <ø> (ø)
shard-6 44.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-12 10:19:47 UTC

4 files · 2 blockers · readiness 93/100 · CI green · unstable

⏸️ Suggested Action - Manual Review

  • AI review already in progress for this PR head: Another Gittensory pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another Gittensory pass. Gittensory is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers No AI review summary
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 45 registered-repo PR(s), 37 merged, 409 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 45 PR(s), 409 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed).
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 45 PR(s), 409 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

…dashboard

Three bugs in grafana/dashboards/maintainer-reviews.json: issue panels
hit GitHub Search's 1000-result cap via a hardcoded org query (switched
to the local, uncapped issues table already used by the PR panels), the
Ignored panel queried dead status/verdict values the export mapping
hasn't produced since a prior migration (redefined around a value the
current model produces, plus a SCRIPT_VERSION fingerprint so future
export-logic-only edits invalidate the cache), and no per-repo filter
existed anywhere on the dashboard (added a dynamic $repo template
variable backed by a live query, not a hardcoded list).

Fixes noUncheckedIndexedAccess TS2532 errors in the new $repo template
variable test -- vars[0] needs the non-null assertion already used
elsewhere in this codebase after the preceding toHaveLength(1) proves
the array is non-empty.
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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant