Skip to content

fix(installer): pin k3d + helm versions — drop api.github.com latest lookups (re-land #410 onto develop) - #446

Merged
shujaatTracebloc merged 3 commits into
developfrom
fix/410-pin-k3d-helm-develop
Jul 27, 2026
Merged

fix(installer): pin k3d + helm versions — drop api.github.com latest lookups (re-land #410 onto develop)#446
shujaatTracebloc merged 3 commits into
developfrom
fix/410-pin-k3d-helm-develop

Conversation

@shujaatTracebloc

@shujaatTraceblocshujaatTracebloc commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Re-lands the k3d/helm version pinning from #438, which was merged into its stacked base fix/409-unc-job-cwd instead of develop and never reached the develop line (#437 had already squash-merged, orphaning that branch). This PR replays the exact #410 change directly onto develop.

Ports #382's determinism to Windows: install-k8s.ps1 no longer resolves k3d/helm via the unauthenticated api.github.comreleases/latest endpoint (60 req/hour per IP — a single shared corporate NAT exhausts it; observed failing live on a customer install, 2026-07-27, right after an all-green preflight).

Change

  • $K3dVersion (default v5.9.0) and $HelmVersion (default v4.2.3) — env-overridable, lockstep with scripts/lib/common.sh until the shared facts spec (feat(installer): single-source installer facts (versions, hosts, timeouts, floors) + CI behavior-parity gate (RFC-CLIENT-0003 D3/D4) #435) single-sources them.
  • Test-ReleaseTagShape — release-shape + path-traversal gate before any tag reaches a download URL (mirrors the bootstrap ref gate / cli validate_version_tag).
  • latest remains supported but API-free: /releases/latest redirect Location header for k3d, get.helm.sh/helm-latest-version for helm — lib/setup-linux.sh parity, with Invoke-WithRetry (retry 3×5) and -TimeoutSec 30.
  • Pester: pin defaults, shape gate, resolver behavior (pinned = no network, latest = resolver, fail-closed), timeout assertion, plus a regression gate that fails if any https://api.github.com fetch reappears.
  • manifest.sha256 regenerated.

Provenance

Identical to the reviewed & Bugbot-clean #438 (install-k8s.ps1c66c57c1…, matching the manifest byte-for-byte). Commits authored by @LukasWodka, cherry-picked onto develop (the redundant #409 commit, already merged via #437, dropped out cleanly). Both prior Bugbot findings (dropped retries, missing timeouts) are already fixed in these commits.

Type

Bug fix

Test plan

🤖 Generated with Claude Code


Note

Low Risk
Installer-only change to version resolution and download paths; defaults match existing Linux/bash pins with fail-closed tag validation and no new privileged behavior.

Overview
Windows install-k8s.ps1 no longer hits api.github.com to resolve k3d/helm versions, avoiding GitHub’s unauthenticated rate limit that breaks installs behind shared NAT.

Default installs use pinnedK3D_VERSION / HELM_VERSION (v5.9.0 / v4.2.3, env-overridable, aligned with scripts/lib/common.sh). New helpers Test-ReleaseTagShape, Get-LatestGitHubTag, and Resolve-ToolVersion validate tags before download URLs are built; the literal latest still works via redirect/get.helm.sh, with 3×5 retries and 30s timeouts on lookups.

Pester covers pins, tag validation, resolver behavior, timeouts, and a regression that fails if https://api.github.com reappears. manifest.sha256 is updated for install-k8s.ps1.

Reviewed by Cursor Bugbot for commit 84de970. Bugbot is set up for automated code reviews on this repo. Configure here.

LukasWodkaand others added 3 commits July 27, 2026 16:50
…lookups (#410)
Ports the bash pins (#382) to the Windows installer: K3D_VERSION defaults
to v5.9.0 and HELM_VERSION to v4.2.3 (lockstep with scripts/lib/common.sh
until #435 single-sources them), env-overridable, validated against a
release-tag shape before any URL is built (path-traversal gate mirroring
the bootstrap and cli install.ps1).
The unauthenticated releases/latest API allows 60 req/hour per IP — one
shared corporate NAT exhausts it and fails installs (observed live on a
customer install 2026-07-27). The literal value 'latest' still works but
resolves API-free: the /releases/latest redirect Location for k3d, and
get.helm.sh/helm-latest-version for helm — exactly like lib/setup-linux.sh.
A Pester gate now fails the suite if any https://api.github.com fetch
reappears in the installer.
Closes#410
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s (Bugbot #438)
The new API-free 'latest' resolvers ran a single request — the old
lookups and lib/setup-linux.sh retry 3x5s. Resolve-ToolVersion now
drives the resolver through Invoke-WithRetry (resolvers throw on
failure), so a one-off network blip on flaky corporate egress retries
instead of aborting the install; a persistent failure still fails
closed with the pin-a-tag remedy.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ugbot #438)
A host that accepts the TCP connect but never responds would hang the
version resolvers indefinitely; the bash peers bound this with
--connect-timeout 15 --max-time 30. Both resolver requests now carry
-TimeoutSec 30; a timeout throws, so the retry ladder + fail-closed
remedy from the previous commit take over. AST-based Pester gate keeps
the timeouts in place.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shujaatTracebloc
shujaatTracebloc merged commit 048d2a6 into developJul 27, 2026
59 of 60 checks passed
@shujaatTracebloc
shujaatTracebloc deleted the fix/410-pin-k3d-helm-develop branch July 27, 2026 15:20
LukasWodka added a commit that referenced this pull request Jul 27, 2026
…447)
* fix(installer): fail fast on k3d spawn failure; bound the create wait (#439)
* fix(installer): fail fast on k3d spawn failure; bound the create wait (#412, #426 Windows half)
Two fixes to New-K3dCluster's create path, both observed live:
1. Start-Process failure ('%1 is not a valid Win32 application' from a
broken k3d.exe) is non-terminating by default, leaving $k3dProc null —
and 'while (-not $null.HasExited)' is always true, so the installer
spun 'Creating compute environment...' forever over a dead install.
The spawn now runs under -ErrorAction Stop in a try/catch that cleans
up the temp logs + proxy config and fails with the real exception,
the log path, and a remedy.
2. k3d cluster create --wait has no timeout of its own, so a stalled
image pull spun the spinner indefinitely. The wait is now bounded
(15 min default, TB_CREATE_TIMEOUT_MIN override): on expiry the
process is killed, the last stderr lines and the install-log path are
printed, and the install fails loudly. Extracted as
Wait-ProcessWithDeadline so the deadline/kill path is unit-tested.
Closes#412. Windows half of #426 (the bash half — k3d create + helm
timeouts in cluster.sh / install-client-helm.sh — follows separately).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(installer): remove the partial cluster when the create wait times out (Bugbot #439)
Killing k3d mid --wait skips its own rollback, so the timeout path left
a half-created cluster behind — and the next run's reuse path would see
serversRunning > 0 and print 'Compute environment already running' over
a broken environment. The timeout path now deletes the partial cluster
(bounded at 2 min via Wait-ProcessWithDeadline) before failing, and
tells the operator the exact manual command if the delete itself fails.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* fix(installer): Docker engine wait — 10 minutes, elapsed progress, named failure state (#440)
* fix(installer): Docker engine wait — 10 minutes, elapsed progress, named failure state (#413)
A first-ever Docker Desktop start on AV-heavy corporate machines
routinely needs 5-10 minutes (WSL bootstrap, image unpack). The old
3-minute cap turned a normal cold start into a failed install plus a
manual re-paste of the one-liner — observed as a recurring wait-then-
re-run loop on hospital installs.
- Wait bound: 3 min -> 10 min default, TB_DOCKER_WAIT_MIN override.
- After the first minute the spinner shows elapsed minutes and the
expected worst case, so the wait doesn't read as a hang.
- On expiry the failure names the observed state: Docker Desktop
process gone (start it / fix its error window) vs. running with the
engine still down (tray-icon guidance) - instead of one generic line.
Closes#413
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(installer): exited-Docker path drops the slow-start advice (Bugbot #440)
When Docker Desktop's process has exited, 'a first start can be slow'
and the TB_DOCKER_WAIT_MIN hint contradict the diagnosis and steer
operators toward raising the wait instead of restarting/fixing the
crash. The slow-start reassurance + override hint now print only on
the engine-still-starting path; the exited path fails with its own
start-and-fix remedy.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@shujaatTracebloc

Copy link
Copy Markdown
ContributorAuthor

Backing-ref link: this PR landed the fix for #410 (pin k3d + helm, drop api.github.com latest lookups — re-land after the stacked-PR squash strand). Merged to develop; the issue was closed manually since auto-close only fires on the default branch.

Sign up for freeto 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.

4 participants

@shujaatTracebloc@saadqbal@LukasWodka@divyasinghds