Documentation
¶
Overview ¶
Package driveplan proposes how to start a set of tasks. It says which to bundle on one branch and which to leave alone, and spells which entry waits for which in the start command. It reads nothing itself, so every rule is a table test. Gathering lives in drive.
Index ¶
Constants ¶
const ( KindFeature = "feature" KindBug = "bug" KindRefactor = "refactor" KindSpike = "spike" )
The kinds a task may carry, as fetch settles them.
const NoOrder = "none"
NoOrder is the user's After: that drops every base of a task.
const Tradeoff = "a bundle is one PR: one revert, one review over a mixed diff, " +
"and a later bug is traced to its lead with the riders named"
Tradeoff is said once under a proposal holding a bundle.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶ added in v0.71.0
type Base struct {
ID string `json:"id"`
Reason string `json:"reason"`
Dropped bool `json:"dropped,omitempty"` // the flow does not finish, so the join was cut to one base
}
A Base is one task an entry waits for, and why.
type Entry ¶
type Entry struct {
IDs []string `json:"ids"`
Reason string `json:"reason"`
Bases []Base `json:"bases,omitempty"` // the tasks outside the entry it waits for
Lines int `json:"lines,omitempty"`
Profile string `json:"profile,omitempty"`
Suffix string `json:"suffix,omitempty"` // a lone task's -suffix as typed
// contains filtered or unexported fields
}
An Entry is one item of the start command: a task or a bundle.
type Formed ¶
type Formed struct {
Bundles int `json:"bundles"`
Bundled int `json:"bundled"`
Waits int `json:"ciWaitsSaved"`
}
Formed is a saving the rules found by themselves.
type Input ¶
type Input struct {
Tasks []Task
MaxLines int // bundle_max_lines
Parallel int // the ceiling on --parallel, 0 for none
// TypedParallel says the user typed that ceiling, so the command prints
// it even at 1, where a default ceiling of 1 prints nothing
TypedParallel bool
// Carry is the start flags the user typed, put on the command as typed
Carry []string
// Joins says the run's flow finishes, so an entry may wait on several
// bases. f10 start refuses a join otherwise, so only the first is kept.
Joins bool
// Finished is the bases outside the list that are finished, the only
// outside bases f10 start lets a join wait on
Finished []string
}
Input is the candidates in the parent's order, with the caps.
type Level ¶ added in v0.71.0
type Level struct {
Entries []Entry `json:"entries"`
}
A Level is the entries at one depth of the base graph: every base of an entry sits in an earlier level.
type Plan ¶
type Plan struct {
Levels []Level `json:"levels"`
Args []string `json:"args"` // the start command's arguments, the order spelled with , and @
// Carry is the typed start flags the command ends in. Command is the one
// place the line is built, for the text, the JSON and the hint.
Carry []string `json:"carried,omitempty"`
// Unordered is a line per task whose order the user dropped. Its body
// still names a base, which the start would read back.
Unordered []string `json:"unordered,omitempty"`
Parallel int `json:"parallel"`
Waits int `json:"ciWaitsSaved"`
Finishes int `json:"finishesSaved"`
Bundles int `json:"bundles"`
Bundled int `json:"bundled"` // tasks inside a bundle
// Formed counts the bundles the rules formed, the user's own left out, so
// a hint never offers what the user already bundled
Formed Formed `json:"formed"`
}
A Plan is the proposal.
func Propose ¶
Propose applies the rules in order. Alone comes first, then bundles within a class by shared files or areas, split at the cap, then bases and levels.
func (Plan) Command ¶
Command is the start command line the proposal runs: its arguments, then the start flags the user typed.
func (Plan) Hint ¶
Hint is the one line a plain start prints when the rules alone would save at least one CI wait, "" otherwise: the start command that saves them.
type Task ¶
type Task struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
Kind string `json:"kind,omitempty"` // "" reads as feature
Areas []string `json:"areas,omitempty"`
Files []string `json:"files,omitempty"`
Lines int `json:"lines,omitempty"` // changed lines; 0 is not sized
// Estimated marks Lines as a model's guess rather than a measured diff
Estimated bool `json:"estimated,omitempty"`
Base string `json:"after,omitempty"` // the body's After: line
BuildsOn []string `json:"buildsOn,omitempty"` // tasks whose code this one builds on, with no After: saying so
Flow string `json:"flow,omitempty"` // the flow its areas map to, "" for the batch's
Profile string `json:"profile,omitempty"` // its :profile as typed
Risky string `json:"risky,omitempty"` // the word that marks it risky (migration), "" for none
Alone bool `json:"alone,omitempty"` // the user kept it alone
With string `json:"with,omitempty"` // the user bundled it with this task
After []string `json:"afterEdit,omitempty"` // the user's bases for it, ["none"] to drop every base
// Suffix is its -suffix as typed, one attempt of the task, which never bundles
Suffix string `json:"suffix,omitempty"`
}
A Task is one candidate and what is known about it.