Documentation
¶
Overview ¶
Package round holds the values of the loop's automatic rounds.
Index ¶
- Constants
- func DayKey(t time.Time) string
- type Changes
- type Count
- type Day
- type Fields
- type Note
- type PR
- type Pause
- type Pending
- type Store
- func (s *Store) AgentHome(key string) string
- func (s *Store) CapReason(key string, now time.Time, perPR int) string
- func (s *Store) Changes() Changes
- func (s *Store) ClearFirstRoundSkipped(key string)
- func (s *Store) Count(key string, now time.Time)
- func (s *Store) FirstCapHit(key string, now time.Time) bool
- func (s *Store) FirstNote(note string, now time.Time) bool
- func (s *Store) FirstRoundSkipped(key string) bool
- func (s *Store) HeldToday(now time.Time) []string
- func (s *Store) Mark(key, name string) string
- func (s *Store) RecordSent(key, mark, fingerprint string, now time.Time)
- func (s *Store) Saved()
- func (s *Store) SetAgentHome(key, dir string)
- func (s *Store) SetHeads(key, checksHead, conflictHead string)
- func (s *Store) SetMark(key, name, value string)
- func (s *Store) SkipFirstRound(key string)
Constants ¶
const ( // Reviewed is my last review and the head on a PR I review. Reviewed = "reviewed" // AddressedReviews is the newest review triaged on a PR I develop. AddressedReviews = "addressed.reviews" // AddressedChecks is the head whose failing checks a triage round covered. AddressedChecks = "addressed.checks" // AddressedConflict is the head whose conflict with the base a triage // round covered. AddressedConflict = "addressed.conflict" )
The marks the rounds of a pull request write, by what they covered.
const ( NoteCap = "cap" NoteText = "note" )
The kinds of a Note.
const CapReached = "turns.per_unit_per_day reached"
CapReached starts the refusal of a unit whose turns.per_unit_per_day is spent.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Changes ¶
type Changes struct {
PRs map[string]Fields
// Marks are the marks set or removed, by PR.
Marks map[string]map[string]bool
Counts []Count
Notes []Note
}
Changes are what the setters changed since the store was loaded or last saved: a repository writes only these, so two snapshots that change different fields of one PR both keep their change.
type Count ¶
type Count struct{ Day, Key string }
Count is one round counted against the caps of Day.
type PR ¶
type PR struct {
// Marks are what the rounds covered, by mark name; see mark.Handled.
Marks map[string]string
SentAt time.Time
// AgentHome is the agent home of the session that asked for the review,
// reused by the rounds the watch starts.
AgentHome string
// FirstRoundSkipped is set when the user skipped the automatic first
// round; the sweep does not plan another one.
FirstRoundSkipped bool
}
type Pause ¶
Pause holds every workflow that does not observe and board moves everywhere when On, else on the repositories in Repos. A pull request's own pause is its override's Hold.
type Pending ¶
Pending is an automatic round that waits for the user's answer until Deadline, then runs.
type Store ¶
type Store struct {
PRs map[string]PR
Days map[string]Day
// contains filtered or unexported fields
}
Store remembers which reviews already got their follow-up and how many follow-ups each day sent.
func (*Store) CapReason ¶
CapReason returns why an automated round for key may not run today, or "".
func (*Store) ClearFirstRoundSkipped ¶
func (*Store) Count ¶ added in v0.2.0
Count spends one of key's turns of now's day, which CapReason reads.
func (*Store) FirstCapHit ¶
FirstCapHit records that the cap hit for key was printed today and reports whether this is the first time.
func (*Store) FirstNote ¶
FirstNote records that note was printed today and reports whether this is the first time.
func (*Store) FirstRoundSkipped ¶
func (*Store) RecordSent ¶ added in v0.2.0
RecordSent notes an automated round sent, spends one of key's turns of now's day, and sets its mark to fingerprint; an empty fingerprint keeps the mark as it was, for a round no review started.
func (*Store) Saved ¶
func (s *Store) Saved()
Saved forgets the changes once a repository wrote them.
func (*Store) SetAgentHome ¶
func (*Store) SetHeads ¶ added in v0.2.0
SetHeads marks the failing checks and the conflict of the heads an address round covered; an empty head leaves its mark as it was.