forked from github/gh-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_interface.go
More file actions
28 lines (26 loc) · 1.24 KB
/
Copy pathclient_interface.go
File metadata and controls
28 lines (26 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package github
// ClientOps defines the interface for GitHub API operations.
// The concrete Client type satisfies this interface.
// Tests can substitute a MockClient.
type ClientOps interface {
FindPRForBranch(branch string) (*PullRequest, error)
FindPRByNumber(number int) (*PullRequest, error)
FindPRDetailsForBranch(branch string) (*PRDetails, error)
CreatePR(base, head, title, body string, draft bool) (*PullRequest, error)
UpdatePRBase(number int, base string) error
MarkPRReadyForReview(prID string) error
DisableAutoMerge(prID string) error
ListStacks() ([]RemoteStack, error)
FindStackForPR(prNumber int) (*RemoteStack, error)
GetStack(stackNumber int) (*RemoteStack, error)
CreateStack(prNumbers []int) (*RemoteStack, error)
AddToStack(stackNumber int, prNumbers []int) (*RemoteStack, error)
Unstack(stackNumber int) (*RemoteStack, bool, error)
RepoMergeConfig() (*RepoMergeConfig, error)
MergeStackAsync(prNumber int, method, mergeAction string) (*AsyncMergeResult, error)
GetAsyncMergeResult(prNumber int, uuid string) (*AsyncMergeResult, error)
PRTitles(numbers []int) (map[int]string, error)
BaseBranchUsesMergeQueue(baseRef string) (bool, error)
}
// Compile-time check that Client satisfies ClientOps.
var _ ClientOps = (*Client)(nil)