Documentation
¶
Overview ¶
Package github is muster's small GitHub REST client: the repository and pull-request shapes, the pull-request listing the GitHub App reads with an installation token (internal/githubapp), and the API base both follow.
⚠ IT HELD THE PER-USER OAUTH CONNECTION TOO — the encrypted token store, the OAuth web flow and the token-based listings the Repos tab used. All of that was removed with the Repos tab: the GitHub App is muster's GitHub identity. The `github_connection` table that store wrote is dropped by migration 0059.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIBaseURL ¶
func APIBaseURL() string
APIBaseURL is the API base every GitHub call uses (UseAPIBaseURL's value), so another client (internal/githubapp) follows the same override.
func UseAPIBaseURL ¶
func UseAPIBaseURL(u string)
UseAPIBaseURL points every GitHub call at another API base. Only the e2eterm browser-test build calls it (its fake GitHub); a deployable binary never does.
func ValidRepoName ¶ added in v0.108.0
ValidRepoName reports whether s is a GitHub owner/name. It is THE shape check for a repository muster is told about by name: a task's repository (internal/api connectedRepo) and an officer's configured repository (internal/officers Parse) ask it, so the two cannot accept different shapes.
Types ¶
type PullRequest ¶
type PullRequest struct {
Number int `json:"number"`
Title string `json:"title"`
State string `json:"state"`
HTMLURL string `json:"html_url"`
User string `json:"user"`
HeadRef string `json:"head_ref"`
BaseRef string `json:"base_ref"`
Draft bool `json:"draft"`
UpdatedAt string `json:"updated_at"`
}
PullRequest is a repository pull request, flattened for the worker tool. The GitHub API nests author/branch under user/head/base; ListPullRequestsAt maps those into the flat fields below.
func ListPullRequestsAt ¶
func ListPullRequestsAt(ctx context.Context, base, token, repo, state string) ([]PullRequest, error)
ListPullRequestsAt returns a repo's pull requests from the API at base (newest-updated first, up to 50). repo is "owner/name". state is one of "open", "closed", "all"; an empty or unrecognized value defaults to "open". The token stays server-side — it is never returned to the caller.