Skip to content

Windows service script builder

Summary

  • Implemented the Windows Service deploy script generation path for Squid.DeployWindowsService: the handler now returns a real PowerShell RunScriptIntent instead of the previous “not implemented” stub.
  • Added WindowsServiceDeployScriptBuilder as 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.ps1 resource 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 FakeMachineRegistrationServer cleanup after CI exposed an unrelated HttpListener teardown race: cleanup no longer fails a passing registration test if HttpListener.Close() throws during shutdown.

Test plan

  • Unit: WindowsServiceDeployActionHandlerTests verifies the handler emits a PowerShell RunScriptIntent containing generated Windows Service script content.
  • Unit: WindowsServiceDeployScriptBuilderTests covers 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_TentacleRegistration passes locally after the fake server cleanup fix.

Merge request reports

Loading