Documentation
¶
Index ¶
- func BuildPRReview(results []markdown.FileResult, event, body string) *gh.PullRequestReviewRequest
- type Client
- func (c *Client) FetchFileContent(ctx context.Context, ref *PRRef, path, headSHA string) ([]byte, error)
- func (c *Client) GetHeadSHA(ctx context.Context, ref *PRRef) (string, error)
- func (c *Client) ListMDFiles(ctx context.Context, ref *PRRef) ([]PRFile, error)
- func (c *Client) SubmitReview(ctx context.Context, ref *PRRef, review *gh.PullRequestReviewRequest) error
- type PRFile
- type PRRef
- type PRReviewComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPRReview ¶
func BuildPRReview(results []markdown.FileResult, event, body string) *gh.PullRequestReviewRequest
BuildPRReview builds a GitHub PR review request from file review results.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the go-github client for PR operations.
func NewClient ¶
NewClient creates a GitHub client using available authentication. Priority: GITHUB_TOKEN env var > gh auth token command.
func NewClientWithHTTP ¶
NewClientWithHTTP creates a Client with a custom HTTP client (for testing).
func (*Client) FetchFileContent ¶
func (c *Client) FetchFileContent(ctx context.Context, ref *PRRef, path, headSHA string) ([]byte, error)
FetchFileContent fetches a file's content at the given ref (SHA or branch).
func (*Client) GetHeadSHA ¶
GetHeadSHA returns the head commit SHA for a pull request.
func (*Client) ListMDFiles ¶
ListMDFiles returns all .md files changed/added in a PR with their patches. Deleted files are excluded.
func (*Client) SubmitReview ¶
func (c *Client) SubmitReview(ctx context.Context, ref *PRRef, review *gh.PullRequestReviewRequest) error
SubmitReview posts a PR review with inline comments.
type PRRef ¶
PRRef identifies a GitHub pull request.
func ParsePRURL ¶
ParsePRURL parses a GitHub PR URL into its components. Accepts: https://github.com/{owner}/{repo}/pull/{number}
type PRReviewComment ¶
type PRReviewComment struct {
Path string
Body string
Line int
StartLine int // 0 = single line
Side string // "RIGHT" or "LEFT"
}
PRReviewComment represents a single inline comment on a PR.
func MapComment ¶
func MapComment(c markdown.ReviewComment, path string, doc *markdown.Document) *PRReviewComment
MapComment converts a commd ReviewComment to a GitHub PR review comment. Overview (file-level) comments are skipped — not supported by the GitHub API.