refactor: extract per-resource collectors from ListReachabilityTargets - #249
Conversation
Split the 240-line ListReachabilityTargets into nine per-resource collector methods (EC2 instances, ENIs, IGWs, VPC endpoints, VPC peering, transit gateways and attachments, VPN gateways, endpoint services). The public function is now a ~35-line fan-out over the collector list plus the existing sort; mapping logic per resource type is unchanged and each collector is now a unit-testable seam. Closes DevopsArtFactory#202 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: 7 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 (1)
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 #262 from an in-repo branch under the maintainer account; this PR is superseded. |
Summary
Implements #202:
ListReachabilityTargetsfetched 8 resource types across 240 lines of inline mapping.collectEC2InstanceTargets,collectENITargets,collectIGWTargets,collectVPCEndpointTargets,collectVPCPeeringTargets,collectTransitGatewayTargets,collectTransitGatewayAttachmentTargets,collectVPNGatewayTargets,collectVPCEndpointServiceTargets).ListReachabilityTargetsis now a ~35-line coordinator: iterate the collector list, append, sort — adding a new target type is one collector plus one list entry.Testing
go test ./...passes, including the existingTestListReachabilityTargets_Successcovering the merged output.make buildpasses.Closes #202