github

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckStatusUnknown checkStatus = iota
	CheckStatusPending
	CheckStatusPass
	CheckStatusFail
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubInfo

type GitHubInfo struct {
	UserName     string
	RepositoryID string
	LocalBranch  string
	PullRequests []*PullRequest
}

type GitHubInterface

type GitHubInterface interface {
	GetInfo(ctx context.Context, gitcmd git.GitInterface) *GitHubInfo
	CreatePullRequest(ctx context.Context, info *GitHubInfo, commit git.Commit, prevCommit *git.Commit) *PullRequest
	UpdatePullRequest(ctx context.Context, info *GitHubInfo, pr *PullRequest, commit git.Commit, prevCommit *git.Commit)
	CommentPullRequest(ctx context.Context, pr *PullRequest, comment string)
	MergePullRequest(ctx context.Context, pr *PullRequest)
	ClosePullRequest(ctx context.Context, pr *PullRequest)
}

type PullRequest

type PullRequest struct {
	ID         string
	Number     int
	FromBranch string
	ToBranch   string
	Commit     git.Commit
	Title      string

	MergeStatus PullRequestMergeStatus
	Merged      bool
}

func SortPullRequests

func SortPullRequests(prs []*PullRequest, config *config.Config) []*PullRequest

SortPullRequests sorts the pull requests so that the one that is on top of

master will come first followed by the ones that are stacked on top.

The stack order is maintained so that multiple pull requests can be merged in

the correct order.

func (*PullRequest) Mergeable

func (pr *PullRequest) Mergeable(config *config.Config) bool

func (*PullRequest) Ready

func (pr *PullRequest) Ready(config *config.Config) bool

func (*PullRequest) StatusString

func (pr *PullRequest) StatusString(config *config.Config) string

func (*PullRequest) String

func (pr *PullRequest) String(config *config.Config) string

type PullRequestMergeStatus

type PullRequestMergeStatus struct {
	ChecksPass     checkStatus
	ReviewApproved bool
	NoConflicts    bool
	Stacked        bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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