orch: require explicit dispatch execution mode
This commit is contained in:
@@ -159,6 +159,7 @@ type WaitResult struct {
|
||||
}
|
||||
|
||||
type DispatchWorkspace struct {
|
||||
ExecutionMode string `json:"execution_mode,omitempty"`
|
||||
BaseRef string `json:"base_ref,omitempty"`
|
||||
BaseCommit string `json:"base_commit,omitempty"`
|
||||
BranchName string `json:"branch_name,omitempty"`
|
||||
@@ -1094,7 +1095,8 @@ func (s *OrchStore) dispatchTaskTx(
|
||||
|
||||
attemptNo := task.LatestAttemptNo + 1
|
||||
workspace := DispatchWorkspace{
|
||||
BaseRef: strings.TrimSpace(baseRef),
|
||||
ExecutionMode: "analysis",
|
||||
BaseRef: strings.TrimSpace(baseRef),
|
||||
}
|
||||
finalizeWorkspace := func(success bool) {}
|
||||
if prepareWorkspace != nil {
|
||||
@@ -2636,6 +2638,9 @@ func buildDispatchPayload(task Task, attemptNo int, workspace DispatchWorkspace)
|
||||
payload["acceptance"] = acceptance
|
||||
}
|
||||
}
|
||||
if strings.TrimSpace(workspace.ExecutionMode) != "" {
|
||||
payload["execution_mode"] = strings.TrimSpace(workspace.ExecutionMode)
|
||||
}
|
||||
if strings.TrimSpace(workspace.BaseRef) != "" {
|
||||
payload["base_ref"] = strings.TrimSpace(workspace.BaseRef)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user