refactor: replace checklistRunner cache triples with a generic lazycache - #248
Conversation
Replace the seven repeated loaded/err/data field triples in checklistRunner with a generic lazyCache[T] that memoizes a single fetch (value and error) plus small per-resource index structs. Lookup behavior is unchanged; the runner struct drops from 21 cache fields to 7 typed caches, and new checklist resource types no longer need to hand-roll the load-once pattern. Closes DevopsArtFactory#204 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: 9 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 |
|
Recreated as #261 from an in-repo branch under the maintainer account; this PR is superseded. |
Summary
Implements #204:
checklistRunnerrepeated the samexLoaded bool / xErr error / xBy... mappattern seven times (RDS, hosted zones, VPCs, subnets, log groups, security groups, secrets).lazyCache[T]memoizes a single fetch — firstGetruns the fetch once, laterGets return the same value and error without refetching (including memoized failures, matching the old behavior).vpcIndex,subnetIndex, …) built inside the fetch closure.secretDetailsandzoneRecordsstay as plain per-key maps — they are keyed caches, not load-once lists.Testing
go test ./...passes; existing checklist tests cover the resolution behavior, and a new test pins the lazyCache contract (fetch-once, memoized value, memoized error, no retry).make buildpasses.Closes #204