Skip to content

Add version GC + same-version no-op to versioned upgrade

Placeholder ppxd requested to merge feat/tentacle-versioned-gc into main

Summary

Two refinements to the blue-green versioned upgrade (both OSes, versioned-only, gated on the layout — flat installs untouched):

  • Version GC: after a successful upgrade, prune old version dirs keeping the newest N (SQUID_UPGRADE_KEEP_VERSIONS, default 3) so versions/ doesn't grow unbounded. Best-effort (runs only after SUCCESS), floored at 2 so it can never strand the rollback target, and it never deletes the active version. On Linux the retention env var is propagated across the systemd-run scope so the override actually reaches Phase B.
  • Same-version re-upgrade is now a clean no-op: when the target equals the active version, skip stage+repoint and discard the download instead of moving it into the live version dir (which previously left an extract/ residue).

Test plan

  • 694 upgrade unit tests green: updated guard pins + new GC/same-version drift assertions (env var + floor-2 + sort key + already-active event) + events-parity + bash -n on the rendered Linux script + the Windows resource test (GC sorts by CreationTimeUtc, sidestepping the Phase-B LastWriteTime anti-pattern guard).
  • Real-OS E2E (dispatched on this branch): Linux systemd + Windows SCM — GC prunes the oldest beyond retention (4 versions → newest 3 kept); same-version re-upgrade is a no-op with no residue.

Notes

Non-breaking: gated entirely on the versioned layout. GC is best-effort and floored at 2.

Merge request reports

Loading