feat(site): route RefreshDeploymentCommand to deployment-manager proxy

This commit is contained in:
Joseph Doherty
2026-06-26 13:33:52 -04:00
parent caaa855362
commit 3955cb4f28
2 changed files with 20 additions and 0 deletions
@@ -97,6 +97,11 @@ public class SiteCommunicationActor : ReceiveActor, IWithTimers
_log.Debug("Routing DeployInstanceCommand for {0} to DeploymentManager", msg.InstanceUniqueName); _log.Debug("Routing DeployInstanceCommand for {0} to DeploymentManager", msg.InstanceUniqueName);
_deploymentManagerProxy.Forward(msg); _deploymentManagerProxy.Forward(msg);
}); });
Receive<RefreshDeploymentCommand>(msg =>
{
_log.Debug("Routing RefreshDeploymentCommand for {0} to DeploymentManager", msg.InstanceUniqueName);
_deploymentManagerProxy.Forward(msg);
});
// Pattern 2: Lifecycle — forward to Deployment Manager // Pattern 2: Lifecycle — forward to Deployment Manager
Receive<DisableInstanceCommand>(msg => _deploymentManagerProxy.Forward(msg)); Receive<DisableInstanceCommand>(msg => _deploymentManagerProxy.Forward(msg));
@@ -39,6 +39,21 @@ public class SiteCommunicationActorTests : TestKit
dmProbe.ExpectMsg<DeployInstanceCommand>(msg => msg.DeploymentId == "dep1"); dmProbe.ExpectMsg<DeployInstanceCommand>(msg => msg.DeploymentId == "dep1");
} }
[Fact]
public void RefreshDeploymentCommand_ForwardedToDeploymentManager()
{
var dmProbe = CreateTestProbe();
var siteActor = Sys.ActorOf(Props.Create(() =>
new SiteCommunicationActor("site1", _options, dmProbe.Ref)));
var command = new RefreshDeploymentCommand(
"dep1", "inst1", "hash1", "admin", DateTimeOffset.UtcNow,
"https://central/", "tok1");
siteActor.Tell(command);
dmProbe.ExpectMsg<RefreshDeploymentCommand>(msg => msg.DeploymentId == "dep1");
}
[Fact] [Fact]
public void LifecycleCommands_ForwardedToDeploymentManager() public void LifecycleCommands_ForwardedToDeploymentManager()
{ {