Resolve $RID in the Windows upgrade download URL before fetching
Summary
Windows tentacle upgrades fail at the download step with Download failed: (404). The server emits the upgrade URL with a literal $RID placeholder (it can't know the agent's architecture), but upgrade-windows-tentacle.ps1 assigned it with single quotes — $DOWNLOAD_URL = '...-$RID.zip' — so PowerShell never expanded $RID. The agent then requested .../squid-tentacle-<ver>-$RID.zip, which doesn't exist → GitHub 404.
Fix: rewrite the $RID token to the architecture-resolved value right after arch detection, before Invoke-WebRequest consumes the URL. A targeted .Replace('$RID', $RID) — not a double-quoted re-assignment — so an operator-overridden base URL with other $/backtick characters is left intact.
Impact
- Zip is the only Windows upgrade method, so this broke every Windows tentacle upgrade at the download step since the feature shipped — it is a latent bug, not a regression in any recent release.
- Linux is unaffected: its
DOWNLOAD_URL="..."is double-quoted and$RIDis set before the assignment, so bash expands it. - Why CI missed it: the Windows lifecycle E2E reads the real
.ps1but itsLocalReleaseMirrorserves any.zippath, so the literal-$RIDURL got a 200 there while real GitHub returns 404.
Test plan
-
RenderInnerScript_DownloadUrl_RewritesLiteralRidTokenBeforeDownload— written test-first (RED before the fix, GREEN after); asserts the script rewrites the literal$RIDtoken beforeInvoke-WebRequestconsumes$DOWNLOAD_URL -
Full unit suite green (5905/5905) -
Full solution build (0 errors) -
Resolved URL .../squid-tentacle-1.8.11-win-x64.zipconfirmed to exist as a published release asset