refactor: shrink checklist lazycache to a loadState helper without wrapper types - #265
Conversation
…ecklist-lazycache
Address review: the generic lazyCache plus seven one-off index structs cost more than the duplication it removed (+24 production lines). The maps stay as direct runner fields like before; only the load-once bookkeeping is factored into a 12-line loadState (done+err) whose do() memoizes success and failure alike. Net production diff vs main is now -8 lines with zero new types beyond loadState. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFhLrnpVxivu62cC3k9NZB
|
Warning Review limit reached
Next review available in: 25 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 |
There was a problem hiding this comment.
This refactoring successfully simplifies the caching mechanism by replacing the generic lazyCache[T] and wrapper types with a straightforward loadState helper and direct map fields. The load-once semantics are preserved, test coverage confirms correct memoization behavior for both success and failure paths, and all resource-loading functions have been properly migrated to the new pattern. The changes reduce code complexity (-38 lines) while maintaining functional equivalence.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Follow-up to #261: the review fix was accidentally left out of the merge (the branch update failed to push before the merge went through). This lands the intended change — drops the generic
lazyCache[T]and all seven index wrapper types, keeps the per-resource maps as direct runner fields, and factors only the load-once bookkeeping into a 12-lineloadState(done+err) whosedo()memoizes success and failure alike. Net -38 production lines vs current main, zero new types beyondloadState.go test ./...passes.