feat: confirm run deployment execution

This commit is contained in:
npc0-hue
2026-07-27 10:08:51 +08:00
parent 6c5b74b915
commit f2cc6b12e1
14 changed files with 241 additions and 18 deletions
+20
View File
@@ -887,6 +887,16 @@ type ServerDeploymentDispatchEvidence struct {
JobState JobState
DeploymentRevision int
DeploymentDefinitionIncluded bool
RunConfirmed bool
}
type ServerDeploymentExecutionReceipt struct {
SchemaVersion string
Revision int
Action string
Mode ServerDeploymentMode
Shell ServerCommandShell
UsedServerRoot bool
}
type ConfigDiffLine struct {
@@ -1087,6 +1097,7 @@ type JobExecutionResult struct {
AuditSummary string
Content string
ServerDeploymentEvidence *ServerDeploymentEvidence
DeploymentReceipt *ServerDeploymentExecutionReceipt
}
type Job struct {
@@ -1798,6 +1809,14 @@ func CopyServerDeploymentEvidence(evidence *ServerDeploymentEvidence) *ServerDep
return &copy
}
func CopyServerDeploymentExecutionReceipt(receipt *ServerDeploymentExecutionReceipt) *ServerDeploymentExecutionReceipt {
if receipt == nil {
return nil
}
copy := *receipt
return &copy
}
func CopyServerDeploymentDefinition(definition ServerDeploymentDefinition) ServerDeploymentDefinition {
definition.RuntimeBindings = CopyStringMap(definition.RuntimeBindings)
definition.CreateInputs = CopyStringMap(definition.CreateInputs)
@@ -1877,6 +1896,7 @@ func CopyJob(job Job) Job {
job.ExecutionInput.SourceRCON = CopyRuntimeSourceRCONPlan(job.ExecutionInput.SourceRCON)
job.ExecutionInput.ServerDeploymentPlan = CopyServerDeploymentPlan(job.ExecutionInput.ServerDeploymentPlan)
job.ExecutionResult.ServerDeploymentEvidence = CopyServerDeploymentEvidence(job.ExecutionResult.ServerDeploymentEvidence)
job.ExecutionResult.DeploymentReceipt = CopyServerDeploymentExecutionReceipt(job.ExecutionResult.DeploymentReceipt)
if job.ExecutionInput.Deployment != nil {
copy := CopyServerDeploymentDefinition(*job.ExecutionInput.Deployment)
job.ExecutionInput.Deployment = &copy