Extract registerWithManager for testability#331
Conversation
Split SetupWithManager into two methods for controllers with OpenStack dependencies: registerWithManager handles only the controller-runtime registration, while SetupWithManager acquires OpenStack clients first then delegates to registerWithManager. This allows integration tests to inject fake OpenStack clients and call registerWithManager directly. onboarding_controller is handled in a separate commit because it has more moving parts (additional helpers, requeueInterval).
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFive controllers (Aggregates, Eviction, HypervisorMaintenance, Offboarding, Traits) had their manager registration logic extracted into new ChangesController registration helper extraction
Onboarding controller updates
Estimated code review effort: 2 (Simple) | ~15 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
…e interval Extract registerWithManager from SetupWithManager and add a configurable requeueInterval field (defaults to 1m via getRequeueInterval). Integration tests set requeueInterval to 1s, reducing test runtime from minutes to seconds.
8569ee9 to
e43ceab
Compare
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
Split SetupWithManager into two methods for controllers with OpenStack dependencies:
registerWithManagerhandles only the controller-runtime registrationSetupWithManageracquires OpenStack clients, then delegates toregisterWithManagerThis allows integration tests to inject fake OpenStack clients and call
registerWithManagerdirectly, without needing real OpenStack credentials or cloud config.Also adds a configurable
requeueIntervaltoOnboardingController(defaults to 1m), so integration tests can use a shorter polling interval.No behaviour change — purely structural refactoring for testability.
Summary by CodeRabbit
New Features
Bug Fixes