Skip to content

feat(dashboard): add slim issues endpoint to replace per-miner fan-out#93

Merged
entrius merged 2 commits into
testfrom
feat/dashboard-module
May 14, 2026
Merged

feat(dashboard): add slim issues endpoint to replace per-miner fan-out#93
entrius merged 2 commits into
testfrom
feat/dashboard-module

Conversation

@anderdc
Copy link
Copy Markdown
Collaborator

@anderdc anderdc commented May 14, 2026

Summary

Adds a new DashboardModule exposing a single read-only endpoint designed to replace the dashboard's per-miner fan-out against /api/v1/miners/<id>/issues. The dashboard currently fires N parallel mirror calls on every mount (one per active miner), each returning the full scoring-shape payload. With ~25+ active miners this saturates the mirror's rate limit and produces the cascade of 304s visible in mirror.gittensor.io/api/v1/miners/.../issues requests on the dashboard.

The new endpoint is roster-blind by design — the mirror has no opinion about subnet membership. It returns every issue in the slim shape the dashboard needs, and the UI blends with the gittensor miner roster client-side to filter to subnet authors.

```
GET /api/v1/dashboard/issues?since=
→ {
since,
generated_at,
issues: [
{
repo_full_name, issue_number,
author_github_id,
created_at, closed_at,
state, state_reason,
solving_pr: { merged_at } | null
}
]
}
```

Why a separate module

/api/v1/miners/<id>/issues is a scoring endpoint — every column it returns is read by some validator rule (labels with actor attribution, full `solving_pr` with review summary, linked issues, etc.). Slimming or re-purposing it risks silent scoring regressions. The new `DashboardModule` lives in its own folder, has its own controller/service, and ships the minimum shape the dashboard needs. Validator API surface is untouched.

Resolved-issue predicate

The endpoint preserves `state`, `state_reason`, and a slim `solving_pr.merged_at` so the UI can apply the conjunction predicate (closed AND completed AND solving PR merged), which matches how "Solved" is defined elsewhere in the app and fixes the dashboard "Issues Resolved" series being permanently 0 (entrius/gittensor-ui#1125).

Changes

  • New `packages/das/src/api/dashboard/dashboard.controller.ts` — `GET /api/v1/dashboard/issues`
  • New `packages/das/src/api/dashboard/dashboard.service.ts` — single SQL with a slim SELECT and a correlated `solving_pr` subselect filtered to merged PRs
  • `packages/das/src/api/api.module.ts` — registers controller and service

The `MinersController` / `MinersService` and their endpoints are unchanged.

Test plan

  • `npm run build` and `npm run lint` pass
  • `curl -s "$BASE/api/v1/dashboard/issues?since=2025-12-01T00:00:00Z" | jq '.issues | length'` returns a number
  • First row has all fields: `repo_full_name`, `issue_number`, `author_github_id`, `created_at`, `closed_at`, `state`, `state_reason`, `solving_pr`
  • Spot-check a known resolved issue: row shows `state=CLOSED`, `state_reason=COMPLETED`, `solving_pr.merged_at` non-null
  • Spot-check a known open issue: row shows `state=OPEN`, `solving_pr=null`
  • `?since=` omitted returns 400 with the validation message
  • Existing `GET /api/v1/miners//issues` still returns the full scoring shape (regression check)

Out of scope

  • A `bucket=hour` variant for the dashboard's 1D range (3-hour buckets) — current shape supports day-and-larger client-side bucketing only. If needed, can be added without changing the response envelope.
  • Filtering at the mirror level (`?author_ids=…`) — intentionally omitted to keep the mirror roster-blind.

New DashboardModule exposing GET /api/v1/dashboard/issues?since= for the
gittensor-ui dashboard's trend chart and Issues Solved KPI. Returns slim
issue rows (one bulk call) so the UI no longer fans out N parallel
/miners/<id>/issues requests on every dashboard mount.

The mirror is roster-blind by design: every issue is returned regardless
of author. The UI blends with the gittensor miner roster client-side to
filter to subnet authors. Validator-facing /miners/<id>/issues is
unchanged.
@entrius entrius merged commit dd7ee4c into test May 14, 2026
2 checks passed
@entrius entrius deleted the feat/dashboard-module branch May 14, 2026 02:26
@anderdc anderdc mentioned this pull request May 14, 2026
4 tasks
anderdc added a commit that referenced this pull request May 14, 2026
#93)

* feat(dashboard): add slim issues endpoint to replace per-miner fan-out

New DashboardModule exposing GET /api/v1/dashboard/issues?since= for the
gittensor-ui dashboard's trend chart and Issues Solved KPI. Returns slim
issue rows (one bulk call) so the UI no longer fans out N parallel
/miners/<id>/issues requests on every dashboard mount.

The mirror is roster-blind by design: every issue is returned regardless
of author. The UI blends with the gittensor miner roster client-side to
filter to subnet authors. Validator-facing /miners/<id>/issues is
unchanged.

* style(api.module): prettier formatting

---------

Co-authored-by: anderdc <me@alexanderdc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants