Documentation
¶
Overview ¶
Package prinventory owns the remote pull-request inventory. It is separate from worktree discovery: the latter describes local WB-managed checkouts, while this package describes every open PR visible to GitHub for an owner.
Index ¶
- func RealSleep(ctx context.Context, d time.Duration) error
- func RenderMarkdown(report Report) string
- func ResolveOwners(extra []string, authUser func() (string, error), ...) ([]Owner, []Diagnostic)
- type Check
- type Counts
- type Diagnostic
- type Filters
- type Options
- type Owner
- type OwnerResult
- type PullRequest
- type Report
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RealSleep ¶
RealSleep is the production sleeper. It is deliberately not a default inside Inventory: a caller that supplies no Sleep never waits, so a test cannot reach a real timer by accident.
func RenderMarkdown ¶
RenderMarkdown renders a stable, reviewable snapshot. Rows are already sorted by Inventory; sorting again makes hand-built reports deterministic.
func ResolveOwners ¶
Types ¶
type Diagnostic ¶
type Filters ¶
type Filters struct {
State string `json:"state"`
IncludeArchived bool `json:"include_archived"`
CreatedBefore string `json:"created_before,omitempty"`
}
Filters is recorded in every report so an operator can see the scope that was actually queried, rather than inferring it from the rows returned.
type Options ¶
type Options struct {
Owners []Owner
ExcludeArchived bool
CreatedBefore string
Runner Runner
Now func() time.Time
Parallel int
// Sleep waits out a search rate limit. Nil means never wait (the limit is
// reported as an error); production passes RealSleep.
Sleep func(context.Context, time.Duration) error
// Notify reports a wait to the operator (stderr in the CLI).
Notify func(string)
// contains filtered or unexported fields
}
Options controls one immutable snapshot.
type Owner ¶
type Owner struct {
Login string `json:"login"`
Qualifier string `json:"qualifier"` // org or user
}
Owner identifies one GitHub search qualifier.
type OwnerResult ¶
type PullRequest ¶
type PullRequest struct {
ID string `json:"id,omitempty"`
Repository string `json:"repository"`
Number int `json:"number"`
Title string `json:"title"`
URL string `json:"url"`
Author string `json:"author,omitempty"`
Draft bool `json:"draft"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Mergeable string `json:"mergeable,omitempty"`
MergeStateStatus string `json:"merge_state_status,omitempty"`
Conflict bool `json:"conflict"`
Checks []Check `json:"checks,omitempty"`
}
type Report ¶
type Report struct {
SchemaVersion int `json:"schema_version"`
SnapshotAt time.Time `json:"snapshot_at"`
Complete bool `json:"complete"`
Owners []Owner `json:"owners"`
EffectiveFilters Filters `json:"effective_filters"`
Counts Counts `json:"counts"`
PullRequests []PullRequest `json:"pull_requests"`
OwnerResults []OwnerResult `json:"owner_results"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}