Add toggle for nova input host safety measure#616
Conversation
📝 WalkthroughWalkthroughThis PR introduces a config-driven feature flag for Nova scheduler's host filtering behavior. It adds an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Test Coverage ReportTest Coverage 📊: 68.0% |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/scheduling/nova/external_scheduler_api_test.go (1)
279-279: Consider adding a test case forNovaLimitHostsToRequest=true.The HTTP handler tests use
HTTPAPIConfig{}(zero value), which meansNovaLimitHostsToRequestdefaults tofalseand the filtering path is not exercised in integration. WhileTestLimitHostsToRequestthoroughly tests the filtering function itself, adding a test case withNovaLimitHostsToRequest: truewould verify the conditional integration inNovaExternalScheduler.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/scheduling/nova/external_scheduler_api_test.go` at line 279, Add an integration test that constructs the HTTP API with NovaLimitHostsToRequest enabled and exercises the handler path that triggers the host-filtering logic: create an API instance using NewAPI(HTTPAPIConfig{NovaLimitHostsToRequest: true}, delegate) (cast to *httpAPI) and send the same request used in existing handler tests, then assert that the response reflects the filtered host list; this will verify the conditional branch in NovaExternalScheduler integrates with the LimitHostsToRequest behavior already covered by TestLimitHostsToRequest.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/scheduling/nova/external_scheduler_api_test.go`:
- Line 279: Add an integration test that constructs the HTTP API with
NovaLimitHostsToRequest enabled and exercises the handler path that triggers the
host-filtering logic: create an API instance using
NewAPI(HTTPAPIConfig{NovaLimitHostsToRequest: true}, delegate) (cast to
*httpAPI) and send the same request used in existing handler tests, then assert
that the response reflects the filtered host list; this will verify the
conditional branch in NovaExternalScheduler integrates with the
LimitHostsToRequest behavior already covered by TestLimitHostsToRequest.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9b8e8d65-d47f-475e-9063-ed2338779a6c
📒 Files selected for processing (4)
cmd/main.gohelm/bundles/cortex-nova/values.yamlinternal/scheduling/nova/external_scheduler_api.gointernal/scheduling/nova/external_scheduler_api_test.go
With this change we can now toggle the
limitHostsToRequestfunctionality inside the external scheduler api for nova. This is needed because we will completely ignore nova's input soon, and nova will handle keyerrors for unknown proposed hosts appropriately. Thus, before we will completely remove this safety measure from the code, we add this toggle to turn it off.