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.IsWindowsused strict equality with the canonical short string"Windows", so agents reporting the long form"Microsoft Windows NT 10.0.19045.0"(fromEnvironment.OSVersion.VersionString) failed every predicate (IsWindows=false,IsLinux=false,IsUnknown=false). Both Windows and Linux upgrade strategies rejected →ResolveStrategyreturned null → eligibility evaluator emitted the user-facing error. - Delegate
IsWindowsto the sharedWindowsOsStringHelper.IsWindows()(introduced in #348 for the IIS dispatch guard +MachineCapabilitySetprojection). 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=falseandIsUnknown=falsefor the long form so the single-owner invariant inMachineUpgradeService.ResolveStrategystays intact — without these rows, a future refactor that widened Linux'sIsLinux || IsUnknownclaim 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.UnitTestsafter 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 ...— expectcanUpgrade=true(or, more accurately, the next branch inEvaluateUpgradeEligibilitylike "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,IsUnknownare unchanged — onlyIsWindowswidens. Canonical"Windows"agents continue to route toWindowsTentacleUpgradeStrategyexactly as before. -
WindowsOsStringHelperusesStartsWith("Microsoft Windows"), NOTContains("Windows")—"LinuxOnWindowsSubsystem"/"WindowsSomethingElse"still reject (pinned by test). - Cold cache (
Os = "") still routes throughIsUnknown=true→ Linux historical default. No change to existing operator deployments without a health check.