Skip to content

Accept legacy "Microsoft Windows ..." OS form for in-UI upgrades

Summary

  • Fix operator-visible breakage where the UI's upgrade button returns "CommunicationStyle 'TentaclePolling' is not supported for in-UI upgrades" for healthy Windows tentacles. Root cause: MachineRuntimeCapabilities.IsWindows used strict equality with the canonical short string "Windows", so agents reporting the long form "Microsoft Windows NT 10.0.19045.0" (from Environment.OSVersion.VersionString) failed every predicate (IsWindows=false, IsLinux=false, IsUnknown=false). Both Windows and Linux upgrade strategies rejected → ResolveStrategy returned null → eligibility evaluator emitted the user-facing error.
  • Delegate IsWindows to the shared WindowsOsStringHelper.IsWindows() (introduced in #348 for the IIS dispatch guard + MachineCapabilitySet projection). Single source of truth for "is this a Windows host?" across capability projection, dispatch guard, upgrade-strategy resolution, and version-registry Windows-vs-Linux routing.
  • Drift detectors pin IsLinux=false and IsUnknown=false for the long form so the single-owner invariant in MachineUpgradeService.ResolveStrategy stays intact — without these rows, a future refactor that widened Linux's IsLinux || IsUnknown claim path could accidentally route a Windows agent to the Linux tarball.

Test plan

  • Red: 11 new [InlineData] rows on long-form Windows fail before the fix (verified pre-edit run)
  • Green: 5517/5517 Squid.UnitTests after the fix
  • Adjacent sweep: 871/871 across Upgrade, MachineRuntimeCapabilities, MachineCapabilitySet, TentacleVersionRegistry, DeploymentPlannerStaticRequirements, IISDeploy
  • Operator-side: rerun the upgrade-info API on a Windows TentaclePolling machine reporting Microsoft Windows NT ... — expect canUpgrade=true (or, more accurately, the next branch in EvaluateUpgradeEligibility like "could not resolve the latest available version" if GitHub release isn't tagged yet — but no longer the "is not supported" message)

Why this is non-breaking

  • IsLinux, IsMacOS, IsUnknown are unchanged — only IsWindows widens. Canonical "Windows" agents continue to route to WindowsTentacleUpgradeStrategy exactly as before.
  • WindowsOsStringHelper uses StartsWith("Microsoft Windows"), NOT Contains("Windows") — "LinuxOnWindowsSubsystem" / "WindowsSomethingElse" still reject (pinned by test).
  • Cold cache (Os = "") still routes through IsUnknown=true → Linux historical default. No change to existing operator deployments without a health check.

Merge request reports

Loading