perf(api): derive past usage dates in one pass - #447
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough사용량 타임스탬프에서 과거 UTC 날짜를 도출하는 로직을 내보내기 함수로 추출했다. Changes과거 사용량 날짜 처리
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change consolidates past usage-date derivation while preserving the documented API behavior and adding focused regression coverage; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Closing this PR as a duplicate of the stronger current-base canonical lane #446. After #447 was opened, the live PR sweep showed #446 already preserves the same server-side portion of #399 with a cleaner package boundary: Keeping both would split one API optimization across competing branches. #446 should be the owner; it needs its PR body updated from the initial RED-stage wording, exact-head CI/security/coverage/review, and ready-for-review only after the current implementation is verified. No checks or review evidence from #447 transfers. |
Summary
usagePerTurnpast-date invalidation logic into a documented helper;map → filter → mapallocations;Why this replaces the unique part of #399
PR #399 was stale, non-mergeable, and mixed a bot journal with chart and API optimizations. The chart-side date parsing is now owned by PR #425, which carries a current-base test and the
formatRelativeTimeFromMscontract. This PR preserves only the API-route delta on exact currentdevelopmentalwithout the.julesartifact or chart churn.Issues are disabled in this repository, so the remaining API work could not be preserved as a tracking issue before closing #399.
Behavior contract
The helper preserves existing endpoint semantics:
getUTC*logic;NaNand fail thems < todayMstest, as in the previous callback path.Verification
The PR is test-first in effect for the extracted contract: new focused
derivePastUsageDateIsoStringstests describe the behavior before the production route uses the helper. Hosted CI, central OpenCode coverage evidence, SAST/Semgrep, Security Scan, dependency review, and current-head review must run on this exact head before merge.Merge gate
Merge only after exact-head CI, central OpenCode coverage evidence, SAST/Semgrep, Security Scan, dependency review, current-head review, zero unresolved actionable threads, and all live branch-protection rules pass. No check or review evidence from #399 transfers.
Summary by CodeRabbit
버그 수정
테스트