Documentation
¶
Overview ¶
Package github loads your open PRs, the PRs you review and the issues assigned to you through the gh CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
Name string
State CheckState
}
type CheckState ¶
type CheckState int
CheckState is a CI check result normalized across CheckRun and StatusContext.
const ( CheckPass CheckState = iota CheckFail CheckPending CheckSkip )
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher keeps full PR data between polls and re-fetches only PRs that changed. It is used by one poll at a time.
func NewFetcher ¶
func NewFetcher() *Fetcher
type Issue ¶ added in v0.1.3
type Issue struct {
Repo string // owner/name
RepoName string // name
Number int
Title string
URL string
Author string
Body string
Labels []string
Comments int
CreatedAt time.Time
UpdatedAt time.Time
}
Issue is an open issue assigned to you.
type PR ¶
type PR struct {
Repo string // owner/name
RepoName string // name
Number int
Title string
URL string
Author string
Branch string
Base string
HeadOID string
IsDraft bool
Decision string // APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED or ""
CI string // rollup: SUCCESS, FAILURE, PENDING, ERROR, EXPECTED or ""
Checks []Check
Reviewers []Reviewer
Threads []Thread // unresolved only
UpdatedAt time.Time
// LastCommit is when the head commit was made: how long the PR has waited since the last push.
LastCommit time.Time
// LastFeedback is the newest review or comment by a human other than the author.
LastFeedback time.Time
Status Status
Mine bool
IsBot bool // author is a bot (dependabot, renovate, …)
}
func (PR) Unresolved ¶
Unresolved counts every open thread; Open counts only those waiting on the PR author.
type RateLimit ¶
type RateLimit struct {
Remaining int `json:"remaining"`
Limit int `json:"limit"`
ResetAt time.Time `json:"resetAt"`
}
RateLimit is the GraphQL budget left this hour (5,000 points for a user).
func FetchRateLimit ¶
FetchRateLimit reads the GraphQL budget over REST, which does not spend GraphQL points and still answers when the GraphQL budget is exhausted.
type Snapshot ¶ added in v0.1.3
type Snapshot struct {
Login string
Mine []PR // your open PRs
Review []PR // open PRs you review
Issues []Issue
Rate RateLimit
}
Snapshot is one poll's result.
type Status ¶
type Status int
Status is the dashboard's verdict on a PR.
func (Status) Actionable ¶
Actionable reports whether Enter should start an agent for a PR in this status.