Finding
Two public HTTP handlers in pkg/api had 0% test coverage, and two pure helpers had untested branches:
HandleRepoIndex (pkg/api/index.go) — GET /api/repos/{org}/{repo}/index, the public chart payload. Unknown-repo 404, symbol assignment, points/bars shape, and the smoothed current/delta values were all unpinned.
HandleRepoQR (pkg/api/qr.go) — GET /api/repos/{org}/{repo}/qr.png. The 404 path, PNG content-type/cache headers, and the ContributeURL-vs-default target selection were untested (this QR gets printed on physical media, so the encoded target matters).
round1 (pkg/api/index.go) — negative-value branch (66.7%).
ideaCoverage.covers (pkg/api/index.go) — nil-receiver, exhausted-total, post-fetchedAt, and date-range fallback branches (60%).
These are disjoint from the intake (#145) and match-engine (#147) coverage PRs.
Recommendation
Add handler tests using the existing newAPIFixture/withFixedNow harness, calling the handlers directly with Request.SetPathValue (they are mounted in pkg/server, not API.Register), plus table tests for round1 and covers.
Priority
- Impact: medium (public endpoints, deterministic chart math)
- Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88
Finding
Two public HTTP handlers in
pkg/apihad 0% test coverage, and two pure helpers had untested branches:HandleRepoIndex(pkg/api/index.go) —GET /api/repos/{org}/{repo}/index, the public chart payload. Unknown-repo 404, symbol assignment, points/bars shape, and the smoothed current/delta values were all unpinned.HandleRepoQR(pkg/api/qr.go) —GET /api/repos/{org}/{repo}/qr.png. The 404 path, PNG content-type/cache headers, and the ContributeURL-vs-default target selection were untested (this QR gets printed on physical media, so the encoded target matters).round1(pkg/api/index.go) — negative-value branch (66.7%).ideaCoverage.covers(pkg/api/index.go) — nil-receiver, exhausted-total, post-fetchedAt, and date-range fallback branches (60%).These are disjoint from the intake (#145) and match-engine (#147) coverage PRs.
Recommendation
Add handler tests using the existing
newAPIFixture/withFixedNowharness, calling the handlers directly withRequest.SetPathValue(they are mounted in pkg/server, notAPI.Register), plus table tests forround1andcovers.Priority
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknown— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88