// GetTryResults returns trybot results for the given roll. func GetTryResults(r *rietveld.Rietveld, roll *AutoRollIssue) ([]*TryResult, error) { tries, err := r.GetTrybotResults(roll.Issue, roll.Patchsets[len(roll.Patchsets)-1]) if err != nil { return nil, err } res := make([]*TryResult, 0, len(tries)) for _, t := range tries { tryResult, err := TryResultFromBuildbucket(t) if err != nil { return nil, err } res = append(res, tryResult) } sort.Sort(tryResultSlice(res)) return res, nil }
// search queries Rietveld for issues matching the known DEPS roll format. func search(r *rietveld.Rietveld, limit int, fullHashFn func(string) (string, error), terms ...*rietveld.SearchTerm) ([]*AutoRollIssue, error) { terms = append(terms, rietveld.SearchOwner(ROLL_AUTHOR)) res, err := r.Search(limit, terms...) if err != nil { return nil, err } rv := make([]*AutoRollIssue, 0, len(res)) for _, i := range res { if ROLL_REV_REGEX.FindString(i.Subject) != "" { ari, err := FromRietveldIssue(i, fullHashFn) if err != nil { return nil, err } rv = append(rv, ari) } } sort.Sort(autoRollIssueSlice(rv)) return rv, nil }