taskcluster/task-graph-scheduler — pull request #2 by jonasfj (2014-06-20 00:34:55+00:00)
Title: Decision tasks (API end-point to extend task-graphs)

This refactors the task-graph format a bit... To use arrays instead of objects with mapping from labels to task nodes... This is a trivial refactoring that hopefully makes it easier to work with task-graphs, concatenate lists of tasks etc.

The main feature here is the addition of an API end-point to extend existing task-graphs with new tasks.
We can call this API end-point from within tasks and extend task-graphs.

I know we discussed having the task-graph scheduler fetch decision artifacts from the completed tasks. In a format the looks somewhat like this:
```js
{
...
tasks: [
{
label: "task-label",
decisionArtifact: "decision", // <<---- HERE
reruns: 5
task: {
...
payload: {
image: "...",
artifacts: {
"decision": "/home/decider/decision.json"
}
}
}
}
]
}
```

**we will not do this**, because it makes it impossible for the scheduler to
report errors in the decision JSON. There is just no nice way to do this.
Instead, we make it the tasks responsibility to call the task-graph scheduler
and ask for the graph to extended with a set of tasks.

As a good compromise, we can add the "decisionArtifact" property in the
task-payload and let docker-worker deal with uploading the decision artifact
and writing the result (errors) from this operation to task log.

Either way, this implements the functionality to extend task-graphs. Then we
can always change how we choose to do it. If we can find a way for the scheduler
to report errors, or make errors reproducible, I would happily have a
"decisionArtifact" property as discussed above.