github

package
v0.0.0-...-9e15be4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2015 License: Apache-2.0 Imports: 9 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEachCandidatePRDo

func ForEachCandidatePRDo(client *github.Client, user, project string, fn PRFunction, once bool, config *FilterConfig) error

For each PR in the project that matches:

  • pr.Number > minPRNumber
  • is mergeable
  • has labels "cla: yes", "lgtm"
  • combinedStatus = 'success' (e.g. all hooks have finished success in github)

Run the specified function

func GetAllEventsForPR

func GetAllEventsForPR(client *github.Client, user, project string, prNumber int) ([]github.IssueEvent, error)

func GetStatus

func GetStatus(client *github.Client, user, project string, prNumber int, requiredContexts []string) (string, error)

Gets the current status of a PR by introspecting the status of the commits in the PR. The rules are:

  • If any member of the 'requiredContexts' list is missing, it is 'incomplete'
  • If any commit is 'pending', the PR is 'pending'
  • If any commit is 'error', the PR is in 'error'
  • If any commit is 'failure', the PR is 'failure'
  • Otherwise the PR is 'success'

func HasLabel

func HasLabel(labels []github.Label, name string) bool

func HasLabels

func HasLabels(labels []github.Label, names []string) bool

func MakeClient

func MakeClient(token string) *github.Client

func ValidateStatus

func ValidateStatus(client *github.Client, user, project string, prNumber int, requiredContexts []string, waitOnPending bool) (bool, error)

Make sure that the combined status for all commits in a PR is 'success' if 'waitForPending' is true, this function will wait until the PR is no longer pending (all checks have run)

func WaitForPending

func WaitForPending(client *github.Client, user, project string, prNumber int) error

Wait for a PR to move into Pending. This is useful because the request to test a PR again is asynchronous with the PR actually moving into a pending state TODO: add a timeout

Types

type FilterConfig

type FilterConfig struct {
	MinPRNumber             int
	AdditionalUserWhitelist []string

	WhitelistOverride      string
	RequiredStatusContexts []string
	DryRun                 bool
	DontRequireE2ELabel    string
	E2EStatusContext       string
	// contains filtered or unexported fields
}

type PRFunction

type PRFunction func(*github.Client, *github.PullRequest, *github.Issue) error

type RateLimitRoundTripper

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

func (*RateLimitRoundTripper) RoundTrip

func (r *RateLimitRoundTripper) RoundTrip(req *http.Request) (resp *http.Response, err error)

Jump to

Keyboard shortcuts

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