github

package
v0.0.0-...-e1d2556 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHub

type GitHub struct {
	AuthToken string
	User      string
}

GitHub holds the client information for connecting to the GitHub API

func (GitHub) Client

func (g GitHub) Client() *octokat.Client

Client initializes the authorization with the GitHub API

func (GitHub) DcoVerified

func (g GitHub) DcoVerified(pr *PullRequest) (bool, error)

DcoVerified checks if the pull request has been properly signed

func (*GitHub) GetContent

func (g *GitHub) GetContent(repo octokat.Repo, id int, isPR bool) (*PullRequestContent, error)

GetContent returns the content of the issue/pull request number passed.

func (GitHub) IsMergeable

func (g GitHub) IsMergeable(pr *PullRequest) (mergeable bool, err error)

IsMergeable makes sure the pull request can be merged

func (GitHub) IssueAddVersionLabel

func (g GitHub) IssueAddVersionLabel(issueHook *octokat.IssueHook) error

IssueAddVersionLabel adds a version label to an issue if it matches the regex

func (GitHub) LabelIssueComment

func (g GitHub) LabelIssueComment(issueHook *octokat.IssueHook) error

LabelIssueComment checks if someone has claimed dibs on this issue

func (GitHub) LoadPullRequest

func (g GitHub) LoadPullRequest(hook *octokat.PullRequestHook) (*PullRequest, error)

LoadPullRequest takes an incoming PullRequestHook and converts it to the PullRequest type

func (GitHub) MoveTriageForward

func (g GitHub) MoveTriageForward(repo *octokat.Repository, number int, comment *octokat.Comment) error

MoveTriageForward adds labels pertaining to the status of the pull request

type PullRequest

type PullRequest struct {
	Hook    *octokat.PullRequestHook
	Repo    octokat.Repo
	Content *PullRequestContent
	*octokat.PullRequest
}

PullRequest describes a github pull request

func (*PullRequest) Execdriver

func (pr *PullRequest) Execdriver() bool

Execdriver checks if the changes are to execdriver's directories.

func (PullRequest) ReleaseBase

func (pr PullRequest) ReleaseBase() bool

ReleaseBase checks if the pull request is being merged into the release branch

type PullRequestContent

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

PullRequestContent contains the files, commits, and comments for a given pull request

func (*PullRequestContent) AlreadyCommented

func (p *PullRequestContent) AlreadyCommented(commentType, user string) bool

AlreadyCommented checks if the user has already commented.

func (*PullRequestContent) CommitsSigned

func (p *PullRequestContent) CommitsSigned() bool

CommitsSigned checks if the commits are signed.

func (*PullRequestContent) Distribution

func (p *PullRequestContent) Distribution() bool

Distribution checks if the changes are to distribution's directories.

func (*PullRequestContent) FindComment

func (p *PullRequestContent) FindComment(commentType, user string) *octokat.Comment

FindComment finds a specific comment.

func (*PullRequestContent) HasDocsChanges

func (p *PullRequestContent) HasDocsChanges() bool

HasDocsChanges checks for docs changes.

func (*PullRequestContent) HasVendoringChanges

func (p *PullRequestContent) HasVendoringChanges() bool

HasVendoringChanges checks for vendoring changes.

func (*PullRequestContent) IsNonCodeOnly

func (p *PullRequestContent) IsNonCodeOnly() bool

IsNonCodeOnly chacks if only non code files are modified.

func (*PullRequestContent) OnlyFreebsd

func (p *PullRequestContent) OnlyFreebsd() bool

OnlyFreebsd checks if changes are only to freebsd specific files.

func (*PullRequestContent) OnlyWindows

func (p *PullRequestContent) OnlyWindows() bool

OnlyWindows checks if changes are only to windows specific files.

func (*PullRequestContent) Protobuf

func (p *PullRequestContent) Protobuf() bool

Protobuf checks if there are changes to protocol buffers definitions or code generated from them.

type PullRequestReviewCommentHook

type PullRequestReviewCommentHook struct {
	Action      string
	PullRequest *octokat.PullRequest
	Comment     *octokat.Comment
	Repo        *octokat.Repository
}

PullRequestReviewCommentHook describes the hook for a pull request comment

func ParsePullRequestReviewCommentHook

func ParsePullRequestReviewCommentHook(body io.Reader) (PullRequestReviewCommentHook, error)

ParsePullRequestReviewCommentHook parses the web hook recieved into a PullRequestReviewCommentHook

func (PullRequestReviewCommentHook) IsOpen

func (pr PullRequestReviewCommentHook) IsOpen() bool

IsOpen returns if the pull request is open

Jump to

Keyboard shortcuts

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