Repository navigation
chore: align MonthlySummary docs with the API and warn when ladder configs hit the list cap - #1575
Conversation
- analytics.MonthlySummary: TotalCommitment is the upfront cost
amortized per month and TotalUsage the recurring monthly fees;
committed spend is their sum, matching the openapi descriptions.
- ladder_run: GetLadderConfigs is capped at MaxListLimit, so log a
warning ("ladder configs may be truncated") when a run reads exactly
the cap, and stop describing the read as all rows (handler and
ConfigStore interface comments).
Refs LeanerCloud#30
Refs LeanerCloud#120
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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:
Reviewer: rJ1. 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 |
Why
Two review follow-ups:
analytics.MonthlySummary.TotalCommitment/TotalUsagedescribed them as "committed spend and covered usage". The openapitotal_commitment/total_usagedescriptions say something different: upfront cost amortized per month, and recurring monthly fees, with committed spend as their sum (feat(frontend): Trends view consuming GET /api/analytics/trends #30).GetLadderConfigsis now capped atconfig.MaxListLimit(1000) (chore(config/db): medium/low findings from the 2026-07-28 full review #120). The scheduled ladder run still had a comment saying it reads all rows. If a run reads exactly the cap, the older configs past the cap are not run, and nothing logged that.What
internal/analytics/interfaces.go: theMonthlySummarycomment now saysTotalCommitmentis the upfront cost amortized per month,TotalUsageis the recurring monthly fees, and committed spend is their sum. The existing notes on run-rate averaging and nil-means-unknown are kept.internal/server/handler_ladder.go:handleLadderRunlogs a warning (ladder configs may be truncated) whenGetLadderConfigsreturnsconfig.MaxListLimitrows or more. The comment now says the read is capped atMaxListLimit, newest first.internal/config/interfaces.go: theConfigStore.GetLadderConfigscomment says the same thing.internal/server/handler_ladder_test.go:TestHandleLadderRun_WarnsWhenConfigsHitListCapuses a store fake. When it returns exactlyMaxListLimitconfigs the run must warn; with one fewer it must not.The
GETladder-config listing ininternal/api/handler_ladder.goreads the same capped list. It is unchanged here.Verification
Linux, Go from
~/.local/go,AWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/null AWS_EC2_METADATA_DISABLED=true, on headb358cf41(origin/main76180820plus one commit):internal/server/handler_ladder.gofrom origin/main, theat the capsubtest fails (expected: true, actual: false). It passes with this change. Theunder the capsubtest passes on both.go build ./...passed.go vetpassed oninternal/server,internal/analyticsandinternal/config, with and without-tags integration.go test -count=1passed on the same three packages.gocyclo -over 10reports nothing on the changed non-test files.Combined-tree verification. This branch was tested together with the other queued branches on a local, never-pushed tree:
queue/platform@6144e322= origin/mainf50f1d3eplus these heads, merged in this order:Linux, Go 1.26.9,
AWS_CONFIG_FILE=/dev/null AWS_SHARED_CREDENTIALS_FILE=/dev/null AWS_EC2_METADATA_DISABLED=true; Docker Postgres via testcontainers.go build ./...,go vet ./...,go vet -tags integration ./...and the fullgo test -race -short -count=1 ./....--build-tags integration.gocyclo -over 10is silent on the changed non-test files.-tags integration -count=1):internal/analytics,internal/auth,internal/configandinternal/serverall pass.scripts/test-git-secrets-allowlist.shpasses.terraform fmt -checkandvalidate(init-backend=false) on the touched modules;.tftest.hclfiles run in CI. Nothing was applied to any cloud.Refs #30
Refs #120
🤖 Generated with Claude Code