review

package
v0.0.0-...-b5dc63d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AutoMergeError = "Error enabling auto merge on PR"
)
View Source
const (
	ListReviewsError = "error listing reviews on PR %v"
)

Variables

View Source
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) Comment

func (d *DedupReviewer) Comment(ctx context.Context, id id.PR, body string) error

Comment implements Reviewer.

func (*DedupReviewer) RequestChanges

func (d *DedupReviewer) RequestChanges(ctx context.Context, id id.PR, body string) error

RequestChanges implements Reviewer.

type Locker

type Locker interface {
	AcquireLockWithContext(ctx context.Context, key string, opts ...dynamolock.AcquireLockOption) (*dynamolock.Lock, error)
	ReleaseLockWithContext(ctx context.Context, lockItem *dynamolock.Lock, opts ...dynamolock.ReleaseLockOption) (bool, error)
}

func NewLocker

func NewLocker(DDB *dynamodb.Client, table string) (Locker, error)

type MockReviewer

type MockReviewer struct {
	mock.Mock
}

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) Comment

func (_m *MockReviewer) Comment(ctx context.Context, _a1 id.PR, body string) error

Comment provides a mock function with given fields: ctx, _a1, body

func (*MockReviewer) EXPECT

func (_m *MockReviewer) EXPECT() *MockReviewer_Expecter

func (*MockReviewer) RequestChanges

func (_m *MockReviewer) RequestChanges(ctx context.Context, _a1 id.PR, body string) error

RequestChanges provides a mock function with given fields: ctx, _a1, body

type MockReviewer_Approve_Call

type MockReviewer_Approve_Call struct {
	*mock.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 (*MockReviewer_Approve_Call) Run

func (*MockReviewer_Approve_Call) RunAndReturn

type MockReviewer_Comment_Call

type MockReviewer_Comment_Call struct {
	*mock.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 (*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

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

type MockReviewer_RequestChanges_Call struct {
	*mock.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 (*MockReviewer_RequestChanges_Call) Run

func (*MockReviewer_RequestChanges_Call) RunAndReturn

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

func NewDedupReviewer(delegate Reviewer, api gh.API, serviceAccount string) Reviewer

NewDedupReviewer returns a new DedupReviewer

func NewMutexReviewer

func NewMutexReviewer(delegate Reviewer, locker Locker) Reviewer

func NewPreCondValidationReviewer

func NewPreCondValidationReviewer(delegate Reviewer) Reviewer

func NewRateLimitedReviewer

func NewRateLimitedReviewer(delegate Reviewer, api gh.API, throttler rate.Throttler) Reviewer

func NewReviewer

func NewReviewer(dao gh.API, metrics metrics.Emitter) Reviewer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL