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

Unified Diff: milo/git/history.go

Issue 2983513002: gitiles.Log: implement paging. (Closed)
Patch Set: fix 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 | « common/api/gitiles/gitiles_test.go ('k') | server/auth/config.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/git/history.go
diff --git a/milo/git/history.go b/milo/git/history.go
index efcfb200e532d8dd83fdedb30322c1cc191b6ede..dfed1c43769eeb45c09e76a0edbf64c174823c03 100644
--- a/milo/git/history.go
+++ b/milo/git/history.go
@@ -20,6 +20,7 @@ import (
"encoding/hex"
"fmt"
"io/ioutil"
+ "net/http"
"regexp"
"golang.org/x/net/context"
@@ -32,6 +33,7 @@ import (
"github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/proto/google"
+ "github.com/luci/luci-go/server/auth"
milo "github.com/luci/luci-go/milo/api/proto"
)
@@ -151,7 +153,14 @@ func GetHistory(c context.Context, url, commitish string, limit int) (*milo.Cons
ret := &milo.ConsoleGitInfo{}
cacheKey := fmt.Sprintf("GetHistory|%s|%s|%d", url, commitish, limit)
err = protoCache(c, useCache, cacheKey, ret, func() error {
- rawEntries, err := gitiles.Log(c, url, commitish, limit)
+ t, err := auth.GetRPCTransport(c, auth.AsSelf, auth.WithScopes(
+ "https://www.googleapis.com/auth/gerritcodereview",
+ ))
+ if err != nil {
+ return errors.Annotate(err, "getting RPC Transport").Err()
+ }
+ g := &gitiles.Client{Client: &http.Client{Transport: t}}
+ rawEntries, err := g.Log(c, url, commitish, limit)
if err != nil {
return errors.Annotate(err, "GetHistory").Err()
}
« no previous file with comments | « common/api/gitiles/gitiles_test.go ('k') | server/auth/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698