Skip to content

feat: add scale replicas button for Deployments and StatefulSets - #90

Merged
nadaverell merged 1 commit into
mainfrom
nadaverell/scale-replicas
Feb 6, 2026
Merged

nadaverell merged 1 commit into
mainfrom
nadaverell/scale-replicas

Conversation

@nadaverell

@nadaverell nadaverell commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds the ability to scale Deployments and StatefulSets directly from the resource drawer
  • Includes a modal dialog with +/- buttons and direct input for setting the desired replica count
  • Uses PATCH operation for efficient scaling without full resource replacement

Changes

  • internal/k8s/update.go: Add ScaleWorkload function using dynamic client PATCH
  • internal/server/server.go: Add POST /api/workloads/{kind}/{ns}/{name}/scale endpoint
  • web/src/api/client.ts: Add useScaleWorkload React Query mutation hook
  • web/src/components/resources/renderers/WorkloadRenderer.tsx: Add Scale button and modal dialog

Test plan

  • Open a Deployment in the resource drawer
  • Click the "Scale" button next to "View Managed Pods"
  • Use +/- buttons or direct input to change replica count
  • Click "Apply" and verify the workload scales
  • Verify button is disabled when replica count hasn't changed
  • Verify StatefulSets also have the Scale button
  • Verify DaemonSets do NOT have the Scale button (not scalable)

@nadaverell
nadaverell requested a review from hisco as a code owner February 6, 2026 12:53
@nadaverell
nadaverell force-pushed the nadaverell/scale-replicas branch 2 times, most recently from 9de4388 to e4fbe5b Compare February 6, 2026 13:41
Adds the ability to scale Deployments and StatefulSets directly from the
resource drawer. Includes a modal dialog with +/- buttons and direct input
for setting the desired replica count.

- Add ScaleWorkload function in k8s/update.go using PATCH
- Add POST /api/workloads/{kind}/{ns}/{name}/scale endpoint
- Add useScaleWorkload React Query mutation hook
- Add Scale button and modal in WorkloadRenderer

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@nadaverell
nadaverell force-pushed the nadaverell/scale-replicas branch from e4fbe5b to 7d35e03 Compare February 6, 2026 13:47
@nadaverell
nadaverell merged commit 2ef2625 into main Feb 6, 2026
5 checks passed
nadaverell added a commit that referenced this pull request Oct 18, 2026
Replace five independently green Dependabot PRs with one reviewed,
tested dependency update. No application source, public interfaces,
workflow files, tags, or published artifacts change.

Screening: **2026-10-18 09:27:22 UTC**. Exact 72-hour cutoff:
**2026-10-15 09:27:22 UTC**. Ages below use that fixed screening
instant, not PR creation time. Every changed resolved package is older
than the cutoff. Base: `e47b1ee491cf8418e04ffc7d60a43e44171d39ee`
(`origin/main`), fetched and reconciled again before QA; all ten
original bot heads were unchanged.

## Included

| PR | Dependency | Old → new | Upstream publication (UTC) | Age | Risk
/ verification |
|---|---|---|---|---|---|
| #2122 |
[@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/releases/tag/plugin-react%406.1.2)
| 6.1.1 → 6.1.2 | 2026-10-05T10:08:27.143Z | 311.32 h | Default react()
integration; optional compiler path unused. HMR fixes; build/type checks
and browser journeys. |
| #2119 |
[prettier](https://github.com/prettier/prettier/releases/tag/3.9.10) |
3.9.9 → 3.9.10 | 2026-10-10T08:35:28.472Z | 192.86 h | Bundled Markdown
parser performance fix; Prettier also powers Monaco YAML formatting.
TS/TSX and standalone YAML before/after output parity verified. |
| #2118 |
[github.com/prometheus/common](https://github.com/prometheus/common/releases/tag/v0.72.1)
| v0.72.0 → v0.72.1 | 2026-10-11T08:43:15Z | 168.74 h | Header clone
correction is in config/, outside Radar runtime usage. Radar tests and
upstream model/expfmt/config tests passed. |
| #2116 |
[golang.org/x/text](golang/text@v0.42.0...v0.43.0)
| v0.42.0 → v0.43.0 | 2026-10-09T15:18:32Z | 210.15 h | Bidi complexity
fix and lazy ASCII initialization; currency/bidi tests and Radar suites.
|
| #2115 |
[golang.org/x/sys](golang/sys@v0.48.0...v0.49.0)
| v0.48.0 → v0.49.0 | 2026-10-06T18:35:47Z | 278.86 h | Platform/syscall
updates; all five release-platform builds plus native tests. |

## Resolved graph audit

Only two npm packages change (`@vitejs/plugin-react`, `prettier`); no
npm transitive changes, additions, or removals. The plugin's optional
`oxc-transform-react` peer minimum rises to `^0.152.0`; Radar uses
`react()` without the compiler option and does not install that peer.
React, React DOM, React Flow, PostCSS, Vite, and Tailwind remain locked
at the baseline.

Prometheus common requires `x/net v0.61.0`, which raises
crypto/sys/term/text. Text also raises sync/tools. These are native Go
minimal-version-selection requirements, not a broad refresh. All eight
Go module movements are accounted for: common/sys/text above, and the
five additional entries below. No modules are added or removed;
`pkg/go.mod` and `pkg/go.sum` remain unchanged. The root module resolves
its shared-library imports under the new graph; the independently
distributed shared module keeps its existing minimums.

| Additional resolved movement | Publication (UTC) | Age | Review
conclusion |
|---|---|---|---|
| [golang.org/x/net v0.60.0 →
v0.61.0](golang/net@v0.60.0...v0.61.0) |
2026-10-09T17:07:24Z | 208.33 h | QUIC frame validation plus dependency
updates; Radar uses HTTP2, proxy and IDNA, not QUIC. |
| [golang.org/x/crypto v0.57.0 →
v0.58.0](golang/crypto@v0.57.0...v0.58.0) |
2026-10-09T16:24:17Z | 209.05 h | SSH/ACME and LoongArch SIMD changes;
Radar does not import SSH/ACME; release platforms are amd64/arm64.
Existing crypto-dependent auth/storage tests cover used paths. |
| [golang.org/x/term v0.46.0 →
v0.47.0](golang/term@v0.46.0...v0.47.0) |
2026-10-09T15:22:17Z | 210.08 h | Dependency-only update; no term source
changes. |
| [golang.org/x/sync v0.23.0 →
v0.24.0](golang/sync@v0.23.0...v0.24.0) |
2026-09-23T16:28:17Z | 592.98 h | Only errgroup test examples changed;
singleflight/errgroup implementation is identical. |
| [golang.org/x/tools v0.50.0 →
v0.51.0](golang/tools@v0.50.0...v0.51.0) |
2026-10-02T18:49:45Z | 374.63 h | Tooling changes, not in Radar runtime
dependency closure; pulled by text module requirements. |

Release notes and complete upstream compare ranges were inspected for
every included direct update. Go subrepositories without release notes
were reviewed via their complete commit/file ranges. Exact npm times
come from registry version/time metadata; Go times come from
`proxy.golang.org/<module>/@v/<version>.info`. No deprecation/retraction
or relevant target-version issue was found for the included set. The npm
lockfile and `go list -m -json all` were compared against the base, not
just the PR titles.

## Left open

- **#2121 — PostCSS 8.5.29:** [upstream
#2168](postcss/postcss#2168) documents a
source-map regression introduced in this target (`generated.column: -1`
when HTML escaping triggers). The issue is closed, but the target
artifact still contains the described implementation. Hold for a fixed
release / specific regression verification; this batch preserves 8.5.28.
[Release/compare](postcss/postcss@8.5.28...8.5.29).
- **#2120 — React Flow 12.12.0:** reviewed every 12.11.3–12.12.0
changelog entry and companion system 0.0.79–0.0.83. Radar uses it across
topology, GitOps trees, and traffic. The local GitOps demo context
points to an unavailable API server (`127.0.0.1:53287`, connection
refused), so meaningful graph interaction/rendering verification was
unavailable. Hold rather than approve with type checks alone. Reports
[#6044](xyflow/xyflow#6044) and
[#6063](xyflow/xyflow#6063) predate this bump
and are not claimed as new regressions; the portal-window case in
[#6053](xyflow/xyflow#6053) is not Radar's
current usage. [Full
range](https://github.com/xyflow/xyflow/compare/@xyflow/[email protected]...@xyflow/[email protected]).
- **#2117 — godbus 5.2.3:** targeted package compilation failed on
darwin/arm64:
[`conn_darwin.go:29`](https://github.com/godbus/dbus/blob/v5.2.3/conn_darwin.go#L29)
returns one value from a `(string, error)` function. Radar imports
godbus only for Linux desktop theme detection, so this is an upstream
release defect, not a claimed macOS Radar build break. Excluded under
the safe-batch gate; keeps 5.2.2. [Full
range](godbus/dbus@v5.2.2...v5.2.3).
- **#1939 — Helmfile action 2.4.8:** original [Helm chart
check](https://github.com/skyhook-io/radar/actions/runs/38315972386/job/115032561328)
installs Helm 4.2.3 despite the Helm 3 pin, then fails because two
plugins claim `unittest`. The complete 2.2.0–2.4.8 release history
includes changed Helm plugin installation and a Node 24 runtime. This
needs a separate workflow compatibility fix; no CI/release configuration
is changed here. [Full
range](helmfile/helmfile-action@v2.2.0...v2.4.8).

**Already landed:** #1776 targets MCP SDK 1.8.0, already adopted with
source compatibility work in
[#2181](#2181), commit
`05d99d5a7`. It was closed as stale, not included again.

## Verification

- `make tsc` and `npm run tsc --workspace packages/k8s-ui`: passed.
- `npm run test --workspaces --if-present`: web 268 files / 2,723 tests
passed; k8s-ui 296 files / 5,001 tests passed, one existing skip.
- `make build`: passed (frontend → embed → binary).
- `make test`: passed with `GOMAXPROCS=4 GOFLAGS=-p=1`.
PostgreSQL-backed tests enabled against an isolated local PostgreSQL 16
container; CI uses PostgreSQL 17. Initial concurrent run hit the
five-second `TestGetShellEnv/bash` and `TestCursorForceGrantEndToEnd`
subprocess deadlines; both passed serial reruns (1.382s and 0.613s),
then the full suite passed. Existing environment/platform skips remain,
including optional PromQL/VictoriaMetrics fixtures; PostgreSQL tests
were enabled.
- Upstream Prometheus `config`, `expfmt`, `model`, and `x/text`
currency/bidirule/bidi tests: passed. `config` used a temporary modfile
for its upstream test-only dependencies; Radar manifests were not
expanded.
- Full `cmd/explorer` builds passed for all five release targets:
darwin/arm64, darwin/amd64, linux/amd64, linux/arm64, and windows/amd64
(`CGO_ENABLED=0`). Linux/amd64 `internal/version` test compilation and
Windows/amd64 `internal/ai` and `internal/server` builds also passed.
- Default React Refresh regression check: four cases passed (compound
member and module export addition/removal).
- Prettier 3.9.9 vs 3.9.10: identical output across all 1,576 tracked
TS/TSX source files; no source rewrites.
- Standalone Prettier runtime with YAML/estree plugins: five Kubernetes
YAML cases produced identical output at Radar’s print width; both plugin
artifacts are byte-identical.
- Settings Chromium browser journeys: 140 passed.
- `go mod verify`: passed. No retractions reported for the eight exact
Go targets. `npm ci --ignore-scripts`: passed; `npm ls --all
--package-lock-only` flags only the pre-existing DOMPurify 3.4.17
override against Monaco's 3.4.15 requirement, reproduced with the
untouched base lockfile/manifests. No new integrity problem. Existing
Dependabot alert #90 is for unchanged `postcss-selector-parser 6.0.10`;
neither the included updates nor the held PostCSS-core bump resolves it.
- `git diff --check`: passed; final graph is eight Go modules plus two
npm packages, and only four dependency files changed.
- Frontend checks ran with a checksum-verified official Node 24.22.0
runtime. The host's Node 22/24 aliases point to Node 25.9.0, outside the
existing Vitest engine range.
- Cross-model review: no blocking code findings; completed additional
standalone YAML validation and expanded platform compilation after
skeptical triage.

visual-test: **skipped** — the rendered dependency update was held
because the local demo cluster is unavailable. The included set changes
backend dependencies, dev tooling, and the YAML formatter; standalone
YAML output parity was tested and the YAML/estree parser artifacts are
byte-identical. No live-cluster smoke test is claimed.

Supersedes #2122, #2119, #2118, #2116, #2115. All five originals were
closed after the replacement passed CI and automated review. The four
held updates remain open. This PR remains unmerged and awaits human
approval.

Final checks on `5db4266cd49b6b3656c7dae6e9ec3f6f540485a7`:
[CI](https://github.com/skyhook-io/radar/actions/runs/39116969852)
passed Backend, Backend (internal/server), Frontend, Settings browser
journeys, and k8s-ui. Path filters correctly skipped the unchanged
independent pkg/Helm jobs and the redundant hygiene job. [CodeQL
analysis](https://github.com/skyhook-io/radar/actions/runs/39116969847)
passed. Qodo completed with zero bugs, rule violations, or requirement
gaps; no inline review findings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant