in builder/builder.go [222:251]
func (b *Builder) processVertex(ctx context.Context, task *graph.Task, parent *graph.Node, child *graph.Node, errorChan chan error) {
err := task.Dag.RemoveEdge(parent.Name, child.Name)
if err != nil {
errorChan <- errors.Wrap(err, "failed to remove edge")
return
}
degree := child.GetDegree()
if degree == 0 {
step := child.Value
err := b.runStep(ctx, step, task.Credentials)
if err != nil && step.IgnoreErrors {
log.Printf("Step ID: %s encountered an error: %v, but is set to ignore errors. Continuing...\n", step.ID, err)
step.StepStatus = graph.Successful
for _, c := range child.Children() {
go b.processVertex(ctx, task, child, c, errorChan)
}
} else if err != nil {
step.StepStatus = graph.Failed
errorChan <- errors.Wrapf(err, "failed to run step ID: %s", step.ID)
} else {
step.StepStatus = graph.Successful
for _, c := range child.Children() {
go b.processVertex(ctx, task, child, c, errorChan)
}
}
// Step must always be marked as complete.
step.CompletedChan <- true
}
}