github

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Setup GitHub client

pull request interactions - open/close/nag code reviewers for approval

Getting repos to perform the code changes in - probably choose between a GitHub search and graphql (?)

Getting repos to perform the code changes in - probably choose between a GitHub search and graphql (?)

Index

Constants

This section is empty.

Variables

View Source
var (
	AppConfigMissing   = errors.New("Config missing for AppID, InstallationID or PrivateKeyPath")
	TokenConfigMissing = errors.New("Config missing for GitHub Token")
)

Functions

This section is empty.

Types

type GithubClient

type GithubClient struct {
	Client       *github.Client
	Writer       sideband.Progress
	GlobalConfig *configs.GlobalConfig
	// contains filtered or unexported fields
}

func NewGithubClient

func NewGithubClient(globalConf configs.GlobalConfig, ctx context.Context, log *logrus.Entry) (*GithubClient, error)

Build a new GitHub client using the global config

func (*GithubClient) AssignDefaultReviewer

func (gc *GithubClient) AssignDefaultReviewer(pr *github.PullRequest) error

func (*GithubClient) Checkout

func (gc *GithubClient) Checkout(branch string, gitRepo *git.Repository, create bool) error

Checkout a local branch, switching the working tree

func (*GithubClient) CreatePullRequest

func (gc *GithubClient) CreatePullRequest(org, repo, title, body, base_branch, merge_branch string, asDraft bool) (string, error)

func (*GithubClient) Fetch

func (gc *GithubClient) Fetch(branch string, gitRepo *git.Repository) error

Fetch from remote branch

func (*GithubClient) FindPullRequest

func (gc *GithubClient) FindPullRequest(org, repo, baseBranch, headBranch string) (*github.PullRequest, error)

func (*GithubClient) GetAllRepos

func (gc *GithubClient) GetAllRepos(owner string) ([]string, error)

func (*GithubClient) GetDefaultBranch

func (gc *GithubClient) GetDefaultBranch(owner, repo string) (string, error)

Get the default branch set for the repo on GitHub

func (*GithubClient) GetMatchingPRs

func (gc *GithubClient) GetMatchingPRs(query string) ([]*github.PullRequest, error)

func (*GithubClient) GetMatchingRepos

func (gc *GithubClient) GetMatchingRepos(query string) ([]string, error)

Get all repos returned by a code search query

func (*GithubClient) GetPR

func (gc *GithubClient) GetPR(owner, repo string, number int) (*github.PullRequest, error)

func (*GithubClient) MergePullRequest added in v1.0.2

func (gc *GithubClient) MergePullRequest(pr *github.PullRequest) error

func (*GithubClient) Pull

func (gc *GithubClient) Pull(branch string, gitRepo *git.Repository) error

Pull from remote branch

func (*GithubClient) Push

func (gc *GithubClient) Push(branch string, gitRepo *git.Repository) error

Push to remote branch

func (*GithubClient) ShallowClone

func (gc *GithubClient) ShallowClone(org, repoName, dir, migrationBranchName string) (*git.Repository, error)

Clone the smallest version of a repo we can

func (*GithubClient) UpdatePullRequest

func (gc *GithubClient) UpdatePullRequest(pr *github.PullRequest, body string) error

type PRDataWorker added in v1.0.6

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

func NewPRDataWorker added in v1.0.6

func NewPRDataWorker(client *GithubClient) *PRDataWorker

Jump to

Keyboard shortcuts

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