Skip to content

feat(observability): add GitHub Issues stats to the Reviews & PRs maintainer dashboard #3716

Description

@JSONbored

Context

Part of #1819.

grafana/dashboards/maintainer-reviews.json (the "Gittensory — Reviews & PRs (maintainer)" dashboard) currently tracks pull requests only. All six top-row stat panels (PRs tracked, Merged, Closed, Manual review, Commented (advisory), Ignored) and the "Pull requests (latest 1000)" table query the local review_targets SQLite table via the frser-sqlite-datasource (uid: gittensory-db). There is no issue-activity visibility anywhere on this dashboard.

The review engine already has TWO usable building blocks for this, neither wired into this dashboard yet:

  • A local issues table (migrations/0001_initial.sql) — webhook-observed (upsertIssueFromGitHub in src/queue/processors.ts), with state, created_at, updated_at columns, same shape/philosophy as the local PR data this dashboard already uses.
  • A sibling dashboard, grafana/dashboards/github-prs.json, already has a proven "Open issues" panel using the grafana-github-datasource live-GitHub-API datasource (queryType: "Issues", GitHub search syntax, e.g. $scope is:issue is:open) — see its panel id 4 (lines ~87-111) for the exact template.

Requirements

  • Add issue-count stat panel(s) to maintainer-reviews.json mirroring the existing PR stat-panel row (e.g. "Issues opened", "Issues closed", "Issues open") for the same dashboard time window the PR panels already use (unixepoch(updated_at) >= ${__from} AND < ${__to} pattern, or the GitHub-datasource equivalent).
  • Pick a data source and document the tradeoff — either is acceptable, this is a real judgment call:
    1. The local issues table via frser-sqlite-datasource, matching the exact time-range-filtered pattern the PR panels already use. Consistent with this dashboard's existing "local, webhook-observed" philosophy, but inherits the same known completeness caveat the PR data already has (webhook-observed only, not a full upstream census — see the github-prs.json dashboard's own doc comment on why it exists as the "accuracy fix").
    2. The grafana-github-datasource live-API pattern already proven in github-prs.json. Upstream-accurate regardless of local webhook gaps, but a different consistency model from the rest of this dashboard, and the datasource caps results at 1000 rows (fine for a stat/count query, matters more for a table).
    • Before committing to option 1, confirm the local issues table is actually populated for every repo this dashboard tracks (not just gittensory itself) — spot-check a row count per repo.
  • Match the existing panel visual style (type: stat, colorMode: background, a fixed distinct color, same grid row) so the addition looks native, not bolted on.

Deliverables

  • Updated grafana/dashboards/maintainer-reviews.json with new issue-stat panel(s).
  • A short note (PR description or dashboard panel description) documenting which data source was chosen and why, including the caveat from whichever option wasn't picked.

Expected outcome

A maintainer glancing at the "Reviews & PRs" dashboard also sees issue activity (opened/closed, and ideally current open-issue backlog) for the same time window, without switching to a separate dashboard.

Non-goals

Rebuilding or duplicating github-prs.json's deeper issue-triage view (oldest-first table, org-wide $scope selector) — that already exists and serves a different purpose. This issue is just a lightweight issue-stats row on the PR-focused dashboard.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions