github

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SummaryMarker is the HTML comment marker used to identify Holon summary comments
	SummaryMarker = "<!-- holon-summary-marker -->"

	// BotLoginEnv is the environment variable for the bot's GitHub login
	BotLoginEnv = "HOLON_GITHUB_BOT_LOGIN"

	// DefaultBotLogin is the default bot login name
	DefaultBotLogin = "holonbot[bot]"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRun

type CheckRun struct {
	Name       string `json:"name"`
	Conclusion string `json:"conclusion"` // "failure", "success", "cancelled"
	FixStatus  string `json:"fix_status"` // "fixed", "unfixed", "not-applicable"
	Message    string `json:"message"`
}

CheckRun represents a CI/check run status update from pr-fix.json.

type CommentResult

type CommentResult struct {
	Posted    bool   `json:"posted"`
	Updated   bool   `json:"updated,omitempty"` // true if an existing comment was updated
	CommentID int64  `json:"comment_id,omitempty"`
	Error     string `json:"error,omitempty"`
}

CommentResult represents the result of posting/updating a summary comment.

type FollowUpIssue

type FollowUpIssue struct {
	Title              string   `json:"title"`
	Body               string   `json:"body"`
	DeferredCommentIDs []int64  `json:"deferred_comment_ids"`
	Labels             []string `json:"labels,omitempty"`
	IssueURL           string   `json:"issue_url,omitempty"`
}

FollowUpIssue represents a follow-up issue for deferred work.

type FollowUpIssueDetail

type FollowUpIssueDetail struct {
	Title    string `json:"title"`
	IssueURL string `json:"issue_url"`
}

FollowUpIssueDetail represents a created follow-up issue.

type FollowUpIssuesResult

type FollowUpIssuesResult struct {
	Created       []FollowUpIssueDetail `json:"created,omitempty"`
	CreatedCount  int                   `json:"created_count"`
	DeferredCount int                   `json:"deferred_count"`
}

FollowUpIssuesResult represents the result of handling follow-up issues.

type GitHubPublisher

type GitHubPublisher struct {
	// contains filtered or unexported fields
}

GitHubPublisher publishes Holon outputs to GitHub PRs.

func NewGitHubPublisher

func NewGitHubPublisher() *GitHubPublisher

NewGitHubPublisher creates a new GitHub publisher instance.

func (*GitHubPublisher) Name

func (g *GitHubPublisher) Name() string

Name returns the provider name.

func (*GitHubPublisher) Publish

Publish sends Holon outputs to GitHub PR.

func (*GitHubPublisher) Validate

func (g *GitHubPublisher) Validate(req publisher.PublishRequest) error

Validate checks if the request is valid for this publisher.

type PRFixData

type PRFixData struct {
	ReviewReplies  []ReviewReply   `json:"review_replies"`
	FollowUpIssues []FollowUpIssue `json:"follow_up_issues,omitempty"`
	Checks         []CheckRun      `json:"checks"`
}

PRFixData represents the parsed pr-fix.json file.

type PRRef

type PRRef struct {
	Owner    string
	Repo     string
	PRNumber int
}

PRRef represents a parsed GitHub PR reference. Supports formats: "owner/repo/pr/123", "owner/repo#123", "owner/repo/pull/123"

func ParsePRRef

func ParsePRRef(target string) (*PRRef, error)

ParsePRRef parses a PR reference string into its components. Supported formats:

  • owner/repo/pr/123
  • owner/repo#123
  • owner/repo/pull/123

func (PRRef) String

func (r PRRef) String() string

String returns the string representation of the PR reference.

type PublishResult

type PublishResult struct {
	// Summary comment result
	SummaryComment CommentResult `json:"summary_comment"`

	// Review replies results
	ReviewReplies ReviewRepliesResult `json:"review_replies"`

	// Overall success
	Success bool `json:"success"`
}

PublishResult contains the outcome of a GitHub publish operation.

type ReplyResult

type ReplyResult struct {
	CommentID int64  `json:"comment_id"`
	Status    string `json:"status"` // "posted", "skipped", "failed"
	Reason    string `json:"reason,omitempty"`
}

ReplyResult represents the result of posting a single review reply.

type ReviewRepliesResult

type ReviewRepliesResult struct {
	Total   int           `json:"total"`
	Posted  int           `json:"posted"`
	Skipped int           `json:"skipped"`
	Failed  int           `json:"failed"`
	Details []ReplyResult `json:"details,omitempty"`
}

ReviewRepliesResult represents the aggregated results of posting review replies.

type ReviewReply

type ReviewReply struct {
	CommentID   int64   `json:"comment_id"`
	Status      string  `json:"status"` // "fixed", "wontfix", "need-info", "deferred"
	Message     string  `json:"message"`
	ActionTaken *string `json:"action_taken,omitempty"`
}

ReviewReply represents a single review comment reply from pr-fix.json.

Jump to

Keyboard shortcuts

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