Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion decisionmaker/domain/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Intent struct {
}

type SchedulingIntents struct {
Priority bool `json:"priority"` // If true, set vtime to minimum vtime
Priority int `json:"priority"` // Priority value; higher value means higher priority
ExecutionTime uint64 `json:"execution_time"` // Time slice for this process in nanoseconds
PID int `json:"pid,omitempty"` // Process ID to apply this strategy to
Selectors []LabelSelector `json:"selectors,omitempty"` // Label selectors to match pods
Expand Down
2 changes: 1 addition & 1 deletion decisionmaker/rest/intent_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (h *Handler) HandleIntents(w http.ResponseWriter, r *http.Request) {

// SchedulingStrategy represents a strategy for process scheduling
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The comment above type SchedulingIntents still refers to a "SchedulingStrategy", but the struct represents an individual scheduling intent returned by the decisionmaker. Please update the comment to match the type/endpoint to avoid confusing API consumers and maintainers.

Suggested change
// SchedulingStrategy represents a strategy for process scheduling
// SchedulingIntents represents a scheduling intent returned by the decisionmaker,
// including process-level parameters and selectors used for process scheduling.

Copilot uses AI. Check for mistakes.
type SchedulingIntents struct {
Priority bool `json:"priority"` // If true, set vtime to minimum vtime
Priority int `json:"priority"` // Priority value; higher value means higher priority
ExecutionTime uint64 `json:"execution_time"` // Time slice for this process in nanoseconds
PID int `json:"pid,omitempty"` // Process ID to apply this strategy to
Selectors []LabelSelector `json:"selectors,omitempty"` // Label selectors to match pods
Expand Down
2 changes: 1 addition & 1 deletion decisionmaker/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (svc *Service) ProcessIntents(ctx context.Context, intents []*domain.Intent
continue
}
schedulingIntent := &domain.SchedulingIntents{
Priority: intent.Priority > 0,
Priority: intent.Priority,
ExecutionTime: uint64(intent.ExecutionTime),
PID: process.PID,
Comment on lines 115 to 118
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

This change fixes the lossy mapping of Intent.Priority into the stored scheduling intent, but there isn’t a focused test that would fail if the value regressed back to a boolean collapse. Consider adding a small unit test around the scheduling-intent representation (e.g., JSON marshal/unmarshal or list response construction) to assert the full integer priority is preserved.

Copilot uses AI. Check for mistakes.
CommandRegex: intent.CommandRegex,
Expand Down