Example #1
0
func search(limit int, terms ...*rietveld.SearchTerm) ([]*AutoRollIssue, error) {
	terms = append(terms, rietveld.SearchOwner(OWNER))
	res, err := r.Search(limit, terms...)
	if err != nil {
		return nil, err
	}
	rv := make([]*AutoRollIssue, 0, len(res))
	for _, i := range res {
		rv = append(rv, &AutoRollIssue{
			Closed:    i.Closed,
			Committed: i.Committed,
			Issue:     i.Issue,
			Modified:  i.Modified,
		})
	}
	return rv, nil
}
Example #2
0
// 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
}