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

Unified Diff: milo/buildsource/builder.go

Issue 2976393002: Milo: Fix ?limit= param (Closed)
Patch Set: review Created 3 years, 5 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 | « no previous file | milo/frontend/middleware.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/buildsource/builder.go
diff --git a/milo/buildsource/builder.go b/milo/buildsource/builder.go
index d085057cb5b856c775444a87f2f7db22e2b547d6..40407f5a2f4d928031e7d60bd057189d9f87110e 100644
--- a/milo/buildsource/builder.go
+++ b/milo/buildsource/builder.go
@@ -5,7 +5,6 @@
package buildsource
import (
- "strconv"
"strings"
"golang.org/x/net/context"
@@ -13,7 +12,6 @@ import (
"github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/common/errors"
- "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/milo/api/resp"
"github.com/luci/luci-go/milo/buildsource/buildbot"
"github.com/luci/luci-go/milo/buildsource/buildbucket"
@@ -60,22 +58,8 @@ func (b BuilderID) Split() (backend, backendGroup, builderName string, err error
// Get allows you to obtain the resp.Builder that corresponds with this
// BuilderID.
-func (b BuilderID) Get(c context.Context, limitStr string, cursorStr string) (*resp.Builder, error) {
+func (b BuilderID) Get(c context.Context, limit int, cursorStr string) (*resp.Builder, error) {
// TODO(iannucci): replace these implementations with a BuildSummary query.
-
- limit := 0
- if limitStr != "" {
- switch limitVal, err := strconv.ParseInt(limitStr, 10, 0); err {
- case nil:
- limit = int(limitVal)
- default:
- logging.WithError(err).Warningf(c, "ignoring bad limit %q", limitStr)
- }
- }
- if limit <= 0 {
- limit = 25
- }
-
source, group, builder, err := b.Split()
if err != nil {
return nil, err
« no previous file with comments | « no previous file | milo/frontend/middleware.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698