Repository navigation
refactor(api): delete the never-constructed HistorySummaryAnalytics type - #1458
Conversation
HistorySummaryAnalytics declared total_period_savings, average_savings_per_period and peak_savings, but nothing ever built it: GET /history/analytics returns *HistorySummary. The frontend stopped reading those keys in an earlier LeanerCloud#276 change, so the type is dead and only suggested a wire contract that never existed. The OpenAPI AnalyticsResponse.summary already references HistorySummary, so the spec needs no change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25. Or wait 59 minutes for your next included review. View limit details
Comment |
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): VERDICT: APPROVE Blocking:
Non-blocking:
Attacked:
Body-stale: none Reviewer: rD3. Bar while the maintainers are away (set by IAmJSD as acting owner): one approving independent review on the head, two for money, auth and security paths. |
|
Local verification at |
|
Merged by IAmJSD's agent at IAmJSD's request (IAmJSD is acting owner while the maintainers are away), under the bar IAmJSD set: 1 approving independent review(s) on |
Closes #276
Why
HistorySummaryAnalytics(internal/api/types.go) declaredtotal_period_savings,average_savings_per_periodandpeak_savings, but nothing ever built it.GET /api/history/analyticsreturnsSummary *HistorySummary. The frontend half of #276 already movedSavingsAnalyticsSummarytoHistorySummary's real keys and stopped reading the phantom ones. The dead Go type was the last piece, and it still suggested a wire contract that never existed.What
internal/api/types.go: deletesHistorySummaryAnalytics. Nothing referenced it.internal/api/openapi.yaml.AnalyticsResponse.summaryalready$refs#/components/schemas/HistorySummary, whose properties match the GoHistorySummaryJSON tags. No schema mentionstotal_period_savings,average_savings_per_periodorpeak_savings.Verification
go buildandgo vetacross all build tags show nothing referenced it.grep -rn HistorySummaryAnalyticsnow finds only the audit report indocs/audits/.go build ./... && go vet ./... && go vet -tags integration ./... && (cd tests/e2e && go vet -tags e2e ./...): pass.golangci-lintv2.10.1 on./internal/api/..., with and without--build-tags integration: 0 issues.gocyclo -over 10 internal/api/types.go: nothing reported.go test -race -short -count=1 ./internal/api/: ok.go test -race -tags integration -count=1 ./internal/api/: ok (the full package passed in one run, 898s).scripts/test-git-secrets-allowlist.sh: 183 PASS, 0 FAIL.frontend/src/__tests__/savings-history.test.ts:178(the fix(frontend): dashboard charts have no text alternative and layers differ only by shade #744 chart-summary test) still mocks the response with the old summary keys. That test only checks the chart table, so it is harmless, and I left it alone because this PR is backend only.🤖 Generated with Claude Code