Documentation
¶
Overview ¶
Package quiet reaches into the areas of a repo that the gathered PRs miss. When the PR limit stops the PRs before the date bound does, history starts where the PRs do, so a long-lived area with little recent work has no PR or change gathered and comes out thin or folded into a neighbour. For each cluster of files that change together in the history between the date bound and the PRs' start, and that no later change touches, Reach finds the PRs of its newest few changes through the forge and gives them, with those changes, to the gather. It reads the forge and never writes to it.
Index ¶
Constants ¶
const PerCluster = 3
PerCluster is the most PRs Reach gathers for one quiet cluster. A first guess, to be tuned from real runs (measure-before-budget).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Summary ¶
type Summary struct {
Clusters int `json:"clusters"`
PRs int `json:"prs"`
Why string `json:"why,omitempty"`
}
Summary says what Reach did: how many clusters were quiet, how many PRs it gathered for them, and why it stopped early, when it did.
func Add ¶
Add keeps the changes of g since histSince, where its PRs start, and adds to g what Reach finds in the older ones. It returns what Reach did.
func Reach ¶
func Reach(recent, older []store.GatheredChange, f forge.Forge, have map[int]bool) ([]store.GatheredPR, []store.GatheredChange, Summary)
Reach returns the PRs and changes to add to a gather whose PRs reach back only as far as recent's changes: for each cluster of older's changes (reading.Clusters) none of whose files a change of recent touches, the PRs of its PerCluster newest changes in older that touch it, with those changes, skipping PRs have holds. older is newest first. A PR the forge gives without a title or a merge date takes its change's subject and date. A forge that cannot answer stops Reach, and the Summary says why; what was found before is kept.