Documentation
¶
Overview ¶
Package gh fetches the board's data from GitHub, reusing the session of the gh CLI through go-gh: gitboard never logs in on its own.
Index ¶
- Constants
- func SearchQuery(k Kind, login string) string
- type Check
- type Client
- func (c *Client) CommitFiles(repo, sha string) ([]string, error)
- func (c *Client) Commits() ([]Commit, error)
- func (c *Client) Issues() ([]Issue, error)
- func (c *Client) NewerThan(repo, rev string) (string, error)
- func (c *Client) PRDetail(repo string, number int) ([]Check, []Comment, error)
- func (c *Client) PRs(k Kind) ([]PR, error)
- func (c *Client) Readme(repo string) (string, error)
- func (c *Client) Repos() ([]Repo, error)
- type Comment
- type Commit
- type InlineComment
- type Issue
- type Kind
- type PR
- type Repo
Constants ¶
const Limit = 50
Limit is how many rows each view loads.
Variables ¶
This section is empty.
Functions ¶
func SearchQuery ¶
SearchQuery is the GitHub search string behind the PRs, Reviews and Issues views. Reviews drops your own PRs: those belong to PRs.
Types ¶
type Check ¶
type Check struct {
Name string // "Workflow / job" for Actions
State string // its conclusion once done (SUCCESS, FAILURE...), else its status (IN_PROGRESS, QUEUED...)
Required bool // branch protection needs it to pass
}
Check is one CI check of a PR's last commit: a check run (GitHub Actions and apps) or a commit status.
type Client ¶
type Client struct {
Login string
// contains filtered or unexported fields
}
func (*Client) CommitFiles ¶
CommitFiles lists the files a commit touched, as "status path" lines.
func (*Client) Commits ¶
Commits uses the REST commit search, which only indexes each repo's default branch: a commit on a feature branch shows up once merged.
func (*Client) NewerThan ¶
NewerThan returns the tip of the repo's default branch when it comes after rev, and "" when it is rev, behind it, or rev is not on GitHub.
func (*Client) PRDetail ¶
PRDetail returns the checks of a PR's last commit, and its comments and reviews, oldest first. ponytail: first 100 of each, paginate if a PR ever outgrows that.
type Comment ¶
type Comment struct {
Author string
Body string
State string // review: APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED, PENDING
At time.Time
Inline []InlineComment
}
Comment is one entry of a PR's conversation: a plain comment (State "") or a review, with the comments it left on the code.
type InlineComment ¶
type PR ¶
type PR struct {
Repo string
Number int
Title string
URL string
Body string
Draft bool
ReviewDecision string // APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED or ""
Checks string // SUCCESS, FAILURE, PENDING... or "" when there are none
CheckCounts map[string]int // how many checks are in each state (SUCCESS, FAILURE, SKIPPED...)
Base, Head string // branch names: Head merges into Base
Mergeable string // MERGEABLE, CONFLICTING or UNKNOWN
MergeState string // CLEAN, DIRTY, BEHIND, BLOCKED, UNSTABLE, DRAFT, HAS_HOOKS or UNKNOWN
UpdatedAt time.Time
}