Documentation
¶
Overview ¶
Package backlog decides what becomes of a role's acts on a project's issues (docs/spec/backlog-acts.md): each is checked against the code and the forge, then done, proposed to a person, or dropped. Closing is the first act built.
Index ¶
- Constants
- Variables
- func Accepted(is forge.Issue) bool
- func Ask(author, questions string) string
- func AskMarker(role string) string
- func Before(is forge.Issue) string
- func BodyDigest(body string) string
- func CappedByRole(f forge.Backlog, role string, open []forge.Issue) []int
- func ClosedByRole(f forge.Backlog, role string, open []forge.Issue) []int
- func Comment(c Proposal, role string) string
- func CompareMilestones(a, b string) int
- func DraftLine(role string) string
- func FormatRecord(r Record) string
- func FormatState(s State) string
- func ImportKey(q Quote) string
- func Less(a, b forge.Issue) bool
- func Locate(repo, path, text string) (from, to int, original string, ok bool)
- func MovedPercent(settings map[string]any) int
- func NextMilestone(repo string, open []string) string
- func NotReady(body string, accepted bool) []string
- func Order(issues []forge.Issue)
- func PeopleComments(comments []string) int
- func Priority(is forge.Issue) int
- func PriorityLabel(n int) string
- func PriorityLabels(is forge.Issue) []int
- func RecordMarker(role string) string
- func Refine(body string, c Proposal, role string) (string, []string, []string)
- func Released(repo, milestone string) bool
- func ReportTitle(role string) string
- func Settings(settings map[string]any) map[string]Setting
- func StateMarker(role string) string
- func StripDrafts(body string) string
- type Closing
- type Decision
- type Pending
- type Plan
- type Proposal
- type Quote
- type Record
- type Setting
- type State
Constants ¶
const ( Act = "act" Propose = "propose" Off = "off" )
Modes of an act.
const ( LabelToRefine = "workline:to-refine" LabelDraft = "workline:draft" // the role drafted its Need or Validation LabelAccepted = "workline:accepted" // a person accepted the drafts: only who may triage sets a label LabelReady = "workline:ready" )
The labels of an issue on its way to ready (docs/spec/routing.md).
const Levels = 4
Levels are the priorities an issue takes: 1, the most pressing, to 4 (docs/spec/backlog-acts.md, "Ordering").
const PriorityPrefix = "workline:priority/"
PriorityPrefix starts each priority label: workline:priority/1 to /4.
Variables ¶
var DraftMarker = forge.Marker("draft")
DraftMarker marks a section the role drafted and no person made theirs.
var Kinds = []string{"open", "close", "sources", "milestone", "order", "refine", "ready", "ask"}
Kinds are the intentions that are acts on the backlog.
var Sections = []string{"Need", "Verification", "Validation", "Scope"}
Sections are an issue's, in the order they are written.
Functions ¶
func Accepted ¶ added in v0.7.0
Accepted says whether a person accepted an issue's drafts, by its label — read on the issue, never taken from a proposal.
func Before ¶ added in v0.8.0
Before says an issue's place in the order, to put it back: its priority and its milestone.
func BodyDigest ¶ added in v0.6.0
BodyDigest is what the state keeps of a body, to tell when a person changed it.
func CappedByRole ¶ added in v0.7.1
CappedByRole lists the issues an act was proposed on only because a run's cap was reached: they are read again, though nothing changed on them.
func ClosedByRole ¶
ClosedByRole lists the issues the role's record says it closed, read from its report issue's comments; nil when there is none or it does not read.
func CompareMilestones ¶ added in v0.8.0
CompareMilestones orders two milestone titles as versions: their numbers compared as numbers (v1.9 before v1.10), the rest as text.
func DraftLine ¶ added in v0.6.0
DraftLine opens a drafted section; deleting it makes the section a person's.
func FormatRecord ¶
FormatRecord is the body of the report's record comment.
func FormatState ¶
FormatState is the body of an issue's state comment, its marker left to the forge's Sticky.
func ImportKey ¶
ImportKey is the marker key of an issue opened from a file's text: the file and a digest of the text, so the same text is never opened twice.
func Less ¶ added in v0.8.0
Less is the backlog's order (docs/spec/backlog-acts.md, "Ordering"): the nearest milestone first, an issue in none after every one in one; then the priority, an issue with none after priority 4; then the lowest number.
func Locate ¶
Locate finds a quote in a file, as written but for spaces: the lines it spans, from 1, and those lines as the file has them.
func MovedPercent ¶ added in v0.8.0
MovedPercent reads the role's `moved-percent-max` setting: the share of the open issues a run may move, in percent; a fifth when it is not set.
func NextMilestone ¶ added in v0.8.0
NextMilestone is the nearest open milestone not released, in version order; "" when there is none.
func NotReady ¶ added in v0.6.0
NotReady says what keeps an issue's body from ready: a section missing or empty, Need or Validation still a draft no person accepted.
func PeopleComments ¶
PeopleComments counts an issue's comments that are not the engine's.
func Priority ¶ added in v0.8.0
Priority is an issue's level, the most pressing of its labels; 0 when it has none.
func PriorityLabel ¶ added in v0.8.0
PriorityLabel is the label of a priority level.
func PriorityLabels ¶ added in v0.8.0
PriorityLabels lists the levels an issue's priority labels give, in the order of its labels; more than one is a person's doing.
func RecordMarker ¶
RecordMarker marks the report's comment holding what the role did.
func Refine ¶ added in v0.6.0
Refine is an issue's body with the sections it lacks written: one there but empty (an issue form's "_No response_") filled in place, one missing added after the text, which stays as it is; added and kept name the sections written and those already there, left alone.
func Released ¶ added in v0.8.0
Released says whether a tag named after the milestone exists: the release it was for is out.
func ReportTitle ¶
ReportTitle is the title of the role's report issue.
func StateMarker ¶
StateMarker marks the comment holding an issue's state.
func StripDrafts ¶ added in v0.7.0
StripDrafts takes the draft lines out of a body: the drafts are a person's once accepted.
Types ¶
type Decision ¶
type Decision struct {
Index int `yaml:"index"` // the intention's place in the run
Mode string `yaml:"mode"` // act, propose, or off (dropped)
Act Proposal `yaml:"act"`
Capped bool `yaml:"capped,omitempty"` // proposed only for the cap
}
Decision is what becomes of one act.
type Pending ¶
type Pending struct {
Issue int `yaml:"issue"`
Act string `yaml:"act"`
Line string `yaml:"line"`
Key string `yaml:"key,omitempty"` // an issue to open: the text it would be opened from (ImportKey)
// Capped: proposed only because the run's cap was reached, not left to
// a person by its mode: its issue is read again at the next run.
Capped bool `yaml:"capped,omitempty"`
}
Pending is an act proposed to a person, as the report says it.
type Plan ¶
type Plan struct {
Decisions []Decision `yaml:"decisions"`
Findings []verdict.Finding `yaml:"findings"`
Record Record `yaml:"record"`
Report int `yaml:"report"` // the report issue, 0 when none is open yet
Changed bool `yaml:"changed"` // the record changed: wrong closings found, proposals settled
// contains filtered or unexported fields
}
Plan is what a run does with its acts, decided once, so a resumed run does the same.
func Decide ¶
func Decide(f forge.Backlog, repo, role string, settings map[string]Setting, closes map[int]Proposal, read []int, movedPercent int) (*Plan, error)
Decide plans the acts proposed, given at their place in the run. read lists the issues the run read: a proposal made only for a cap is dropped once its issue was read again, decided again or not. A run moves at most movedPercent of the open issues (milestone and order).
func (*Plan) ReportBody ¶
ReportBody is the report issue's body: what the run did and proposes.
type Proposal ¶
type Proposal struct {
Do string `yaml:"do"` // close or sources: the intention's kind
Issue int `yaml:"issue"`
Reason string `yaml:"reason,omitempty"`
DuplicateOf int `yaml:"duplicate-of,omitempty"`
Sources []string `yaml:"sources,omitempty"`
Milestone string `yaml:"milestone,omitempty"`
Title string `yaml:"title,omitempty"` // an issue to open
Quote *Quote `yaml:"quote"`
Why string `yaml:"why"`
// Refining: the sections written, Need and Validation as drafts; Added,
// the engine's, says which the body did not have yet.
Scope string `yaml:"scope,omitempty"`
Verification string `yaml:"verification,omitempty"`
Need string `yaml:"need,omitempty"`
Validation string `yaml:"validation,omitempty"`
Added []string `yaml:"added,omitempty"`
Questions string `yaml:"questions,omitempty"` // asking the reporter
// Ordering: the priority set (1 to 4); a milestone left because it is
// released (From, the engine's); and, the engine's, the issue's
// priority and milestone before the run, written in the report.
Priority int `yaml:"priority,omitempty"`
From string `yaml:"from,omitempty"`
Before string `yaml:"before,omitempty"`
}
Proposal is an act on an issue the agent proposed: a closing, or the code it is about named as its sources.
type Record ¶
type Record struct {
Closed []Closing `yaml:"closed,omitempty"`
Wrong []Closing `yaml:"wrong,omitempty"` // closings found wrong: their issue open again
Propose []string `yaml:"propose,flow,omitempty"` // kinds of act back to propose, until the person says
Proposed []Pending `yaml:"proposed,omitempty"` // acts proposed, kept until their issue is closed or proposed again
}
Record is what the role did, kept on its report issue.
type State ¶
type State struct {
Sources []string `yaml:"sources"`
Confirmed string `yaml:"confirmed"`
Judged string `yaml:"judged,omitempty"` // the commit the role last read it at
Comments int `yaml:"comments,omitempty"` // people's comments when it was last read
Body string `yaml:"body,omitempty"` // a digest of its body, when the role last read or wrote it
Priority int `yaml:"priority,omitempty"` // the priority the role last set: another on the issue is a person's
}
State is what the engine knows of an issue, kept in one comment on it.