{"modulePath":"github.com/topikachu/contrib","version":"v0.0.0-20150819091528-1c733f7114ea","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Functions\n\n```go\nfunc ForEachCandidatePRDo(client *github.Client, user, project string, fn PRFunction, once bool, config *FilterConfig) error\n```\nFor each PR in the project that matches:\n\n  - pr.Number \u003e minPRNumber\n  - is mergeable\n  - has labels \"cla: yes\", \"lgtm\"\n  - combinedStatus = 'success' (e.g. all hooks have finished success in github)\n\nRun the specified function\n\n```go\nfunc GetStatus(client *github.Client, user, project string, prNumber int, requiredContexts []string) (string, error)\n```\nGets the current status of a PR by introspecting the status of the commits in the PR. The rules are:\n\n  - If any member of the 'requiredContexts' list is missing, it is 'incomplete'\n  - If any commit is 'pending', the PR is 'pending'\n  - If any commit is 'error', the PR is in 'error'\n  - If any commit is 'failure', the PR is 'failure'\n  - Otherwise the PR is 'success'\n\n```go\nfunc MakeClient(token string) *github.Client\n```\n\n```go\nfunc ValidateStatus(client *github.Client, user, project string, prNumber int, requiredContexts []string, waitOnPending bool) (bool, error)\n```\nMake 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)\n\n```go\nfunc WaitForPending(client *github.Client, user, project string, prNumber int) error\n```\nWait 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\n\n## Types\n\n```go\ntype FilterConfig struct {\n\tMinPRNumber            int\n\tUserWhitelist          []string\n\tWhitelistOverride      string\n\tRequiredStatusContexts []string\n}\n```\n\n```go\ntype PRFunction func(*github.Client, *github.PullRequest, *github.Issue) error\n```\n\n","path":"github.com/topikachu/contrib/submit-queue/github","name":"github","synopsis":"","isRedistributable":true}
