Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Commit

Permalink
Update go-github dependency to HEAD master
Browse files Browse the repository at this point in the history
- Fixes google/go-github#664
- id type changed from int to int64
  • Loading branch information
mspiegel committed Mar 28, 2018
1 parent 594cb40 commit 800b9b1
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ install:
- go get -u github.com/golang/dep
- go install github.com/golang/dep/cmd/dep
- export PATH=$GOPATH/bin:$PATH
- dep ensure
- dep ensure -v -vendor-only
- dep status

script: make test
58 changes: 47 additions & 11 deletions Gopkg.lock

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

1 change: 1 addition & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

[[constraint]]
name = "github.com/google/go-github"
branch = "master"

[[constraint]]
name = "github.com/hashicorp/go-version"
Expand Down
2 changes: 1 addition & 1 deletion model/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

type Review struct {
ID int
ID int64
Author lowercase.String
Body string
SubmittedAt time.Time
Expand Down
20 changes: 11 additions & 9 deletions remote/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func getTeamMembers(ctx context.Context, client *github.Client, org string, team
if err != nil {
return nil, err
}
var id *int
var id *int64
for _, t := range teams {
if strings.EqualFold(t.GetSlug(), team) {
id = t.ID
Expand Down Expand Up @@ -512,15 +512,17 @@ func createProtectionRequest(input *github.Protection) *github.ProtectionRequest
}
inDismissal := inReviews.DismissalRestrictions
if len(inDismissal.Users) > 0 || len(inDismissal.Teams) > 0 {
outDismissal := &github.DismissalRestrictionsRequest{
Users: []string{},
Teams: []string{},
}
users := []string{}
teams := []string{}
for _, user := range inDismissal.Users {
outDismissal.Users = append(outDismissal.Users, user.GetLogin())
users = append(users, user.GetLogin())
}
for _, team := range inDismissal.Teams {
outDismissal.Teams = append(outDismissal.Teams, team.GetSlug())
teams = append(teams, team.GetSlug())
}
outDismissal := &github.DismissalRestrictionsRequest{
Users: &users,
Teams: &teams,
}
outReviews.DismissalRestrictionsRequest = outDismissal
}
Expand Down Expand Up @@ -667,7 +669,7 @@ func (g *Github) SetOrgHook(ctx context.Context, user *model.User, org *model.Or

old, err := getOrgHook(ctx, client, org.Owner, link)
if err == nil && old != nil {
client.Organizations.DeleteHook(ctx, org.Owner, old.GetID())
client.Organizations.DeleteHook(ctx, org.Owner, int(old.GetID()))
}

_, err = createOrgHook(ctx, client, org.Owner, link)
Expand All @@ -688,7 +690,7 @@ func (g *Github) DelOrgHook(ctx context.Context, user *model.User, org *model.Or
} else if hook == nil {
return nil
}
resp, err := client.Organizations.DeleteHook(ctx, org.Owner, hook.GetID())
resp, err := client.Organizations.DeleteHook(ctx, org.Owner, int(hook.GetID()))
if err != nil {
return createError(resp, err)
}
Expand Down

0 comments on commit 800b9b1

Please sign in to comment.