github

package
v0.0.0-...-5ad7534 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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

func NewBackend(owner, repo, token string) *Backend

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

func (b *Backend) GetComments(ctx context.Context, pr *provider.PRInfo) ([]provider.Comment, error)

GetComments retrieves all comments on a pull request. Fetches both issue comments (general) and review comments (inline).

func (*Backend) GetPR

func (b *Backend) GetPR(ctx context.Context, id string) (*provider.PRInfo, error)

GetPR retrieves pull request information by ID or URL.

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

func (b *Backend) MatchesURL(rawURL string) bool

MatchesURL returns true if the URL belongs to GitHub.

func (*Backend) Name

func (b *Backend) Name() string

Name returns "github".

func (*Backend) PostComment

func (b *Backend) PostComment(ctx context.Context, pr *provider.PRInfo, body string) error

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 (b *Backend) RetryBuild(ctx context.Context, pr *provider.PRInfo, buildID string) error

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

Jump to

Keyboard shortcuts

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