Wire BackendReplicas through to StatefulSet replica count#4291
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7687de321
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Threads an optional backend replica count from runner configuration through the runtime deployment pipeline into the Kubernetes StatefulSet server-side apply configuration, allowing explicit replica setting when configured while preserving external scaling control when unset.
Changes:
- Extend
runtime.SetupandDeployWorkloadOptionsto carryBackendReplicas *int32. - Pass configured backend replica count from the runner into runtime setup.
- Update the Kubernetes client to only apply
StatefulSetSpec.replicaswhenBackendReplicasis non-nil, and add unit tests for replica behaviors.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/runtime/setup.go | Adds backendReplicas parameter and wires it into deploy options. |
| pkg/runner/runner.go | Reads backend replicas from config and passes into runtime.Setup. |
| pkg/container/runtime/types.go | Adds BackendReplicas *int32 to DeployWorkloadOptions. |
| pkg/container/kubernetes/client.go | Conditionally applies StatefulSet replicas only when explicitly configured. |
| pkg/container/kubernetes/client_test.go | Adds tests intended to cover nil vs explicit replica behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4291 +/- ##
==========================================
- Coverage 68.85% 68.68% -0.17%
==========================================
Files 473 473
Lines 47899 47965 +66
==========================================
- Hits 32979 32943 -36
- Misses 12279 12317 +38
- Partials 2641 2705 +64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…nt (RC-11) Threads RunConfig.BackendReplicas (*int32) from the runner through runtime.Setup and DeployWorkloadOptions to the Kubernetes StatefulSet apply configuration. When BackendReplicas is nil the replicas field is omitted from the server-side apply spec, preserving HPA/kubectl control; when set, the specified count is applied. Closes #4209
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Threads RunConfig.BackendReplicas (*int32) from the runner through runtime.Setup and DeployWorkloadOptions to the Kubernetes StatefulSet apply configuration. When BackendReplicas is nil the replicas field is omitted from the server-side apply spec, preserving HPA/kubectl control; when set, the specified count is applied.
Fixes #4209
Type of change
Test plan
task test)task test-e2e)task lint-fix)Changes
Does this introduce a user-facing change?
Special notes for reviewers