feat(observability): add GitHub issue stats to the maintainer dashboard - #4170
feat(observability): add GitHub issue stats to the maintainer dashboard#4170JSONbored wants to merge 1 commit into
Conversation
The Reviews & PRs (maintainer) dashboard tracked pull requests only -- there was no issue-activity visibility without switching to the separate upstream GitHub dashboard. Add an "Issues opened/closed/open" stat row using the same frser-sqlite-datasource plus windowed-updated_at convention every existing panel on this dashboard already uses, rather than the live-API grafana-github-datasource the sibling dashboard uses for its own "Open issues" panel -- matching this dashboard's own established, webhook-observed philosophy instead of introducing a second datasource type into one dashboard. The tradeoff and its caveat are documented on the dashboard itself (root description plus per-panel descriptions) and cross-link to the sibling dashboard for an upstream-accurate, time-range-independent count. That local issues table was never mirrored into the redacted reporting export the dashboard actually reads (only review_targets and ai_usage_events were), so also extend export-grafana-reporting-db.sh with a minimal issues mirror (repo, number, state, created_at, updated_at only -- no title/labels/payload, since these are count-only stat panels) across both the Postgres and SQLite source paths, including the incremental fingerprint that detects an in-place state change. Closes #3716
|
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 #4170 +/- ##
=======================================
Coverage 93.73% 93.73%
=======================================
Files 387 387
Lines 36304 36304
Branches 13298 13298
=======================================
Hits 34031 34031
Misses 1617 1617
Partials 656 656 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 09:21:19 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
|
Closing unmerged — superseded by #4168, which merged first and implements the same 3 stat panels (Issues opened/closed/open) for the same issue #3716. Re-adding an equivalent-but-differently-designed panel set on top would just create duplicate/conflicting rows on the same dashboard, which is worse than the datasource-consistency tradeoff this version made differently (noted for the record in a comment on #3716). No further action needed here. |
Summary
grafana/dashboards/maintainer-reviews.json) tracked pull requests only. Add a new "GitHub issues" stat row (Issues opened/Issues closed/Issues open) for the same dashboard time window the PR panels already use, so a maintainer sees issue activity without switching to the separate upstream GitHub dashboard.frser-sqlite-datasourcereporting export (uid: gittensory-db), not thegrafana-github-datasourcelive-API plugin the siblinggithub-prs.jsondashboard uses for its own "Open issues" panel. To match this dashboard's own established convention instead of blindly copying the sibling's, the new panels query a localissuestable through the same datasource, with the sameunixepoch(updated_at) >= ${__from} AND < ${__to}windowing the existing panels use (Issues openedis the one deliberate exception, keyed offcreated_atinstead, since an issue'screated_atnever changes after the fact — see its panel description). The tradeoff and caveat are documented on the dashboard itself (rootdescriptionplus theIssues openpanel's own description) and cross-link to the sibling dashboard's time-range-independent "Open issues" panel for an upstream-accurate count.issuestable (migrations/0001_initial.sql, webhook-populated byupsertIssueFromGitHubfor every repo the app receives issue webhooks for — verified at the call site insrc/queue/processors.ts, gated only onpayload.issueexisting, not a gittensory-specific check) was never mirrored into the redacted reporting export the dashboard actually reads —scripts/export-grafana-reporting-db.shonly ever exportedreview_targetsandai_usage_events. Without this, the new panels would query a table that doesn't exist in the reporting SQLite file. Extended the exporter with a minimalissuesmirror (repo, number, state, created_at, updated_atonly — no title/labels/payload, since these are count-only stat panels) across both the Postgres-source and SQLite-source code paths, including the incremental fast-path fingerprint (full-content hash, since issues receive in-place updates likepull_requests/review_targetsdo).Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥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:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/**,packages/**, orapps/gittensory-ui/**(onlygrafana/,scripts/, andtest/unit/), andnpm run test:changed(vitest's real import-graph diff againstorigin/main) confirms exactly two test files are reachable from this diff — both are included above and pass.test:workers,build:mcp,test:mcp-pack, and theui:*checks have no path into this diff's blast radius, so I did not re-run them locally.npm run test:coverage(full, unsharded) found exactly one failing test out of 11,997:test/unit/selfhost-update-script.test.ts > selfhost-update.sh > fetches, fast-forwards, rebuilds, and verifies health on a clean checkout, a 15s timeout. That file is untouched by this diff and not in thetest:changedset. Re-run in isolation (npx vitest run test/unit/selfhost-update-script.test.ts), all 12 of its tests pass in ~6.6s total (922ms for the specific test), confirming a resource-contention flake from running the entire suite concurrently rather than a real regression.Safety
apps/gittensory-uichanges; this is a Grafana dashboard backed by a real reporting-DB export, not the product UI.)UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository. (N/A — a self-host Grafana dashboard panel, notapps/gittensory-ui; no local Grafana instance to screenshot from in this environment. Panel layout/queries are verified instead via the new automated tests intest/unit/selfhost-grafana-dashboard.test.ts.)UI Evidence
N/A — this is a self-host Grafana dashboard change (
grafana/dashboards/maintainer-reviews.json), not anapps/gittensory-uichange. There is no running Grafana instance in this environment to screenshot from. Panel structure, query correctness, and windowing semantics are covered by new automated tests instead (test/unit/selfhost-grafana-dashboard.test.ts,test/unit/selfhost-grafana-reporting.test.ts), and the JSON is validated withpython3 -m json.tool,jq, andnpm run selfhost:validate-observability.Notes
scripts/export-grafana-reporting-db.sh(redacted reporting-DB exporter) and its test suite (test/unit/selfhost-grafana-reporting.test.ts) to mirror theissuestable — required for the new panels to have real data to query; see Summary for why.versionbumped 5 → 6, matching this repo's established convention for dashboard edits (e.g. fix(observability): clarify manual/commented/ignored panel semantics #4134).Closes #3716