Skip to main content

Module graph

Module graph 

Source
Expand description

The milestone as a typed dependency graph, with the partitions a work surface would otherwise compute for itself.

§What is derived here and what is not

The graph itself is not derived here. crate::plan already walks the canonical records and produces the edges, the waves, the statuses, the dependents and the findings; this module reads that answer and computes the four things a plan surface needs and the plan does not carry:

  • the partitions by readiness — ready, blocked, waiting, in progress, review, completion-blocked, complete, cancelled. Grouping is a derivation, and a derivation done in a template is a derivation done differently in every template.
  • the critical blockers — which unfinished issues hold back the most downstream work, measured as the transitive closure of the dependents relation. What to unblock first is the question a milestone exists to answer.
  • the parallelizable subsets — of the startable work, which issues may genuinely run at the same time: same wave, each parallel_safe, and no two sharing a scope path. The plan warns about a scope conflict; this partitions around it.
  • the cycles — the plan reports that a cycle exists and names every issue stuck behind one. That is the right diagnostic and the wrong shape for a reader who wants to fix it: the strongly connected components are what a person edits.

§Determinism

Every list here is ordered by crate::order::natural_cmp over the canonical issue id, which is the repository’s canonical order and is total — identities are unique, so no comparison ever ends in a tie. Nothing is ordered by a hash-map walk, by discovery order or by insertion order, so two runs over the same records, on two machines, produce the same bytes. test/cases/129_executable_issues.sh asserts that byte-for-byte.

The graph algorithms below are deterministic for the same reason: the depth-first walk of cycles visits roots in canonical order, and the greedy partition of parallel_sets considers candidates in canonical order.

Structs§

CriticalBlocker
One unfinished issue that holds back downstream work, and how much.
MilestoneCounts
One milestone’s issues counted by readiness, plus the two denominators.
MilestoneEdge
One dependency edge of the milestone’s graph, from before to.
MilestoneGraph
One milestone as an executable dependency graph.
MilestoneNode
One issue of a milestone, as a node of its graph.
ParallelSet
One subset of the startable work that may genuinely run at the same time.
ScopeConflict
Two issues of one wave that cannot run together, and the path that stops them.

Functions§

cycles
Every dependency cycle of the issue graph, each as its strongly connected component in canonical order, the components themselves in canonical order.
parallel_sets
Partition startable work into subsets that may genuinely run at the same time.
transitive_dependents
Every issue that waits on id, directly or through another, in canonical order.