Documentation
¶
Index ¶
- Variables
- func IsPullRequestDiffTooLarge(err error) bool
- func IsRefUpdateConflict(err error) bool
- type CheckService
- type Comment
- type Issue
- type IssueFilters
- type IssueService
- type IssueUpdate
- type Label
- type LabelService
- type MergeMethod
- type MergeResult
- type Milestone
- type MilestoneService
- type MilestoneUpdate
- type PRFilters
- type Platform
- type PullRequest
- type PullRequestFile
- type PullRequestService
- type RepoInfo
- type RepositoryService
- type ReviewComment
- type ReviewEvent
- type Run
- type RunFilters
- type Runner
- type RunnerService
- type WorkflowJobDiagnostic
- type WorkflowRunDiagnostics
- type WorkflowService
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPullRequestDiffTooLarge = errors.New("pull request diff too large")
View Source
var ErrRefUpdateConflict = errors.New("git ref update conflict")
Functions ¶
func IsPullRequestDiffTooLarge ¶ added in v0.8.29
func IsRefUpdateConflict ¶ added in v0.8.23
Types ¶
type CheckService ¶
type CheckService interface {
// GetCombinedStatus returns the combined CI status for a ref (branch or SHA).
// Returns "success", "failure", "pending", or "error".
GetCombinedStatus(ctx context.Context, ref string) (string, error)
// RerunFailedChecks re-runs failed check suites for a ref.
RerunFailedChecks(ctx context.Context, ref string) error
}
type IssueFilters ¶
type IssueService ¶
type IssueService interface {
Create(ctx context.Context, title, body string, labels []string, milestone *int) (*Issue, error)
Get(ctx context.Context, number int) (*Issue, error)
List(ctx context.Context, filters IssueFilters) ([]*Issue, error)
Update(ctx context.Context, number int, changes IssueUpdate) (*Issue, error)
AddLabels(ctx context.Context, number int, labels []string) error
RemoveLabels(ctx context.Context, number int, labels []string) error
AddComment(ctx context.Context, number int, body string) error
AddCommentReturningID(ctx context.Context, number int, body string) (int64, error)
UpdateComment(ctx context.Context, commentID int64, body string) error
DeleteComment(ctx context.Context, commentID int64) error
ListComments(ctx context.Context, number int) ([]*Comment, error)
CreateCommentReaction(ctx context.Context, commentID int64, reaction string) error
}
type IssueUpdate ¶
type LabelService ¶
type MergeMethod ¶
type MergeMethod string
const ( MergeMethodMerge MergeMethod = "merge" MergeMethodSquash MergeMethod = "squash" MergeMethodRebase MergeMethod = "rebase" )
type MergeResult ¶
type MilestoneService ¶
type MilestoneService interface {
Create(ctx context.Context, title, description string, dueDate *time.Time) (*Milestone, error)
Get(ctx context.Context, number int) (*Milestone, error)
List(ctx context.Context) ([]*Milestone, error)
Update(ctx context.Context, number int, changes MilestoneUpdate) (*Milestone, error)
}
type MilestoneUpdate ¶
type Platform ¶
type Platform interface {
Issues() IssueService
PullRequests() PullRequestService
Workflows() WorkflowService
Labels() LabelService
Milestones() MilestoneService
Runners() RunnerService
Repository() RepositoryService
Checks() CheckService
}
Platform abstracts all interactions with the hosting platform (GitHub, GitLab, etc.).
type PullRequest ¶
type PullRequestFile ¶ added in v0.8.29
type PullRequestService ¶
type PullRequestService interface {
Create(ctx context.Context, title, body, head, base string) (*PullRequest, error)
Get(ctx context.Context, number int) (*PullRequest, error)
List(ctx context.Context, filters PRFilters) ([]*PullRequest, error)
Update(ctx context.Context, number int, title, body *string) (*PullRequest, error)
Merge(ctx context.Context, number int, method MergeMethod) (*MergeResult, error)
UpdateBranch(ctx context.Context, number int) error
CreateReview(ctx context.Context, number int, body string, event ReviewEvent) error
AddComment(ctx context.Context, number int, body string) error
ListReviewComments(ctx context.Context, number int) ([]*ReviewComment, error)
ListFiles(ctx context.Context, number int) ([]*PullRequestFile, error)
GetDiff(ctx context.Context, number int) (string, error)
Close(ctx context.Context, number int) error
}
type RepositoryService ¶
type RepositoryService interface {
GetInfo(ctx context.Context) (*RepoInfo, error)
GetDefaultBranch(ctx context.Context) (string, error)
CreateBranch(ctx context.Context, name, fromSHA string) error
DeleteBranch(ctx context.Context, name string) error
GetBranchSHA(ctx context.Context, name string) (string, error)
}
type ReviewComment ¶
type ReviewComment struct {
ID int64
Body string
AuthorLogin string
AuthorAssociation string // "OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR", "NONE", etc.
Path string // file path the comment is on
Line int // line number in the diff (0 if not anchored)
DiffHunk string // short diff hunk surrounding the comment
}
ReviewComment is an inline (line-level) comment on a pull request diff.
type ReviewEvent ¶
type ReviewEvent string
const ( ReviewApprove ReviewEvent = "APPROVE" ReviewRequestChanges ReviewEvent = "REQUEST_CHANGES" ReviewCommentEvent ReviewEvent = "COMMENT" )
type Run ¶
type Run struct {
ID int64
WorkflowID int64
WorkflowName string
WorkflowPath string
HeadBranch string
HeadSHA string
Status string // "queued", "in_progress", "completed"
Conclusion string // "success", "failure", "cancelled"
Inputs map[string]string // workflow_dispatch inputs
URL string
CreatedAt time.Time
}
type RunFilters ¶
type RunnerService ¶
type WorkflowJobDiagnostic ¶ added in v0.8.20
type WorkflowRunDiagnostics ¶ added in v0.8.20
type WorkflowService ¶
type WorkflowService interface {
GetWorkflow(ctx context.Context, filename string) (workflowID int64, err error)
Dispatch(ctx context.Context, workflowFile, ref string, inputs map[string]string) (*Run, error)
GetRun(ctx context.Context, runID int64) (*Run, error)
GetRunDiagnostics(ctx context.Context, runID int64) (*WorkflowRunDiagnostics, error)
ListRuns(ctx context.Context, filters RunFilters) ([]*Run, error)
CancelRun(ctx context.Context, runID int64) error
}
Click to show internal directories.
Click to hide internal directories.