core(deploy): add deployedConfigSnapshot field to Deployment model
Appends DeploymentConfigSnapshot deployedConfigSnapshot to the Deployment record and adds a matching withDeployedConfigSnapshot wither. All positional call sites (repository mapper, test fixture) updated to pass null; Task 1.4 will wire real persistence and Task 1.5 will populate the field on RUNNING transition. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -172,6 +172,7 @@ public class PostgresDeploymentRepository implements DeploymentRepository {
|
|||||||
rs.getString("container_name"),
|
rs.getString("container_name"),
|
||||||
rs.getString("error_message"),
|
rs.getString("error_message"),
|
||||||
resolvedConfig,
|
resolvedConfig,
|
||||||
|
null, // deployedConfigSnapshot — wired in Task 1.4
|
||||||
deployedAt != null ? deployedAt.toInstant() : null,
|
deployedAt != null ? deployedAt.toInstant() : null,
|
||||||
stoppedAt != null ? stoppedAt.toInstant() : null,
|
stoppedAt != null ? stoppedAt.toInstant() : null,
|
||||||
rs.getTimestamp("created_at").toInstant()
|
rs.getTimestamp("created_at").toInstant()
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class DeploymentStateEvaluatorTest {
|
|||||||
private Deployment deployment(DeploymentStatus status) {
|
private Deployment deployment(DeploymentStatus status) {
|
||||||
return new Deployment(DEP_ID, APP_ID, UUID.randomUUID(), ENV_ID, status,
|
return new Deployment(DEP_ID, APP_ID, UUID.randomUUID(), ENV_ID, status,
|
||||||
null, null, List.of(), null, null, "orders-0", null,
|
null, null, List.of(), null, null, "orders-0", null,
|
||||||
Map.of(), NOW.minusSeconds(60), null, NOW.minusSeconds(120));
|
Map.of(), null, NOW.minusSeconds(60), null, NOW.minusSeconds(120));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ public record Deployment(
|
|||||||
String containerName,
|
String containerName,
|
||||||
String errorMessage,
|
String errorMessage,
|
||||||
Map<String, Object> resolvedConfig,
|
Map<String, Object> resolvedConfig,
|
||||||
|
DeploymentConfigSnapshot deployedConfigSnapshot,
|
||||||
Instant deployedAt,
|
Instant deployedAt,
|
||||||
Instant stoppedAt,
|
Instant stoppedAt,
|
||||||
Instant createdAt
|
Instant createdAt
|
||||||
@@ -27,6 +28,13 @@ public record Deployment(
|
|||||||
return new Deployment(id, appId, appVersionId, environmentId, newStatus,
|
return new Deployment(id, appId, appVersionId, environmentId, newStatus,
|
||||||
targetState, deploymentStrategy, replicaStates, deployStage,
|
targetState, deploymentStrategy, replicaStates, deployStage,
|
||||||
containerId, containerName, errorMessage, resolvedConfig,
|
containerId, containerName, errorMessage, resolvedConfig,
|
||||||
deployedAt, stoppedAt, createdAt);
|
deployedConfigSnapshot, deployedAt, stoppedAt, createdAt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Deployment withDeployedConfigSnapshot(DeploymentConfigSnapshot snapshot) {
|
||||||
|
return new Deployment(id, appId, appVersionId, environmentId, status,
|
||||||
|
targetState, deploymentStrategy, replicaStates, deployStage,
|
||||||
|
containerId, containerName, errorMessage, resolvedConfig,
|
||||||
|
snapshot, deployedAt, stoppedAt, createdAt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user