Documentation
¶
Index ¶
- func BranchName(botIdentity, repoName, scheduleKey, fingerprint string) string
- type API
- type CreateRequest
- type GitHubClient
- func (c *GitHubClient) Create(ctx context.Context, owner, repo string, req CreateRequest) (PullRequest, 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) 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)
- type PullRequest
- type UpdateRequest
- type UpsertInput
- 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 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) EnsureFileContent ¶
func (*GitHubClient) EnsureHeadRef ¶
func (c *GitHubClient) EnsureHeadRef(ctx context.Context, owner, repo, headBranch, baseBranch string) 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)
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 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.