Documentation
¶
Index ¶
- type Backend
- func (b *Backend) CreatePR(ctx context.Context, params provider.CreatePRParams) (*provider.PRInfo, error)
- func (b *Backend) FindExistingPR(ctx context.Context, sourceBranch string) (*provider.PRInfo, error)
- func (b *Backend) GetBuildLogs(ctx context.Context, pr *provider.PRInfo, buildID string) (string, error)
- func (b *Backend) GetComments(ctx context.Context, pr *provider.PRInfo) ([]provider.Comment, error)
- func (b *Backend) GetPR(ctx context.Context, id string) (*provider.PRInfo, error)
- func (b *Backend) GetPipelineStatus(ctx context.Context, pr *provider.PRInfo) (*provider.PipelineStatus, error)
- func (b *Backend) MatchesURL(rawURL string) bool
- func (b *Backend) Name() string
- func (b *Backend) PostComment(ctx context.Context, pr *provider.PRInfo, body string) error
- func (b *Backend) PostInlineComment(ctx context.Context, pr *provider.PRInfo, comment provider.InlineComment) error
- func (b *Backend) ReplyToComment(ctx context.Context, pr *provider.PRInfo, threadID string, body string) error
- func (b *Backend) ResolveComment(ctx context.Context, pr *provider.PRInfo, threadID string, ...) error
- func (b *Backend) RetryBuild(ctx context.Context, pr *provider.PRInfo, buildID string) error
- func (b *Backend) RunWorkflow(ctx context.Context, pr *provider.PRInfo, action provider.WorkflowAction) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements provider.PRBackend for GitHub.
func NewBackend ¶
NewBackend creates a new GitHub backend for the given owner/repo. Uses go-github-ratelimit middleware for automatic rate limit handling.
func (*Backend) CreatePR ¶
func (b *Backend) CreatePR(ctx context.Context, params provider.CreatePRParams) (*provider.PRInfo, error)
CreatePR returns ErrUnsupported — GitHub PR creation is not yet implemented.
func (*Backend) FindExistingPR ¶
func (b *Backend) FindExistingPR(ctx context.Context, sourceBranch string) (*provider.PRInfo, error)
FindExistingPR returns ErrUnsupported — GitHub PR search is not yet implemented.
func (*Backend) GetBuildLogs ¶
func (b *Backend) GetBuildLogs(ctx context.Context, pr *provider.PRInfo, buildID string) (string, error)
GetBuildLogs retrieves and distills build logs for a specific workflow run, focusing on failed jobs and their error output.
func (*Backend) GetComments ¶
GetComments retrieves all comments on a pull request. Fetches both issue comments (general) and review comments (inline).
func (*Backend) GetPipelineStatus ¶
func (b *Backend) GetPipelineStatus(ctx context.Context, pr *provider.PRInfo) (*provider.PipelineStatus, error)
GetPipelineStatus returns the CI/CD pipeline status for a pull request. Queries both GitHub Check Runs and legacy Commit Statuses for a complete picture.
func (*Backend) MatchesURL ¶
MatchesURL returns true if the URL belongs to GitHub.
func (*Backend) PostComment ¶
PostComment posts a general comment on a pull request.
func (*Backend) PostInlineComment ¶
func (b *Backend) PostInlineComment(ctx context.Context, pr *provider.PRInfo, comment provider.InlineComment) error
PostInlineComment posts a comment on a specific file and line in the PR diff. Uses CreateReview with a single comment to avoid secondary rate limits.
func (*Backend) ReplyToComment ¶
func (b *Backend) ReplyToComment(ctx context.Context, pr *provider.PRInfo, threadID string, body string) error
ReplyToComment adds a reply to an existing review comment thread. threadID must be the root comment ID of the thread.
func (*Backend) ResolveComment ¶
func (b *Backend) ResolveComment(ctx context.Context, pr *provider.PRInfo, threadID string, resolution provider.CommentResolution) error
ResolveComment resolves a review thread using the GitHub GraphQL API. threadID must be the thread's node ID (e.g., "PRRT_..."). REST API cannot resolve threads — GraphQL is required.
func (*Backend) RetryBuild ¶
func (*Backend) RunWorkflow ¶
func (b *Backend) RunWorkflow(ctx context.Context, pr *provider.PRInfo, action provider.WorkflowAction) error
RunWorkflow returns ErrUnsupported for all workflow actions. GitHub does not have equivalents for ADO-specific workflow operations: - AutoComplete: GitHub has auto-merge but it works differently - CreateWorkItem: GitHub Issues are separate from PR workflows - AddressBot: No MerlinBot equivalent on GitHub