MCPcopy Create free account
hub / github.com/compozy/agh / addTaskDependencyFromRequest

Function addTaskDependencyFromRequest

internal/api/core/tasks.go:2226–2241  ·  view source on GitHub ↗
(taskID string, req contract.AddTaskDependencyRequest)

Source from the content-addressed store, hash-verified

2224}
2225
2226func 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
2243func enqueueTaskRunFromRequest(taskID string, req contract.EnqueueTaskRunRequest) (taskpkg.EnqueueRun, error) {
2244 if err := validateTaskChannel("enqueue_run.network_channel", req.NetworkChannel); err != nil {

Callers 2

AddTaskDependencyMethod · 0.85

Calls 2

ValidateMethod · 0.95
NormalizeMethod · 0.45

Tested by 1