Documentation
¶
Overview ¶
Package decide chooses which changes of a plan to start now and says why it holds each of the others. It reads nothing and writes nothing: the caller gathers the facts from the store and starts what it returns.
Index ¶
Constants ¶
const ( AfterPrefix = "after " AfterSuffix = " has not landed" ReasonUnended = "has an unended run" ReasonOpenPR = "has an open PR from an earlier run: " ReasonMerged = "its PR merged and is not on the default branch here yet: " ReasonAbandoned = "abandoned: its PR was closed without merging and a person has not answered" ReasonNoPR = "its last run ended without a PR and a person has not said to run it again" ReasonNoSlot = "no free slot" )
The reasons a change is held. The ones ending in a space are followed by a URL; the after reason is AfterPrefix, the change's name and AfterSuffix.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
Changes []Change
Landed map[string]bool
Runs map[string]RunFacts
Free int // slots free for new runs
}
Input is everything Decide looks at. Changes are in plan order.
type Output ¶
Output lists the changes to start, in plan order, and the held ones. A landed change is in neither.
type RunFacts ¶
type RunFacts struct {
Unended bool // some run has not ended
OpenPR string // an ended run's PR the forge says is open, or has never described
MergedPR string // a run's PR the forge says merged, while the change has not landed
Abandoned bool // an abandoned item for the change is unanswered
NoPR bool // the newest run ended without a PR and nobody said to run it again
}
RunFacts is what the runs of one change say.