Documentation
¶
Index ¶
- func BranchName(botIdentity, repoName, scheduleKey, fingerprint string) string
- type API
- type CommentAPI
- type CreateRequest
- type GitHubClient
- func (c *GitHubClient) Create(ctx context.Context, owner, repo string, req CreateRequest) (PullRequest, error)
- func (c *GitHubClient) CreateIssueComment(ctx context.Context, owner, repo string, issueNumber int, body string) (IssueComment, error)
- func (c *GitHubClient) EnsureFileContent(ctx context.Context, owner, repo, branch, filePath, commitMessage string, ...) (bool, error)
- func (c *GitHubClient) EnsureHeadRef(ctx context.Context, owner, repo, headBranch, baseBranch string) error
- func (c *GitHubClient) ListIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)
- func (c *GitHubClient) ListOpenByHead(ctx context.Context, owner, repo, headBranch, baseBranch string) ([]PullRequest, error)
- func (c *GitHubClient) Update(ctx context.Context, owner, repo string, number int, req UpdateRequest) (PullRequest, error)
- func (c *GitHubClient) UpdateIssueComment(ctx context.Context, owner, repo string, commentID int, body string) (IssueComment, error)
- type IssueComment
- type PullRequest
- type UpdateRequest
- type UpsertInput
- type UpsertIssueCommentInput
- type UpsertIssueCommentResult
- type UpsertResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchName ¶
BranchName returns a deterministic branch name for remediation runs.
Types ¶
type API ¶
type API interface {
EnsureHeadRef(ctx context.Context, owner, repo, headBranch, baseBranch string) error
EnsureFileContent(ctx context.Context, owner, repo, branch, filePath, commitMessage string, content []byte) (bool, error)
ListOpenByHead(ctx context.Context, owner, repo, headBranch, baseBranch string) ([]PullRequest, error)
Create(ctx context.Context, owner, repo string, req CreateRequest) (PullRequest, error)
Update(ctx context.Context, owner, repo string, number int, req UpdateRequest) (PullRequest, error)
}
API abstracts GitHub PR APIs for deterministic tests and retry behavior.
type CommentAPI ¶ added in v1.0.2
type CommentAPI interface {
ListIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)
CreateIssueComment(ctx context.Context, owner, repo string, issueNumber int, body string) (IssueComment, error)
UpdateIssueComment(ctx context.Context, owner, repo string, commentID int, body string) (IssueComment, error)
}
CommentAPI abstracts issue comment APIs for deterministic PR comment upserts.
type CreateRequest ¶
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func NewGitHubClient(baseURL, token string, client *http.Client) *GitHubClient
func (*GitHubClient) Create ¶
func (c *GitHubClient) Create(ctx context.Context, owner, repo string, req CreateRequest) (PullRequest, error)
func (*GitHubClient) CreateIssueComment ¶ added in v1.0.2
func (c *GitHubClient) CreateIssueComment(ctx context.Context, owner, repo string, issueNumber int, body string) (IssueComment, error)
func (*GitHubClient) EnsureFileContent ¶
func (*GitHubClient) EnsureHeadRef ¶
func (c *GitHubClient) EnsureHeadRef(ctx context.Context, owner, repo, headBranch, baseBranch string) error
func (*GitHubClient) ListIssueComments ¶ added in v1.0.2
func (c *GitHubClient) ListIssueComments(ctx context.Context, owner, repo string, issueNumber int) ([]IssueComment, error)
func (*GitHubClient) ListOpenByHead ¶
func (c *GitHubClient) ListOpenByHead(ctx context.Context, owner, repo, headBranch, baseBranch string) ([]PullRequest, error)
func (*GitHubClient) Update ¶
func (c *GitHubClient) Update(ctx context.Context, owner, repo string, number int, req UpdateRequest) (PullRequest, error)
func (*GitHubClient) UpdateIssueComment ¶ added in v1.0.2
func (c *GitHubClient) UpdateIssueComment(ctx context.Context, owner, repo string, commentID int, body string) (IssueComment, error)
type IssueComment ¶ added in v1.0.2
IssueComment is a minimal deterministic PR comment contract.
type PullRequest ¶
type PullRequest struct {
Number int `json:"number"`
URL string `json:"url"`
Title string `json:"title"`
Body string `json:"body"`
Head string `json:"head"`
Base string `json:"base"`
}
PullRequest is a minimal deterministic PR contract used by wrkr fix automation.
type UpdateRequest ¶
type UpsertInput ¶
type UpsertIssueCommentInput ¶ added in v1.0.2
type UpsertIssueCommentResult ¶ added in v1.0.2
type UpsertIssueCommentResult struct {
Action string `json:"action"`
Comment IssueComment `json:"comment"`
}
func UpsertIssueComment ¶ added in v1.0.2
func UpsertIssueComment(ctx context.Context, api CommentAPI, in UpsertIssueCommentInput) (UpsertIssueCommentResult, error)
type UpsertResult ¶
type UpsertResult struct {
Action string `json:"action"`
PullRequest PullRequest `json:"pull_request"`
}
func Upsert ¶
func Upsert(ctx context.Context, api API, in UpsertInput) (UpsertResult, error)
Click to show internal directories.
Click to hide internal directories.