Documentation
¶
Overview ¶
Package github fetches a PR snapshot from GitHub.
Index ¶
- func ParsePrRef(input string) (types.PrRef, error)
- type Client
- func (c *Client) FetchCommitFiles(ctx context.Context, pr types.PrRef, sha string) ([]string, error)
- func (c *Client) FetchFileAtRef(ctx context.Context, pr types.PrRef, path, ref string) (*string, error)
- func (c *Client) FetchPrSnapshot(ctx context.Context, pr types.PrRef) (*types.PrSnapshot, error)
- func (c *Client) PostInlineReply(ctx context.Context, pr types.PrRef, rootCommentID int64, body string) (*PostedReply, error)
- type PostedReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client is a thin wrapper around go-github plus a hand-rolled GraphQL helper.
func NewClient ¶
NewClient builds a GitHub client authenticated against the GITHUB_TOKEN or GH_TOKEN environment variables.
func (*Client) FetchCommitFiles ¶
func (c *Client) FetchCommitFiles(ctx context.Context, pr types.PrRef, sha string) ([]string, error)
FetchCommitFiles returns the list of file paths a commit touches.
func (*Client) FetchFileAtRef ¶
func (c *Client) FetchFileAtRef(ctx context.Context, pr types.PrRef, path, ref string) (*string, error)
FetchFileAtRef returns the content of a file at the given ref, or nil if it does not exist or cannot be decoded.
func (*Client) FetchPrSnapshot ¶
FetchPrSnapshot retrieves all the data review-replay needs for a single PR.
func (*Client) PostInlineReply ¶
func (c *Client) PostInlineReply(ctx context.Context, pr types.PrRef, rootCommentID int64, body string) (*PostedReply, error)
PostInlineReply posts a reply to an inline review thread whose root comment is rootCommentID. Returns the new comment's id + html_url on success.
type PostedReply ¶
PostedReply describes a successfully posted reply.