Set SchedulerHints in failover request and removed incorrect prefix#626
Set SchedulerHints in failover request and removed incorrect prefix#626
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughScheduling requests now send the raw VM UUID (no "failover-" prefix) and include a scheduler hint Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ 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 |
| // _nova_check_type hint. Consider adding a dedicated intent during pipeline refactoring. | ||
| scheduleReq := reservations.ScheduleReservationRequest{ | ||
| InstanceUUID: "failover-" + vm.UUID, | ||
| InstanceUUID: vm.UUID, |
There was a problem hiding this comment.
Is this change intentional? Seems unrelated
There was a problem hiding this comment.
yes but commit msg misleading changed
| IgnoreHosts: ignoreHypervisors, | ||
| Pipeline: pipeline, | ||
| AvailabilityZone: vm.AvailabilityZone, | ||
| SchedulerHints: map[string]any{"_nova_check_type": "create"}, |
There was a problem hiding this comment.
Can we use the CreateIntent const here? Or does that result in weird import cycles
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/scheduling/reservations/failover/reservation_scheduling.go (1)
94-94: Optional: extract scheduler-hint key/value literals into constants.
"_nova_check_type"and intent strings are now repeated in multiple places in this file; centralizing them would reduce typo risk during future pipeline refactors.♻️ Suggested refactor
const ( @@ PipelineAcknowledgeFailoverReservation = "kvm-acknowledge-failover-reservation" + + SchedulerHintNovaCheckType = "_nova_check_type" + SchedulerIntentCreate = "create" + SchedulerIntentEvacuate = "evacuate" ) @@ - SchedulerHints: map[string]any{"_nova_check_type": "create"}, + SchedulerHints: map[string]any{SchedulerHintNovaCheckType: SchedulerIntentCreate}, @@ - SchedulerHints: map[string]any{"_nova_check_type": "evacuate"}, + SchedulerHints: map[string]any{SchedulerHintNovaCheckType: SchedulerIntentEvacuate}, }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/scheduling/reservations/failover/reservation_scheduling.go` at line 94, The scheduler-hint key "_nova_check_type" and its intent strings like "create" are duplicated in reservation_scheduling.go; define constants (e.g., const novaCheckTypeKey = "_nova_check_type" and const novaCheckCreate = "create") at the top of the file and replace the literal occurrences in SchedulerHints and any other usages (search for "_nova_check_type" and "create" intents) with those constants to centralize the values and avoid typos.
🤖 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/reservations/failover/reservation_scheduling.go`:
- Line 94: The scheduler-hint key "_nova_check_type" and its intent strings like
"create" are duplicated in reservation_scheduling.go; define constants (e.g.,
const novaCheckTypeKey = "_nova_check_type" and const novaCheckCreate =
"create") at the top of the file and replace the literal occurrences in
SchedulerHints and any other usages (search for "_nova_check_type" and "create"
intents) with those constants to centralize the values and avoid typos.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6c09a5f3-7a14-4e84-9fb7-bf2516fde1a9
📒 Files selected for processing (1)
internal/scheduling/reservations/failover/reservation_scheduling.go
PhilippMatthes
left a comment
There was a problem hiding this comment.
Nice, thanks for incorporating my feedback!
Test Coverage ReportTest Coverage 📊: 68.6% |
No description provided.