Documentation
¶
Overview ¶
Package row derives what the plugin reports of a pull request from the pull request and its events alone: its situation, the source part of its row's payload, its views and facets, its card, its items, its link signals and its workflow facts. The host lays its own state over them.
Index ¶
- Constants
- func MineAuthor(p Payload) bool
- func NeedsMe(kind situation.Kind, waitingOn string, p Payload) bool
- func People(waitingOn string, p Payload) []src.Person
- func Person(login string) src.Person
- func Stamp(t time.Time) string
- type Checks
- type Facts
- type Input
- type LastHuman
- type Override
- type Payload
- type Row
- func (r Row) Card() *src.Card
- func (r Row) Due() time.Time
- func (r Row) Events() []pr.Event
- func (r Row) Facts() []src.Fact
- func (r Row) InScope() bool
- func (r Row) Items() []src.Item
- func (r Row) Kind() situation.Kind
- func (r Row) Link() string
- func (r Row) Mine() bool
- func (r Row) Report() src.Snapshot
- func (r Row) Signals() []src.Signal
- func (r Row) Stalled() bool
- type Workspace
Constants ¶
const ( ToneNeutral = "neutral" ToneGood = "good" ToneWarn = "warn" ToneBad = "bad" )
The tones of a card's signals.
const ( FacetRepo = "repo" FacetAuthor = "author" FacetStatus = "status" FacetCI = "ci" FacetScope = "scope" FacetOpened = "opened" )
The facets of a row whose values the plugin reports; the host derives the facets that read its own state or the row's situation after its overlays.
const ( SignalStalled = "stalled" SignalInLoop = "in_loop" SignalReady = "ready" SignalWorkspace = "workspace" )
The link signals plugin.toml declares.
const ItemFollow = "gh:follow"
ItemFollow is the item of a followed pull request that asks nothing else: it waits on whoever the pull request waits on, or on the loop, so the pull request keeps its one task.
const SignalSituation = "situation"
SignalSituation is the key of a card's first signal, whose value is the situation's kind; the host words it.
const ViewMine = "mine"
ViewMine is the plugin's view of the viewer's own or adopted open pull requests.
Variables ¶
This section is empty.
Functions ¶
func MineAuthor ¶
MineAuthor says the viewer authored the pull request of p.
func NeedsMe ¶
NeedsMe is the needs-me predicate of a situation: it waits on the user, asks, holds or is the user's own to fix, in scope or in the loop.
Types ¶
type Facts ¶
type Facts struct {
CreatedAt time.Time `json:"created_at,omitzero"`
ChangedFiles int `json:"changed_files"`
Checks Checks `json:"checks"`
}
Facts are the pull request's facts a row shows.
type Input ¶
type Input struct {
PR pr.PR
Events []pr.Event
Override pr.Override
// Detail is the pull request's full read; nil before one.
Detail *store.Detail
Viewer string
Teams []string
// Ignore are who a row never waits on: automated reviewers and the
// reviewers an address round skips.
Ignore []string
Stalled situation.Thresholds
// AddressedAt is when the pull request's driving turn, an address turn,
// reached its state; zero without one.
AddressedAt time.Time
// MaxDetailAge is the oldest detail the plugin calls fresh.
MaxDetailAge time.Duration
// Loop is the loop's name, as items it asks of the user name it.
Loop string
Now time.Time
// Location is the calendar pr.silent_days counts midnights in; nil counts UTC's.
Location *time.Location
}
Input is what one pull request's report derives from.
type LastHuman ¶
type LastHuman struct {
Who string `json:"who"`
What string `json:"what"` // the event kind: opened, push, review, comment
At time.Time `json:"at"`
Link string `json:"link"`
}
LastHuman is the newest human event on the pull request not by the viewer.
type Override ¶
type Override struct {
Adopted bool `json:"adopted,omitempty"`
Tracked bool `json:"tracked,omitempty"`
}
Override is what the user set on the pull request that the plugin keeps.
type Payload ¶
type Payload struct {
Author string `json:"author"`
Repo string `json:"repo"`
Head string `json:"head"`
Approved bool `json:"approved"`
Reasons []string `json:"reasons"`
Workspace Workspace `json:"workspace"`
Override Override `json:"override,omitzero"`
Facts *Facts `json:"facts,omitempty"`
Viewer string `json:"viewer"`
LastHuman *LastHuman `json:"last_human,omitempty"`
}
Payload is the source part of a row's payload, in the keys the clients read; the host adds its own: the mute, the brief, the intake and the turns.
type Row ¶
type Row struct {
PR pr.PR
Situation situation.Result
Payload Payload
Views []string
Facets map[string][]string
// contains filtered or unexported fields
}
Row is a pull request's source row: its situation and the source part of its payload, views and facets.
func (Row) Due ¶
Due is the first instant after the input's now at which the report changes with time alone: the situation stalls, a held round's day ends, or a day of silence passes; zero for none.
func (Row) Facts ¶
Facts are the row's workflow facts that read the pull request alone; the host adds those that read its own state.
func (Row) InScope ¶
InScope says the row has reasons, a review workspace, or is adopted or tracked.
func (Row) Items ¶
Items are the pull request's items from its source row, every one keyed on the pull request so they are the asks of its one task: what waits on the viewer when the row needs them or is the viewer's own to merge, staff or answer, what waits on others in scope, and otherwise, while the pull request is open and followed, ItemFollow. A held or blocked round asks through its gate, never an item.
type Workspace ¶
type Workspace struct {
ID string `json:"id"`
DisplayName string `json:"display_name"`
Status string `json:"status"`
IsReview bool `json:"is_review"`
AgentStates []string `json:"agent_states"`
Comment string `json:"comment"`
IsMain bool `json:"is_main"`
}
Workspace is the workspace a row shows.