githubcomments

package
v0.0.0-...-dc022f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package githubcomments reads GitHub pull request comments into stable reports.

Package githubcomments fetches and renders GitHub pull request comments via gh.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderText

func RenderText(w io.Writer, report Report)

RenderText writes a human-readable pull request comment report.

Types

type IssueComment

type IssueComment struct {
	ID        int64  `json:"id"`
	Author    string `json:"author"`
	Body      string `json:"body"`
	CreatedAt string `json:"created_at,omitempty"`
	URL       string `json:"url,omitempty"`
}

IssueComment describes a top-level pull request issue comment.

type Options

type Options struct {
	PR     string
	Repo   string
	GHPath string
}

Options configures a pull request comment fetch.

type Report

type Report struct {
	Kind           string          `json:"kind"`
	Status         string          `json:"status"`
	Repository     string          `json:"repository"`
	Number         int             `json:"number"`
	URL            string          `json:"url,omitempty"`
	Total          int             `json:"total"`
	IssueComments  []IssueComment  `json:"issue_comments,omitempty"`
	ReviewComments []ReviewComment `json:"review_comments,omitempty"`
}

Report summarizes issue and review comments for a pull request.

func BuildReport

func BuildReport(viewJSON []byte, issueJSON []byte, reviewJSON []byte, repoOverride string) (Report, error)

BuildReport parses GitHub CLI and REST API JSON into a stable comment report.

func Fetch

func Fetch(ctx context.Context, opts Options) (Report, error)

Fetch retrieves pull request comments using the GitHub CLI.

type ReviewComment

type ReviewComment struct {
	ID           int64  `json:"id"`
	Author       string `json:"author"`
	Body         string `json:"body"`
	Path         string `json:"path,omitempty"`
	Line         int    `json:"line,omitempty"`
	OriginalLine int    `json:"original_line,omitempty"`
	DiffHunk     string `json:"diff_hunk,omitempty"`
	InReplyToID  int64  `json:"in_reply_to_id,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	URL          string `json:"url,omitempty"`
}

ReviewComment describes an inline pull request review comment.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL