| 2224 | } |
| 2225 | |
| 2226 | func addTaskDependencyFromRequest(taskID string, req contract.AddTaskDependencyRequest) (taskpkg.AddDependency, error) { |
| 2227 | kind := req.Kind.Normalize() |
| 2228 | if kind == "" { |
| 2229 | kind = taskpkg.DependencyKindBlocks |
| 2230 | } |
| 2231 | |
| 2232 | spec := taskpkg.AddDependency{ |
| 2233 | TaskID: strings.TrimSpace(taskID), |
| 2234 | DependsOnTaskID: strings.TrimSpace(req.DependsOnTaskID), |
| 2235 | Kind: kind, |
| 2236 | } |
| 2237 | if err := spec.Validate("add_dependency"); err != nil { |
| 2238 | return taskpkg.AddDependency{}, err |
| 2239 | } |
| 2240 | return spec, nil |
| 2241 | } |
| 2242 | |
| 2243 | func enqueueTaskRunFromRequest(taskID string, req contract.EnqueueTaskRunRequest) (taskpkg.EnqueueRun, error) { |
| 2244 | if err := validateTaskChannel("enqueue_run.network_channel", req.NetworkChannel); err != nil { |