github

package
v0.0.0-...-c9da2d3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package github is a generated GoMock package.

Package github is a generated GoMock package.

Package github is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitHubClient

func NewGitHubClient(ctx context.Context, token string) *github.Client

func PRHasLabel

func PRHasLabel(pr *github.PullRequest, label string) bool

Types

type BaseData

type BaseData struct {
	AppName     string
	Commit      Commit
	Markup      string
	UpstreamURL string
}

type Commit

type Commit struct {
	Message string
	SHA     string
}

type IssueData

type IssueData struct {
	BaseData
	Error error
}

func (*IssueData) ProcessError

func (is *IssueData) ProcessError() *process.Error

type IssueHelper

type IssueHelper interface {
	Create(ctx context.Context, err error, upstreamURL string, commit *object.Commit) (*github.Issue, error)
	ListAllOpen(ctx context.Context, includePRs bool) ([]*github.Issue, error)
	Assign(ctx context.Context, issue *github.Issue, usersLogin ...string) error
}

type IssueHelperImpl

type IssueHelperImpl struct {
	// contains filtered or unexported fields
}

func NewIssueHelper

func NewIssueHelper(gc *github.Client, markup string, name *RepoName) *IssueHelperImpl

func (*IssueHelperImpl) Assign

func (ih *IssueHelperImpl) Assign(ctx context.Context, issue *github.Issue, usersLogin ...string) error

func (*IssueHelperImpl) Create

func (ih *IssueHelperImpl) Create(ctx context.Context, err error, upstreamURL string, commit *object.Commit) (*github.Issue, error)

func (*IssueHelperImpl) ListAllOpen

func (ih *IssueHelperImpl) ListAllOpen(ctx context.Context, includePRs bool) ([]*github.Issue, error)

type MockIssueHelper

type MockIssueHelper struct {
	// contains filtered or unexported fields
}

MockIssueHelper is a mock of IssueHelper interface.

func NewMockIssueHelper

func NewMockIssueHelper(ctrl *gomock.Controller) *MockIssueHelper

NewMockIssueHelper creates a new mock instance.

func (*MockIssueHelper) Assign

func (m *MockIssueHelper) Assign(ctx context.Context, issue *github.Issue, usersLogin ...string) error

Assign mocks base method.

func (*MockIssueHelper) Create

func (m *MockIssueHelper) Create(ctx context.Context, err error, upstreamURL string, commit *object.Commit) (*github.Issue, error)

Create mocks base method.

func (*MockIssueHelper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIssueHelper) ListAllOpen

func (m *MockIssueHelper) ListAllOpen(ctx context.Context, includePRs bool) ([]*github.Issue, error)

ListAllOpen mocks base method.

type MockIssueHelperMockRecorder

type MockIssueHelperMockRecorder struct {
	// contains filtered or unexported fields
}

MockIssueHelperMockRecorder is the mock recorder for MockIssueHelper.

func (*MockIssueHelperMockRecorder) Assign

func (mr *MockIssueHelperMockRecorder) Assign(ctx, issue interface{}, usersLogin ...interface{}) *gomock.Call

Assign indicates an expected call of Assign.

func (*MockIssueHelperMockRecorder) Create

func (mr *MockIssueHelperMockRecorder) Create(ctx, err, upstreamURL, commit interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockIssueHelperMockRecorder) ListAllOpen

func (mr *MockIssueHelperMockRecorder) ListAllOpen(ctx, includePRs interface{}) *gomock.Call

ListAllOpen indicates an expected call of ListAllOpen.

type MockPRHelper

type MockPRHelper struct {
	// contains filtered or unexported fields
}

MockPRHelper is a mock of PRHelper interface.

func NewMockPRHelper

func NewMockPRHelper(ctrl *gomock.Controller) *MockPRHelper

NewMockPRHelper creates a new mock instance.

func (*MockPRHelper) Create

func (m *MockPRHelper) Create(ctx context.Context, branch, base, upstreamURL string, commit *object.Commit, draft bool) (*github.PullRequest, error)

Create mocks base method.

func (*MockPRHelper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPRHelper) ListAllOpen

func (m *MockPRHelper) ListAllOpen(ctx context.Context, filter PRFilterFunc) ([]*github.PullRequest, error)

ListAllOpen mocks base method.

func (*MockPRHelper) MakeReady

func (m *MockPRHelper) MakeReady(ctx context.Context, pr *github.PullRequest) error

MakeReady mocks base method.

type MockPRHelperMockRecorder

type MockPRHelperMockRecorder struct {
	// contains filtered or unexported fields
}

MockPRHelperMockRecorder is the mock recorder for MockPRHelper.

func (*MockPRHelperMockRecorder) Create

func (mr *MockPRHelperMockRecorder) Create(ctx, branch, base, upstreamURL, commit, draft interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockPRHelperMockRecorder) ListAllOpen

func (mr *MockPRHelperMockRecorder) ListAllOpen(ctx, filter interface{}) *gomock.Call

ListAllOpen indicates an expected call of ListAllOpen.

func (*MockPRHelperMockRecorder) MakeReady

func (mr *MockPRHelperMockRecorder) MakeReady(ctx, pr interface{}) *gomock.Call

MakeReady indicates an expected call of MakeReady.

type MockUserHelper

type MockUserHelper struct {
	// contains filtered or unexported fields
}

MockUserHelper is a mock of UserHelper interface.

func NewMockUserHelper

func NewMockUserHelper(ctrl *gomock.Controller) *MockUserHelper

NewMockUserHelper creates a new mock instance.

func (*MockUserHelper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockUserHelper) GetCommitAuthor

func (m *MockUserHelper) GetCommitAuthor(ctx context.Context, sha string) (*github.User, error)

GetCommitAuthor mocks base method.

type MockUserHelperMockRecorder

type MockUserHelperMockRecorder struct {
	// contains filtered or unexported fields
}

MockUserHelperMockRecorder is the mock recorder for MockUserHelper.

func (*MockUserHelperMockRecorder) GetCommitAuthor

func (mr *MockUserHelperMockRecorder) GetCommitAuthor(ctx, sha interface{}) *gomock.Call

GetCommitAuthor indicates an expected call of GetCommitAuthor.

type PRData

type PRData BaseData

type PRFilterFunc

type PRFilterFunc = func(*github.PullRequest) bool

type PRHelper

type PRHelper interface {
	Create(ctx context.Context, branch, base, upstreamURL string, commit *object.Commit, draft bool) (*github.PullRequest, error)
	ListAllOpen(ctx context.Context, filter PRFilterFunc) ([]*github.PullRequest, error)
	MakeReady(ctx context.Context, pr *github.PullRequest) error
}

type PRHelperImpl

type PRHelperImpl struct {
	// contains filtered or unexported fields
}

func NewPRHelper

func NewPRHelper(gc *github.Client, ghgql api.GQLClient, markup string, repoName *RepoName) *PRHelperImpl

func (*PRHelperImpl) Create

func (ph *PRHelperImpl) Create(ctx context.Context, branch, base, upstreamURL string, commit *object.Commit, draft bool) (*github.PullRequest, error)

func (*PRHelperImpl) ListAllOpen

func (ph *PRHelperImpl) ListAllOpen(ctx context.Context, filter PRFilterFunc) ([]*github.PullRequest, error)

func (*PRHelperImpl) MakeReady

func (ph *PRHelperImpl) MakeReady(ctx context.Context, pr *github.PullRequest) error

type RepoName

type RepoName struct {
	Owner string
	Repo  string
}

func ParseRepoName

func ParseRepoName(s string) (*RepoName, error)

func ParseURL

func ParseURL(s string) (*RepoName, error)

func (*RepoName) String

func (rn *RepoName) String() string

type UserHelper

type UserHelper interface {
	GetCommitAuthor(ctx context.Context, sha string) (*github.User, error)
}

func NewUserHelper

func NewUserHelper(gc *github.Client, repoName *RepoName) UserHelper

type UserHelperImpl

type UserHelperImpl struct {
	// contains filtered or unexported fields
}

func (*UserHelperImpl) GetCommitAuthor

func (uh *UserHelperImpl) GetCommitAuthor(ctx context.Context, sha string) (*github.User, error)

Jump to

Keyboard shortcuts

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