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

Update go-github dependency to HEAD master #38

Closed
wants to merge 3 commits into from
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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