fix(observability): repo-scope + fix stale data on the Reviews & PRs dashboard#5234
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-12 10:19:47 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 1 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
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.
|
…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.
2dcbb94 to
124553d
Compare
Summary
Three real bugs in
grafana/dashboards/maintainer-reviews.json("Reviews & PRs (maintainer)"), found via a live screenshot and traced to root cause:1000s) via a query hardcoded toorg: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 siblinggithub-prs.json, which does). Switched to the local, webhook-observedissuestable via the samegittensory-dbdatasource 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 theissuestable 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.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 oldadvisories-table model years ago (git log -pconfirms 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 aSCRIPT_VERSIONconstant folded into the fingerprint, so a future logic-only edit to the export script always forces a fresh rebuild.$repotemplate 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
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; nosite//CNAME/lovablechanges.Validation
git diff --checknode scripts/validate-observability-configs.mjsnpx 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$repofilter actually narrowing results (not just being present), and theSCRIPT_VERSIONfingerprint fix actually forcing a rebuild.npm run test:ci— not run in full; this diff touches onlyscripts/**,grafana/**, and twotest/unit/**files, none of which aresrc/**production code, so the broader suites don't apply.If any required check was skipped, explain why:
src/**change anywhere in this diff — purely a dashboard JSON, its export script, and their existing test files. Codecov's patch gate only measuressrc/**.Safety
apps/gittensory-ui).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
issuestable has real, recent data across all 18 tracked repos.