Windows service script builder
Summary
- Implemented the Windows Service deploy script generation path for
Squid.DeployWindowsService: the handler now returns a real PowerShellRunScriptIntentinstead of the previous “not implemented” stub. - Added
WindowsServiceDeployScriptBuilderas the single C# generation point for the script preamble: action properties, Squid variables, selected package metadata, scalar PowerShell escaping, and base64 preservation for multiline fields. - Added the embedded
DeployWindowsService.ps1resource for idempotent service deployment behavior: resolve package/executable paths, stop/reconfigure existing services, create missing services, set display name/description/start mode/dependencies/account, and apply desired started/stopped state. - Registered the Windows Service PowerShell resource in
Squid.Core.csproj, so the generated intent is self-contained and stable at runtime. - Stabilized
FakeMachineRegistrationServercleanup after CI exposed an unrelatedHttpListenerteardown race: cleanup no longer fails a passing registration test ifHttpListener.Close()throws during shutdown.
Test plan
-
Unit: WindowsServiceDeployActionHandlerTestsverifies the handler emits a PowerShellRunScriptIntentcontaining generated Windows Service script content. -
Unit: WindowsServiceDeployScriptBuilderTestscovers preamble generation, recognized property emission, escaping, multiline preservation, variables, selected package metadata, and service-account/lifecycle properties. -
Regression: targeted Windows Service tests green, 36 passed. -
CI failure follow-up: exact failing test KubernetesAgentRegistrarTests.RegisterAsync_Maps_Server_Response_To_TentacleRegistrationpasses locally after the fake server cleanup fix.