Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/url"
"strconv"
"sync"
"time"

"github.com/actions/actions-runner-controller/apis/actions.github.com/v1alpha1/appconfig"
"github.com/actions/actions-runner-controller/build"
Expand Down Expand Up @@ -135,7 +136,10 @@ func (o *ClientForOptions) newClient() (*scaleset.Client, error) {
Subsystem: "gha-scale-set-controller",
}

var options []scaleset.HTTPOption
options := []scaleset.HTTPOption{
scaleset.WithTimeout(30 * time.Second),
scaleset.WithRetryMax(2),
}
Comment on lines +139 to +142
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The timeout (30s) and retry max (2) are hard-coded here, which makes this operationally hard to tune across environments (e.g., GitHub Enterprise with higher latency vs. public GitHub) and turns a runtime behavior change into an implicit policy. Consider wiring these values from controller configuration/flags (similar to other tuning flags in main.go) and/or at least defining them as named constants with a brief rationale so operators can adjust without code changes.

Copilot uses AI. Check for mistakes.
if o.RootCAs != nil {
options = append(options, scaleset.WithRootCAs(o.RootCAs))
}
Expand Down