github

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MPL-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

This section is empty.

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