prow/tide/status.go
func expectedStatus(queryMap *config.QueryMap, pr *PullRequest, pool map[string]PullRequest, cc contextChecker) (string, string) {
	if _, ok := pool[prKey(pr)]; !ok {
		minDiffCount := -1
		var minDiff string
		for _, q := range queryMap.ForRepo(string(pr.Repository.Owner.Login), string(pr.Repository.Name)) {
			diff, diffCount := requirementDiff(pr, &q, cc)
			if minDiffCount == -1 || diffCount < minDiffCount {
				minDiffCount = diffCount
				minDiff = diff
			}
		}
		return github.StatusPending, fmt.Sprintf(statusNotInPool, minDiff)
	}
	return github.StatusSuccess, statusInPool
}
func expectedStatus(queryMap *config.QueryMap, pr *PullRequest, pool map[string]PullRequest, cc contextChecker) (string, string) {
	if _, ok := pool[prKey(pr)]; !ok {
		minDiffCount := -1
		var minDiff string
		for _, q := range queryMap.ForRepo(string(pr.Repository.Owner.Login), string(pr.Repository.Name)) {
			diff, diffCount := requirementDiff(pr, &q, cc)
			if minDiffCount == -1 || diffCount < minDiffCount {
				minDiffCount = diffCount
				minDiff = diff
			}
		}
		return github.StatusPending, fmt.Sprintf(statusNotInPool, minDiff)
	}
	return github.StatusSuccess, statusInPool
}
func expectedStatus ( queryMap * config . QueryMap , pr * PullRequest , pool map [ string ] PullRequest , cc contextChecker ) ( string , string ) { if _ , ok := pool [ prKey ( pr ) ] ; ! ok { minDiffCount := - 1 var minDiff string for _ , q := range queryMap . ForRepo ( string ( pr . Repository . Owner . Login ) , string ( pr . Repository . Name ) ) { diff , diffCount := requirementDiff ( pr , & q , cc ) if minDiffCount == - 1 || diffCount < minDiffCount { minDiffCount = diffCount minDiff = diff } } return github . StatusPending , fmt . Sprintf ( statusNotInPool , minDiff ) } return github . StatusSuccess , statusInPool }
// Returns expected status state and description.
// If a PR is not mergeable, we have to select a TideQuery to compare it against
// in order to generate a diff for the status description. We choose the query
// for the repo that the PR is closest to meeting (as determined by the number
// of unmet/violated requirements).
Returns expected status state and description . If a PR is not mergeable we have to select a TideQuery to compare it against in order to generate a diff for the status description . We choose the query for the repo that the PR is closest to meeting ( as determined by the number of unmet / violated requirements ) .