Documentation ¶
Index ¶
- func ForEachCandidatePRDo(client *github.Client, user, project string, fn PRFunction, once bool, ...) error
- func GetStatus(client *github.Client, user, project string, prNumber int, ...) (string, error)
- func MakeClient(token string) *github.Client
- func ValidateStatus(client *github.Client, user, project string, prNumber int, ...) (bool, error)
- func WaitForPending(client *github.Client, user, project string, prNumber int) error
- type FilterConfig
- type PRFunction
- type RateLimitRoundTripper
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 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 MakeClient ¶
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)
Types ¶
type FilterConfig ¶
type PRFunction ¶
type RateLimitRoundTripper ¶
type RateLimitRoundTripper struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.