Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: go/rietveld/rietveld.go

Issue 1171823005: Add autoroll package, alerts for failed rolls, recent rolls on Status (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Address comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/autoroll/autoroll.go ('k') | status/go/status/main.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/rietveld/rietveld.go
diff --git a/go/rietveld/rietveld.go b/go/rietveld/rietveld.go
index 0c3bfeb34ee7e6b82961ea13b7c709e0347d2a33..227d001d504554ba982683e1b3400378c84e6991 100644
--- a/go/rietveld/rietveld.go
+++ b/go/rietveld/rietveld.go
@@ -19,6 +19,7 @@ import (
var (
committedIssueRegexp []string = []string{
"Committed patchset #[0-9]+ \\((id:)?[0-9]+\\) as [0-9a-f]{2,40}",
+ "Committed patchset #[0-9]+",
"Change committed as [0-9]+",
}
)
@@ -114,16 +115,9 @@ func SearchOpen(open bool) *SearchTerm {
}
}
-func SearchLimit(limit int) *SearchTerm {
- return &SearchTerm{
- Key: "limit",
- Value: fmt.Sprintf("%d", limit),
- }
-}
-
// Search returns a slice of Issues which fit the given criteria.
-func (r Rietveld) Search(terms ...*SearchTerm) ([]*Issue, error) {
- searchUrl := "/search?format=json"
+func (r Rietveld) Search(limit int, terms ...*SearchTerm) ([]*Issue, error) {
+ searchUrl := fmt.Sprintf("/search?format=json&limit=%d", limit)
for _, term := range terms {
searchUrl += fmt.Sprintf("&%s=%s", term.Key, term.Value)
}
@@ -166,6 +160,9 @@ func (r Rietveld) Search(terms ...*SearchTerm) ([]*Issue, error) {
issues = append(issues, &fullIssue)
}
}
+ if len(issues) >= limit {
+ break
+ }
cursor = "&cursor=" + data.Cursor
}
sort.Sort(issues)
« no previous file with comments | « go/autoroll/autoroll.go ('k') | status/go/status/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698