Documentation
¶
Index ¶
- func ParseRef(ref, repoHint string) (owner, repo string, number int, err error)
- func WriteIssueContext(outputDir string, issueInfo *IssueInfo, comments []IssueComment) ([]collector.FileInfo, error)
- func WriteManifest(outputDir string, result collector.CollectResult) error
- func WritePRContext(outputDir string, prInfo *PRInfo, reviewThreads []ReviewThread, diff string, ...) ([]collector.FileInfo, error)
- type CheckRun
- type CheckRunOutput
- type CheckRunsResponse
- type Client
- func (c *Client) FetchCheckRuns(ctx context.Context, owner, repo, ref string, maxResults int) ([]CheckRun, error)
- func (c *Client) FetchCombinedStatus(ctx context.Context, owner, repo, ref string) (*CombinedStatus, error)
- func (c *Client) FetchIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)
- func (c *Client) FetchIssueInfo(ctx context.Context, owner, repo string, issueNumber int) (*IssueInfo, error)
- func (c *Client) FetchPRDiff(ctx context.Context, owner, repo string, prNumber int) (string, error)
- func (c *Client) FetchPRInfo(ctx context.Context, owner, repo string, prNumber int) (*PRInfo, error)
- func (c *Client) FetchReviewThreads(ctx context.Context, owner, repo string, prNumber int, unresolvedOnly bool) ([]ReviewThread, error)
- func (c *Client) SetBaseURL(url string)
- type CombinedStatus
- type IssueComment
- type IssueInfo
- type PRInfo
- type Provider
- type Reply
- type ReviewThread
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRef ¶
ParseRef parses a reference string into owner, repo, and number Supports formats: - "123" or "#123" (requires repoHint) - "owner/repo#123" - "https://github.com/owner/repo/pull/123" - "https://github.com/owner/repo/issues/123"
func WriteIssueContext ¶
func WriteIssueContext(outputDir string, issueInfo *IssueInfo, comments []IssueComment) ([]collector.FileInfo, error)
WriteIssueContext writes issue context files and returns the list of files written
func WriteManifest ¶
func WriteManifest(outputDir string, result collector.CollectResult) error
WriteManifest writes the collection manifest to the output directory
func WritePRContext ¶
func WritePRContext(outputDir string, prInfo *PRInfo, reviewThreads []ReviewThread, diff string, checkRuns []CheckRun, combinedStatus *CombinedStatus) ([]collector.FileInfo, error)
WritePRContext writes PR context files and returns the list of files written
Types ¶
type CheckRun ¶
type CheckRun struct {
ID int64 `json:"id"`
Name string `json:"name"`
HeadSHA string `json:"head_sha"`
Status string `json:"status"` // queued, in_progress, completed
Conclusion string `json:"conclusion"` // success, failure, neutral, cancelled, skipped, timed_out, action_required
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
DetailsURL string `json:"details_url,omitempty"`
AppSlug string `json:"app_slug,omitempty"` // e.g., "github-actions"
CheckSuiteID int64 `json:"check_suite_id,omitempty"`
Output CheckRunOutput `json:"output,omitempty"`
}
CheckRun represents a GitHub check run
type CheckRunOutput ¶
type CheckRunOutput struct {
Title string `json:"title,omitempty"`
Summary string `json:"summary,omitempty"`
Text string `json:"text,omitempty"`
}
CheckRunOutput represents the output of a check run
type CheckRunsResponse ¶
type CheckRunsResponse struct {
TotalCount int `json:"total_count"`
CheckRuns []CheckRun `json:"check_runs"`
}
CheckRunsResponse is the API response for check runs
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides methods to fetch GitHub PR and Issue context
func (*Client) FetchCheckRuns ¶
func (c *Client) FetchCheckRuns(ctx context.Context, owner, repo, ref string, maxResults int) ([]CheckRun, error)
FetchCheckRuns fetches check runs for a commit ref See: https://docs.github.com/en/rest/checks/runs#list-check-runs-for-a-git-reference
func (*Client) FetchCombinedStatus ¶
func (c *Client) FetchCombinedStatus(ctx context.Context, owner, repo, ref string) (*CombinedStatus, error)
FetchCombinedStatus fetches the combined status for a commit ref See: https://docs.github.com/en/rest/commits/statuses#get-the-combined-status-for-a-specific-reference
func (*Client) FetchIssueComments ¶
func (c *Client) FetchIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)
FetchIssueComments fetches comments for an issue
func (*Client) FetchIssueInfo ¶
func (c *Client) FetchIssueInfo(ctx context.Context, owner, repo string, issueNumber int) (*IssueInfo, error)
FetchIssueInfo fetches basic issue information
func (*Client) FetchPRDiff ¶
FetchPRDiff fetches the unified diff for a PR
func (*Client) FetchPRInfo ¶
func (c *Client) FetchPRInfo(ctx context.Context, owner, repo string, prNumber int) (*PRInfo, error)
FetchPRInfo fetches basic PR information
func (*Client) FetchReviewThreads ¶
func (c *Client) FetchReviewThreads(ctx context.Context, owner, repo string, prNumber int, unresolvedOnly bool) ([]ReviewThread, error)
FetchReviewThreads fetches review comment threads for a PR
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for both the client and the helper (for testing)
type CombinedStatus ¶
type CombinedStatus struct {
SHA string `json:"sha"`
State string `json:"state"` // pending, success, failure, error
TotalCount int `json:"total_count"`
Statuses []Status `json:"statuses"`
}
CombinedStatus represents the combined status for a ref
type IssueComment ¶
type IssueComment struct {
CommentID int64 `json:"comment_id"`
URL string `json:"url"`
Body string `json:"body"`
Author string `json:"author"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
IsTrigger bool `json:"is_trigger,omitempty"` // true if this comment triggered holon
}
IssueComment represents a comment on an issue
type IssueInfo ¶
type IssueInfo struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
URL string `json:"url"`
Author string `json:"author"`
Assignee string `json:"assignee,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Repository string `json:"repository"`
Labels []string `json:"labels,omitempty"`
}
IssueInfo contains basic issue information
type PRInfo ¶
type PRInfo struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
URL string `json:"url"`
BaseRef string `json:"base_ref"`
HeadRef string `json:"head_ref"`
BaseSHA string `json:"base_sha"`
HeadSHA string `json:"head_sha"`
Author string `json:"author"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Repository string `json:"repository"`
MergeCommit string `json:"merge_commit_sha,omitempty"`
}
PRInfo contains basic pull request information
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the collector.Collector interface for GitHub
func (*Provider) Collect ¶
func (p *Provider) Collect(ctx context.Context, req collector.CollectRequest) (collector.CollectResult, error)
Collect gathers context and writes it to the output directory
type Reply ¶
type Reply struct {
CommentID int64 `json:"comment_id"`
URL string `json:"url"`
Body string `json:"body"`
Author string `json:"author"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
InReplyToID int64 `json:"in_reply_to_id"`
IsTrigger bool `json:"is_trigger,omitempty"` // true if this reply triggered holon
}
Reply represents a reply to a review comment
type ReviewThread ¶
type ReviewThread struct {
CommentID int64 `json:"comment_id"`
URL string `json:"url"`
Path string `json:"path"`
Line int `json:"line,omitempty"`
Side string `json:"side,omitempty"`
StartLine int `json:"start_line,omitempty"`
StartSide string `json:"start_side,omitempty"`
DiffHunk string `json:"diff_hunk"`
Body string `json:"body"`
Author string `json:"author"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Resolved bool `json:"resolved"`
InReplyToID int64 `json:"in_reply_to_id,omitempty"`
Position int `json:"position,omitempty"`
Replies []Reply `json:"replies,omitempty"`
IsTrigger bool `json:"is_trigger,omitempty"` // true if this comment triggered holon
}
ReviewThread represents a review comment thread
type Status ¶
type Status struct {
ID int64 `json:"id"`
Context string `json:"context"` // e.g., "ci/travis-ci", "coverage/coveralls"
State string `json:"state"` // pending, success, failure, error
TargetURL string `json:"target_url,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Status represents an individual status