Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloud.google.com/go v0.37.1, fix velodrome and ghclient #11909

Merged
merged 3 commits into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
224 changes: 190 additions & 34 deletions WORKSPACE

Large diffs are not rendered by default.

38 changes: 17 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module k8s.io/test-infra

require (
cloud.google.com/go v0.33.1
cloud.google.com/go v0.37.1
github.com/Azure/azure-pipeline-go v0.0.0-20180507050906-098e490af5dc // indirect
github.com/Azure/azure-sdk-for-go v21.1.0+incompatible
github.com/Azure/azure-storage-blob-go v0.0.0-20180507052152-66ba96e49ebb
github.com/Azure/go-autorest v10.15.5+incompatible
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Microsoft/go-winio v0.4.12 // indirect
github.com/NYTimes/gziphandler v0.0.0-20160419202541-63027b26b87e
github.com/PuerkitoBio/purell v1.1.1 // indirect
Expand Down Expand Up @@ -35,21 +34,18 @@ require (
github.com/gogo/protobuf v1.2.1 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect
github.com/golang/mock v1.1.1
github.com/golang/mock v1.2.0
github.com/golang/protobuf v1.2.0
github.com/google/go-github v0.0.0-20170604030111-7a51fb928f52
github.com/google/go-querystring v0.0.0-20150414214848-547ef5ac9797 // indirect
github.com/google/go-github v17.0.0+incompatible
github.com/google/uuid v1.0.0
github.com/googleapis/gax-go v2.0.2+incompatible // indirect
github.com/googleapis/gnostic v0.1.0 // indirect
github.com/gophercloud/gophercloud v0.0.0-20181215224939-bdd8b1ecd793 // indirect
github.com/gorilla/mux v1.6.2 // indirect
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.1.3
github.com/gregjones/httpcache v0.0.0-20160524185540-16db777d8ebe
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47 // indirect
github.com/imdario/mergo v0.0.0-20180119215619-163f41321a19 // indirect
github.com/influxdata/influxdb v0.0.0-20161215172503-049f9b42e9a5
github.com/jinzhu/gorm v0.0.0-20170316141641-572d0a0ab1eb
Expand All @@ -58,6 +54,7 @@ require (
github.com/json-iterator/go v1.1.6 // indirect
github.com/knative/build v0.2.0
github.com/knative/pkg v0.0.0-20181205230426-0e41760cea1d
github.com/kr/pretty v0.1.0 // indirect
github.com/lib/pq v1.0.0 // indirect
github.com/mailru/easyjson v0.0.0-20171120080333-32fa128f234d // indirect
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
Expand All @@ -70,26 +67,25 @@ require (
github.com/pelletier/go-toml v1.2.0
github.com/peterbourgon/diskv v0.0.0-20171120014656-2973218375c3
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/qor/inflection v0.0.0-20180308033659-04140366298a // indirect
github.com/satori/go.uuid v0.0.0-20160713180306-0aa62d5ddceb
github.com/shurcooL/githubv4 v0.0.0-20180925043049-51d7b505e2e9
github.com/sirupsen/logrus v1.1.1
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1 // indirect
golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc
golang.org/x/oauth2 v0.0.0-20181120190819-8f65e3013eba
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 // indirect
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2
golang.org/x/tools v0.0.0-20181122213734-04b5d21e00f1
google.golang.org/api v0.0.0-20181021000519-a2651947f503
google.golang.org/appengine v1.3.0 // indirect
google.golang.org/genproto v0.0.0-20181109154231-b5d43981345b
google.golang.org/grpc v1.17.0
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
google.golang.org/api v0.2.0
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
google.golang.org/grpc v1.19.0
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5
gopkg.in/yaml.v2 v2.2.2
k8s.io/api v0.0.0-20181128191700-6db15a15d2d3
Expand Down
180 changes: 118 additions & 62 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/ghclient/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type pullRequestService interface {
type repositoryService interface {
CreateStatus(ctx context.Context, org, repo, ref string, status *github.RepoStatus) (*github.RepoStatus, *github.Response, error)
GetCombinedStatus(ctx context.Context, org, repo, ref string, opt *github.ListOptions) (*github.CombinedStatus, *github.Response, error)
ListCollaborators(ctx context.Context, owner, repo string, opt *github.ListOptions) ([]*github.User, *github.Response, error)
ListCollaborators(ctx context.Context, owner, repo string, opt *github.ListCollaboratorsOptions) ([]*github.User, *github.Response, error)
}

type usersService interface {
Expand Down Expand Up @@ -143,10 +143,10 @@ func (c *Client) ForEachPR(owner, repo string, opts *github.PullRequestListOptio

// GetCollaborators returns all github users who are members or outside collaborators of the repo.
func (c *Client) GetCollaborators(org, repo string) ([]*github.User, error) {
opts := &github.ListOptions{}
opts := &github.ListCollaboratorsOptions{}
collaborators, err := c.depaginate(
fmt.Sprintf("getting collaborators for '%s/%s'", org, repo),
opts,
&opts.ListOptions,
func() ([]interface{}, *github.Response, error) {
page, resp, err := c.repoService.ListCollaborators(context.Background(), org, repo, opts)

Expand Down
2 changes: 1 addition & 1 deletion pkg/ghclient/wrappers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (f *fakeRepoService) GetCombinedStatus(ctx context.Context, org, repo, ref
}

// ListCollaborators returns 2 collaborators per page of results (served in order).
func (f *fakeRepoService) ListCollaborators(ctx context.Context, owner, repo string, opt *github.ListOptions) ([]*github.User, *github.Response, error) {
func (f *fakeRepoService) ListCollaborators(ctx context.Context, owner, repo string, opt *github.ListCollaboratorsOptions) ([]*github.User, *github.Response, error) {
resp := &github.Response{
Rate: github.Rate{Limit: 5000, Remaining: 1000, Reset: github.Timestamp{Time: time.Now()}},
LastPage: (len(f.collaborators) + 1) / 2,
Expand Down
6 changes: 3 additions & 3 deletions velodrome/fetcher/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ func (client *Client) FetchIssues(latest time.Time, c chan *github.Issue) {
close(c)
}

// hasID look for a specific Id in a list of events
func hasID(events []*github.IssueEvent, ID int) bool {
// hasID look for a specific id in a list of events
func hasID(events []*github.IssueEvent, id int) bool {
for _, event := range events {
if *event.ID == ID {
if *event.ID == int64(id) {
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion velodrome/fetcher/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (client FakeClient) FetchPullComments(issueID int, latest time.Time, c chan
close(c)
}

func createIssueEvent(ID int) *github.IssueEvent {
func createIssueEvent(ID int64) *github.IssueEvent {
return &github.IssueEvent{ID: &ID}
}

Expand Down
10 changes: 7 additions & 3 deletions velodrome/fetcher/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func NewIssueEvent(gIssueEvent *github.IssueEvent, issueID int, repository strin
}

return &sql.IssueEvent{
ID: strconv.Itoa(*gIssueEvent.ID),
ID: itoa(*gIssueEvent.ID),
Label: label,
Event: *gIssueEvent.Event,
EventCreatedAt: *gIssueEvent.CreatedAt,
Expand Down Expand Up @@ -148,6 +148,10 @@ func newAssignees(issueID int, gAssignees []*github.User, repository string) ([]
return assignees, nil
}

func itoa(n int64) string {
return strconv.FormatInt(n, 10)
}

// NewIssueComment creates a Comment from a github.IssueComment
func NewIssueComment(issueID int, gComment *github.IssueComment, repository string) (*sql.Comment, error) {
if gComment.ID == nil ||
Expand All @@ -163,7 +167,7 @@ func NewIssueComment(issueID int, gComment *github.IssueComment, repository stri
}

return &sql.Comment{
ID: strconv.Itoa(*gComment.ID),
ID: itoa(*gComment.ID),
IssueID: strconv.Itoa(issueID),
Body: *gComment.Body,
User: login,
Expand All @@ -188,7 +192,7 @@ func NewPullComment(issueID int, gComment *github.PullRequestComment, repository
login = *gComment.User.Login
}
return &sql.Comment{
ID: strconv.Itoa(*gComment.ID),
ID: itoa(*gComment.ID),
IssueID: strconv.Itoa(issueID),
Body: *gComment.Body,
User: login,
Expand Down
6 changes: 3 additions & 3 deletions velodrome/fetcher/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func makeIssueEvent(
}

func makeGitHubIssueEvent(
eventID int,
eventID int64,
label, event, assignee, actor string,
createdAt time.Time) *github.IssueEvent {

Expand Down Expand Up @@ -274,7 +274,7 @@ func TestNewLabels(t *testing.T) {
}
}

func makeGitHubIssueComment(id int, body, login string, createdAt, updatedAt time.Time) *github.IssueComment {
func makeGitHubIssueComment(id int64, body, login string, createdAt, updatedAt time.Time) *github.IssueComment {
var user *github.User
if login != "" {
user = &github.User{Login: &login}
Expand All @@ -288,7 +288,7 @@ func makeGitHubIssueComment(id int, body, login string, createdAt, updatedAt tim
}
}

func makeGitHubPullComment(id int, body, login string, createdAt, updatedAt time.Time) *github.PullRequestComment {
func makeGitHubPullComment(id int64, body, login string, createdAt, updatedAt time.Time) *github.PullRequestComment {
var user *github.User
if login != "" {
user = &github.User{Login: &login}
Expand Down
8 changes: 7 additions & 1 deletion vendor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ filegroup(
"//vendor/github.com/google/go-querystring/query:all-srcs",
"//vendor/github.com/google/gofuzz:all-srcs",
"//vendor/github.com/google/uuid:all-srcs",
"//vendor/github.com/googleapis/gax-go:all-srcs",
"//vendor/github.com/googleapis/gax-go/v2:all-srcs",
"//vendor/github.com/googleapis/gnostic/OpenAPIv2:all-srcs",
"//vendor/github.com/googleapis/gnostic/compiler:all-srcs",
"//vendor/github.com/googleapis/gnostic/extensions:all-srcs",
Expand Down Expand Up @@ -166,6 +166,7 @@ filegroup(
"//vendor/golang.org/x/oauth2:all-srcs",
"//vendor/golang.org/x/sync/errgroup:all-srcs",
"//vendor/golang.org/x/sync/semaphore:all-srcs",
"//vendor/golang.org/x/sys/cpu:all-srcs",
"//vendor/golang.org/x/sys/unix:all-srcs",
"//vendor/golang.org/x/sys/windows:all-srcs",
"//vendor/golang.org/x/text/secure/bidirule:all-srcs",
Expand All @@ -177,10 +178,15 @@ filegroup(
"//vendor/golang.org/x/tools/cover:all-srcs",
"//vendor/golang.org/x/tools/go/ast/astutil:all-srcs",
"//vendor/golang.org/x/tools/go/gcexportdata:all-srcs",
"//vendor/golang.org/x/tools/go/internal/cgo:all-srcs",
"//vendor/golang.org/x/tools/go/internal/gcimporter:all-srcs",
"//vendor/golang.org/x/tools/go/internal/packagesdriver:all-srcs",
"//vendor/golang.org/x/tools/go/packages:all-srcs",
"//vendor/golang.org/x/tools/imports:all-srcs",
"//vendor/golang.org/x/tools/internal/fastwalk:all-srcs",
"//vendor/golang.org/x/tools/internal/gopathwalk:all-srcs",
"//vendor/golang.org/x/tools/internal/module:all-srcs",
"//vendor/golang.org/x/tools/internal/semver:all-srcs",
"//vendor/google.golang.org/api/gensupport:all-srcs",
"//vendor/google.golang.org/api/googleapi:all-srcs",
"//vendor/google.golang.org/api/internal:all-srcs",
Expand Down
24 changes: 18 additions & 6 deletions vendor/cloud.google.com/go/compute/metadata/metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/cloud.google.com/go/iam/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion vendor/cloud.google.com/go/iam/iam.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/cloud.google.com/go/internal/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/cloud.google.com/go/internal/retry.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/cloud.google.com/go/internal/version/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/cloud.google.com/go/pubsub/BUILD.bazel

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading