Skip to content

Phase 12.J.E.9 — already-up-to-date short-circuit (E4.h)

Placeholder ppxd requested to merge phase12.J.E.9-already-up-to-date into main

Summary

Closes Section E's last ship-blocking gap. Operator double-clicks "upgrade" on a machine already running the target version → .ps1's short-circuit at line ~330 reads the on-disk Squid.Tentacle.exe's Win32 VERSIONINFO ProductVersion via (Get-Item).VersionInfo.ProductVersion and compares to TARGET_VERSION. If equal → emit SUCCESS "Already on target X (no-op)" + exit 0 before Phase A or Phase B.

Operator value: spurious clicks (deploy automation hitting "upgrade" on every roll-out regardless of state) don't trigger a 60s+ service restart cycle.

The challenge

The .ps1 inspects a Win32 VERSIONINFO resource, which .NET stamps at build time from <Version> / <InformationalVersion> MSBuild properties. Runtime modification isn't feasible. Need a binary with a known stamp.

Solution

New micro-project Squid.WindowsUpgradeE2E.VersionStampedShim:

  • <AssemblyName>Squid.Tentacle</AssemblyName> — output filename matches what the .ps1 looks for
  • <InformationalVersion>1.0.0-shim-stamped</InformationalVersion> — fixed literal
  • <IncludeSourceRevisionInInformationalVersion>false</...> — critical: .NET 8+ default appends +<git-hash> which would tie test's TARGET_VERSION to git HEAD (non-deterministic across rebases)

E2E test (1 new)

E4h_AlreadyOnTargetVersion_ShortCircuitsBeforePhaseB:

Reverse-assert Pin
Exit 0 + SUCCESS with "Already on target ... (no-op)" The happy path
Detail contains "(no-op)" marker Server-side staleness detection treats this as terminal-success, not in-progress
Mirror.ReceivedRequests is empty Phase A's Invoke-WebRequest never ran (short-circuit fires before download)
.bak dir does not exist Phase B's Move-Item never ran (short-circuit fires before swap)

Refactor (bonus)

Extracted LocateSiblingTestProjectExe(projectName, exeFileName) helper from the duplicated path-walk in LocateTestServiceExe. Adding a fourth sibling project later won't duplicate the walk.

Local verification

88/88 cross-platform E2E pass (was 87 + 1 new). E4h skip-guards on non-Windows dev hosts.

🤖 Generated with Claude Code

Merge request reports

Loading