Documentation ¶
Index ¶
- Constants
- Variables
- type ApproveOptions
- type DedupReviewer
- type Locker
- type MockReviewer
- func (_m *MockReviewer) Approve(ctx context.Context, _a1 id.PR, body string, opts ApproveOptions) error
- func (_m *MockReviewer) Comment(ctx context.Context, _a1 id.PR, body string) error
- func (_m *MockReviewer) EXPECT() *MockReviewer_Expecter
- func (_m *MockReviewer) RequestChanges(ctx context.Context, _a1 id.PR, body string) error
- type MockReviewer_Approve_Call
- func (_c *MockReviewer_Approve_Call) Return(_a0 error) *MockReviewer_Approve_Call
- func (_c *MockReviewer_Approve_Call) Run(run func(ctx context.Context, _a1 id.PR, body string, opts ApproveOptions)) *MockReviewer_Approve_Call
- func (_c *MockReviewer_Approve_Call) RunAndReturn(run func(context.Context, id.PR, string, ApproveOptions) error) *MockReviewer_Approve_Call
- type MockReviewer_Comment_Call
- func (_c *MockReviewer_Comment_Call) Return(_a0 error) *MockReviewer_Comment_Call
- func (_c *MockReviewer_Comment_Call) Run(run func(ctx context.Context, _a1 id.PR, body string)) *MockReviewer_Comment_Call
- func (_c *MockReviewer_Comment_Call) RunAndReturn(run func(context.Context, id.PR, string) error) *MockReviewer_Comment_Call
- type MockReviewer_Expecter
- func (_e *MockReviewer_Expecter) Approve(ctx interface{}, _a1 interface{}, body interface{}, opts interface{}) *MockReviewer_Approve_Call
- func (_e *MockReviewer_Expecter) Comment(ctx interface{}, _a1 interface{}, body interface{}) *MockReviewer_Comment_Call
- func (_e *MockReviewer_Expecter) RequestChanges(ctx interface{}, _a1 interface{}, body interface{}) *MockReviewer_RequestChanges_Call
- type MockReviewer_RequestChanges_Call
- func (_c *MockReviewer_RequestChanges_Call) Return(_a0 error) *MockReviewer_RequestChanges_Call
- func (_c *MockReviewer_RequestChanges_Call) Run(run func(ctx context.Context, _a1 id.PR, body string)) *MockReviewer_RequestChanges_Call
- func (_c *MockReviewer_RequestChanges_Call) RunAndReturn(run func(context.Context, id.PR, string) error) *MockReviewer_RequestChanges_Call
- type Reviewer
- func NewDedupReviewer(delegate Reviewer, api gh.API, serviceAccount string) Reviewer
- func NewMutexReviewer(delegate Reviewer, locker Locker) Reviewer
- func NewPreCondValidationReviewer(delegate Reviewer) Reviewer
- func NewRateLimitedReviewer(delegate Reviewer, api gh.API, throttler rate.Throttler) Reviewer
- func NewReviewer(dao gh.API, metrics metrics.Emitter) Reviewer
Constants ¶
const (
AutoMergeError = "Error enabling auto merge on PR"
)
const (
ListReviewsError = "error listing reviews on PR %v"
)
Variables ¶
var ErrAutoMergeDisabled = errors.New("auto merge is disabled in repo")
Functions ¶
This section is empty.
Types ¶
type ApproveOptions ¶
type ApproveOptions struct { AutoMergeEnabled bool DefaultBranch string MergeMethod githubv4.PullRequestMergeMethod }
type DedupReviewer ¶
type DedupReviewer struct {
// contains filtered or unexported fields
}
func (*DedupReviewer) Approve ¶
func (d *DedupReviewer) Approve(ctx context.Context, id id.PR, body string, opts ApproveOptions) error
Approve implements Reviewer.
func (*DedupReviewer) RequestChanges ¶
RequestChanges implements Reviewer.
type Locker ¶
type MockReviewer ¶
MockReviewer is an autogenerated mock type for the Reviewer type
func NewMockReviewer ¶
func NewMockReviewer(t interface { mock.TestingT Cleanup(func()) }) *MockReviewer
NewMockReviewer creates a new instance of MockReviewer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockReviewer) Approve ¶
func (_m *MockReviewer) Approve(ctx context.Context, _a1 id.PR, body string, opts ApproveOptions) error
Approve provides a mock function with given fields: ctx, _a1, body, opts
func (*MockReviewer) EXPECT ¶
func (_m *MockReviewer) EXPECT() *MockReviewer_Expecter
func (*MockReviewer) RequestChanges ¶
RequestChanges provides a mock function with given fields: ctx, _a1, body
type MockReviewer_Approve_Call ¶
MockReviewer_Approve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Approve'
func (*MockReviewer_Approve_Call) Return ¶
func (_c *MockReviewer_Approve_Call) Return(_a0 error) *MockReviewer_Approve_Call
func (*MockReviewer_Approve_Call) Run ¶
func (_c *MockReviewer_Approve_Call) Run(run func(ctx context.Context, _a1 id.PR, body string, opts ApproveOptions)) *MockReviewer_Approve_Call
func (*MockReviewer_Approve_Call) RunAndReturn ¶
func (_c *MockReviewer_Approve_Call) RunAndReturn(run func(context.Context, id.PR, string, ApproveOptions) error) *MockReviewer_Approve_Call
type MockReviewer_Comment_Call ¶
MockReviewer_Comment_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Comment'
func (*MockReviewer_Comment_Call) Return ¶
func (_c *MockReviewer_Comment_Call) Return(_a0 error) *MockReviewer_Comment_Call
func (*MockReviewer_Comment_Call) Run ¶
func (_c *MockReviewer_Comment_Call) Run(run func(ctx context.Context, _a1 id.PR, body string)) *MockReviewer_Comment_Call
func (*MockReviewer_Comment_Call) RunAndReturn ¶
func (_c *MockReviewer_Comment_Call) RunAndReturn(run func(context.Context, id.PR, string) error) *MockReviewer_Comment_Call
type MockReviewer_Expecter ¶
type MockReviewer_Expecter struct {
// contains filtered or unexported fields
}
func (*MockReviewer_Expecter) Approve ¶
func (_e *MockReviewer_Expecter) Approve(ctx interface{}, _a1 interface{}, body interface{}, opts interface{}) *MockReviewer_Approve_Call
Approve is a helper method to define mock.On call
- ctx context.Context
- _a1 id.PR
- body string
- opts ApproveOptions
func (*MockReviewer_Expecter) Comment ¶
func (_e *MockReviewer_Expecter) Comment(ctx interface{}, _a1 interface{}, body interface{}) *MockReviewer_Comment_Call
Comment is a helper method to define mock.On call
- ctx context.Context
- _a1 id.PR
- body string
func (*MockReviewer_Expecter) RequestChanges ¶
func (_e *MockReviewer_Expecter) RequestChanges(ctx interface{}, _a1 interface{}, body interface{}) *MockReviewer_RequestChanges_Call
RequestChanges is a helper method to define mock.On call
- ctx context.Context
- _a1 id.PR
- body string
type MockReviewer_RequestChanges_Call ¶
MockReviewer_RequestChanges_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestChanges'
func (*MockReviewer_RequestChanges_Call) Return ¶
func (_c *MockReviewer_RequestChanges_Call) Return(_a0 error) *MockReviewer_RequestChanges_Call
func (*MockReviewer_RequestChanges_Call) Run ¶
func (_c *MockReviewer_RequestChanges_Call) Run(run func(ctx context.Context, _a1 id.PR, body string)) *MockReviewer_RequestChanges_Call
func (*MockReviewer_RequestChanges_Call) RunAndReturn ¶
func (_c *MockReviewer_RequestChanges_Call) RunAndReturn(run func(context.Context, id.PR, string) error) *MockReviewer_RequestChanges_Call
type Reviewer ¶
type Reviewer interface { Approve(ctx context.Context, id id.PR, body string, opts ApproveOptions) error RequestChanges(ctx context.Context, id id.PR, body string) error Comment(ctx context.Context, id id.PR, body string) error }
func NewDedupReviewer ¶
NewDedupReviewer returns a new DedupReviewer