Documentation
¶
Index ¶
- Constants
- func CardOf(r api.Row, s prrow.Report) (card.Card, error)
- func FactsOf(d FactsDeps) *factsgithub.Provider
- func IdentityOf(st viewerStore) func(context.Context) (items.Person, error)
- func ItemsOf(r api.Row, s prrow.Report) []items.Item
- func KeepIdentity(ctx context.Context, st *inventory.Store, id src.Identity) error
- func MyTeams(ctx context.Context, st *inventory.Store) ([]string, error)
- type Budget
- type Cards
- type FactsDeps
- type Holdings
- type Limiter
- type PRStates
- type Refresher
- type ReportedInputs
- func (r ReportedInputs) Ended(ctx context.Context, kind string, units []unit.Unit) (map[unit.Unit]bool, error)
- func (r ReportedInputs) Facts(ctx context.Context, rows []dinv.PR, viewer string) (map[unit.Unit]dinv.PlanFacts, error)
- func (r ReportedInputs) PR(ctx context.Context, ref pr.Ref) (dinv.PR, bool, error)
- func (r ReportedInputs) Rows(ctx context.Context) ([]dinv.PR, error)
- func (r ReportedInputs) Viewer(ctx context.Context) (string, error)
- type TurnPayloads
- type UnitEvents
- type WorkspaceOverrides
- type WorkspaceRows
Constants ¶
const ( MarkAddressedReviews = "addressed.reviews" MarkAddressedChecks = "addressed.checks" MarkAddressedConflict = "addressed.conflict" MarkFirstSkipped = "first.skipped" )
The GitHub plugin's round marks, as the host's in-process GitHub paths still write and read them: the first-round skip of a removal or a dismissal, and an address round's reason.
const ( // CommandClone clones a repository: clone <owner>/<name> <path>. CommandClone = "clone" // CommandAuth checks that gh is installed and logged in; it exits // ExitNoGH when gh is not installed. CommandAuth = "auth" // CommandReviewedRepos lists the repositories of the pull requests the // viewer reviewed since a date: reviewed-repos <yyyy-mm-dd>, one // owner/name a line, once per pull request. CommandReviewedRepos = "reviewed-repos" // CommandTeams lists the viewer's teams, one org/slug a line. CommandTeams = "teams" )
The commands plugin.toml declares, which the host runs through the GitHub plugin.
const ( // ActionBasics reads a pull request's basics: its answer is the // pr.PullRequest as JSON. ActionBasics = "pr.basics" // ActionAdopt takes a pull request over into the loop. ActionAdopt = "pr.adopt" // ActionRefresh reads a pull request in full into the plugin's store // and reports it. ActionRefresh = "pr.refresh" )
The GitHub plugin's actions the host calls.
const EffectNudged = "pr.nudged"
EffectNudged is the GitHub plugin's draft effect the in-process publisher and proposals read, as its manifest declares it.
const ExitNoGH = 127
ExitNoGH is the exit of a command that found no gh to run, the shell's "command not found".
const ViewBudget = "budget"
ViewBudget is the GitHub plugin's view of its API budget.
Variables ¶
This section is empty.
Functions ¶
func CardOf ¶ added in v0.3.0
CardOf is the card the plugin reported in s, under the overlays of r, the pull request's row: the row says why, on whom and since when, its situation signal is the row's kind, a mute snoozes it, and a stall the row shows is a note on it counting from when the situation began.
func FactsOf ¶ added in v0.3.0
func FactsOf(d FactsDeps) *factsgithub.Provider
FactsOf are GitHub's workflow facts over d: the plugin's reports under the host's overlays.
func IdentityOf ¶ added in v0.3.0
IdentityOf is the user as GitHub knows them: the stored viewer login.
func ItemsOf ¶ added in v0.3.0
ItemsOf are the items the plugin reported in s, under the overlays of r, the pull request's row, every one keyed on the pull request so they are the asks of its one task. A pending round asks through its plan gate, so it keeps the items of the situation under it, as a muted row keeps those of its unmuted one. Where the host's turn overlays a situation the plugin did not report, the pull request waits on the loop while it works and on the user when it stopped or waits with no question, which its gate asks; it asks nothing once done.
func KeepIdentity ¶ added in v0.3.0
KeepIdentity keeps id, the viewer as the GitHub plugin names them, in st: the login and the teams the in-process rows and facts read.
Types ¶
type Budget ¶ added in v0.3.0
type Budget struct{ Limiter Limiter }
Budget is the GitHub budget as the daemon reads it.
type Cards ¶ added in v0.3.0
Cards are the pull requests' cards and items: the ones the GitHub plugin reported, under the overlays the host laid on their rows.
type FactsDeps ¶ added in v0.3.0
type FactsDeps struct {
Reports readmodel.Reports
Store *inventory.Store
WS *workspace.Set
Git gitx.Git
Cfg config.Config
Clock port.Clock
Intents func() *dintent.Registry
Changes port.Changes
Rounds sweep.Rounds
Books sweep.Books
// Mutes are the user's mutes of pull requests; nil mutes none.
Mutes readmodel.Mutes
}
FactsDeps are what GitHub's workflow facts read in the host's process.
type Holdings ¶ added in v0.3.0
type Holdings struct {
PRs WorkspaceRows
Overrides WorkspaceOverrides
}
Holdings are the pull requests the workspaces hold, matched as the sweep matches them: by the manager's link, else by the head branch.
type PRStates ¶ added in v0.4.0
PRStates are the pull requests as the GitHub plugin last reported them.
type Refresher ¶ added in v0.4.0
type Refresher struct {
PRs PRStates
Read func(ctx context.Context, ref pr.Ref) error
Every time.Duration
Now func() time.Time
}
Refresher reads a pull request in full again when the plugin's last report of it may be stale: never reported, or not seen for Every. A merge is final, so a merged one is never read again.
type ReportedInputs ¶ added in v0.3.0
ReportedInputs are the pull requests the GitHub plugin last reported, as the facts, the holdings and a round's send read them: each row and its full read from its snapshot, the viewer the host keeps, the ended events from the host's log.
func (ReportedInputs) Facts ¶ added in v0.3.0
func (r ReportedInputs) Facts(ctx context.Context, rows []dinv.PR, viewer string) (map[unit.Unit]dinv.PlanFacts, error)
Facts are rows as their reported full reads hold them; a read of another version gives a zero ReadAt, as the plugin has yet to read it again.
func (ReportedInputs) PR ¶ added in v0.3.0
PR is ref as the plugin last reported it; false when it reported none.
type TurnPayloads ¶ added in v0.3.0
type TurnPayloads struct{ Plugin turn.PayloadReader }
TurnPayloads is GitHub's turn payload: the GitHub plugin's, which Plugin reads, and the pull request a host round hands the turn, its prior review anchored to the head the loop's last record covered.
func (TurnPayloads) CompletePayload ¶ added in v0.3.0
CompletePayload is the caller's pull request at the request's unit, its prior review anchored; a payload of another kind stays as it is.
func (TurnPayloads) SyntheticPayload ¶ added in v0.3.0
SyntheticPayload is the pull request u names, read from nowhere; a probe's carries the probe's title.
type UnitEvents ¶ added in v0.3.0
type UnitEvents struct {
Store *inventory.Store
PRs PRStates
// Fresh is how recently the plugin must have seen a closed pull request
// for its close to count.
Fresh time.Duration
Now func() time.Time
}
UnitEvents reads a pull request's stored reviews and merge, and its close from its reported state, as the resolver's events.
func (UnitEvents) UnitEvents ¶ added in v0.3.0
func (e UnitEvents) UnitEvents(ctx context.Context, u unit.Unit, since time.Time) ([]link.Event, error)
UnitEvents are u's events at or after since, oldest first. A dismissal is no review. A close is the reported pull request's, while it is closed and seen within Fresh: the stored close events outlive a reopening, which records no event, and a report goes stale on one no sweep reads.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ghsourcetest holds the GitHub plugin's synthetic rows: one per situation kind, viewer's or others' pull request, in or out of scope, muted or not, each derived by prrow's real deriver.
|
Package ghsourcetest holds the GitHub plugin's synthetic rows: one per situation kind, viewer's or others' pull request, in or out of scope, muted or not, each derived by prrow's real deriver. |
|
Package present is the GitHub plugin's source logic the daemon reaches through Action and View: the user's mutes, the rows of pull requests the read model does not list, the detail, the checks, Explore and the timings; and its bookkeeping on each snapshot of the rows.
|
Package present is the GitHub plugin's source logic the daemon reaches through Action and View: the user's mutes, the rows of pull requests the read model does not list, the detail, the checks, Explore and the timings; and its bookkeeping on each snapshot of the rows. |