Documentation
¶
Overview ¶
Package dag resolves a named dependency graph into levels: each node's distance from having no unmet dependencies, and a flat execution order grouped by ascending level. It's shared by any provider whose jobs declare "run after" dependencies on sibling jobs (CircleCI's workflow `requires:`, GitHub Actions' job `needs:`), so the same algorithm and error handling (unknown dependency, circular dependency, duplicate node) isn't reimplemented per provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Levels ¶
Levels assigns each node the length of its longest dependency chain (0 for a node with no dependencies), so nodes at the same level can run one after another while still guaranteeing every dependency's level is lower than its dependents'. It also returns a flat execution order: nodes grouped by ascending level, stable within a level by the order given in nodes.