Documentation
¶
Index ¶
- func FormatReviewsPrompt(comments []ReviewComment) string
- func IssueBranchName(number int, title string) string
- func IssueTaskContent(issue *Issue) string
- type BranchStatus
- type Issue
- type PRManager
- func (pm *PRManager) CreatePR(branch, baseBranch, title, body string) (string, error)
- func (pm *PRManager) FetchPRReviews(branch string) ([]ReviewComment, error)
- func (pm *PRManager) GetBranchAndPRStatus(branch, repoDir string, wasPushed bool) (BranchStatus, error)
- func (pm *PRManager) GetFullPRStatus(branch string) (url, state string, err error)
- func (pm *PRManager) GetIssue(number int) (*Issue, error)
- func (pm *PRManager) GetPRCIStatus(branch string) (string, error)
- func (pm *PRManager) GetPRStatus(branch string) (string, error)
- func (pm *PRManager) IsInstalled() bool
- type ReviewComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatReviewsPrompt ¶
func FormatReviewsPrompt(comments []ReviewComment) string
FormatReviewsPrompt formats a list of review comments into a prompt suitable for sending to an AI coding agent.
func IssueBranchName ¶
IssueBranchName generates a Git branch name from an issue number and title. e.g. issue #42 "Add dark mode" → "issue-42-add-dark-mode"
func IssueTaskContent ¶
IssueTaskContent formats a GitHub issue as a TASK.md file for the AI agent.
Types ¶
type BranchStatus ¶
type BranchStatus struct {
Pushed bool
RemoteDeleted bool // branch was previously pushed but no longer exists in remote
RemoteCheckFailed bool // git ls-remote failed; Pushed/RemoteDeleted are unreliable
PRURL string
PRState string // "open", "merged", "closed", ""
MergeConflicts bool
CIStatus string // "success", "failure", "pending", ""
}
BranchStatus holds the combined branch push and PR status for a workspace.
type PRManager ¶
type PRManager struct {
// contains filtered or unexported fields
}
PRManager handles GitHub PR operations
func (*PRManager) FetchPRReviews ¶
func (pm *PRManager) FetchPRReviews(branch string) ([]ReviewComment, error)
FetchPRReviews returns only actionable, unresolved review comments for the PR associated with the given branch. Returns an empty slice if no PR exists.
General reviews: only CHANGES_REQUESTED reviews with a non-empty body are included. APPROVED, DISMISSED, and COMMENTED-only reviews are skipped.
Inline code comments: only comments belonging to unresolved review threads are included, determined via the GitHub GraphQL API.
func (*PRManager) GetBranchAndPRStatus ¶
func (pm *PRManager) GetBranchAndPRStatus(branch, repoDir string, wasPushed bool) (BranchStatus, error)
GetBranchAndPRStatus returns the combined remote branch existence and PR status for the given branch. repoDir is used as the working directory for git commands. wasPushed should reflect the previously known BranchPushed state so RemoteDeleted can be set correctly when the branch disappears from remote.
func (*PRManager) GetFullPRStatus ¶
GetFullPRStatus returns the URL and state of a PR for the given branch. State is lowercased: "open", "merged", or "closed".
func (*PRManager) GetPRCIStatus ¶
GetPRCIStatus returns the combined CI check status for the PR on the given branch. Returns "success", "failure", "pending", or "" if no checks exist.
func (*PRManager) GetPRStatus ¶
GetPRStatus checks if a PR exists for the given branch
func (*PRManager) IsInstalled ¶
IsInstalled reports whether the gh CLI is available on PATH. The result is cached after the first check.
type ReviewComment ¶
type ReviewComment struct {
Author string
Body string
State string // "CHANGES_REQUESTED", "APPROVED", "COMMENTED"
Path string // file path for inline comments; empty for general reviews
Line int // line number for inline comments; 0 for general reviews
}
ReviewComment represents a single review comment on a PR. General reviews have an empty Path and zero Line. Inline (code) comments have Path and Line set.