Skip to content

refactor: extract per-resource collectors from ListReachabilityTargets - #262

Merged
YoungJinJung merged 1 commit into
mainfrom
refactor/issue-202-reachability-collectors
Aug 14, 2026
Merged

refactor: extract per-resource collectors from ListReachabilityTargets#262
YoungJinJung merged 1 commit into
mainfrom
refactor/issue-202-reachability-collectors

Conversation

@YoungJinJung

Copy link
Copy Markdown
Contributor

Summary

Implements #202: ListReachabilityTargets fetched 8 resource types across 240 lines of inline mapping.

  • Nine collector methods extracted (collectEC2InstanceTargets, collectENITargets, collectIGWTargets, collectVPCEndpointTargets, collectVPCPeeringTargets, collectTransitGatewayTargets, collectTransitGatewayAttachmentTargets, collectVPNGatewayTargets, collectVPCEndpointServiceTargets).
  • ListReachabilityTargets is now a ~35-line coordinator: iterate the collector list, append, sort — adding a new target type is one collector plus one list entry.
  • Field mapping, naming fallbacks, pagination, error wrapping, and result ordering are byte-for-byte unchanged.

Testing

  • go test ./... passes, including the existing TestListReachabilityTargets_Success covering the merged output.
  • make build passes.

Closes #202

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 #202

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFhLrnpVxivu62cC3k9NZB
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@YoungJinJung, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 25747551-32d5-4fe9-9dd6-af9db85ef375

📥 Commits

Reviewing files that changed from the base of the PR and between 744b139 and 140333d.

📒 Files selected for processing (1)
  • internal/services/aws/vpc.go

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clean refactoring that successfully extracts resource collectors from ListReachabilityTargets into separate methods. The code maintains the same behavior while significantly improving maintainability and extensibility. No blocking issues identified.


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.

@YoungJinJung YoungJinJung left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

냉정 리뷰 완료. 각 collector가 기존 호출 순서·오류 중단·최종 정렬을 보존하는지 대조했고 동작 변경이나 불필요한 새 계층은 찾지 못했습니다. Lean already. Ship.

@YoungJinJung
YoungJinJung merged commit e74959a into main Aug 14, 2026
5 checks passed
@YoungJinJung
YoungJinJung deleted the refactor/issue-202-reachability-collectors branch August 14, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: extract per-resource collectors from ListReachabilityTargets

1 participant