1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-28 01:29:43 +02:00
Migrated from plain /vendor to go dep
This commit is contained in:
Harvey Kandola 2018-02-14 15:23:46 +00:00
parent 0262763c95
commit fd693f4ff4
957 changed files with 36866 additions and 177595 deletions

View file

@ -12,6 +12,7 @@
package github
import (
"context"
"encoding/json"
"net/http"
"net/url"
@ -46,7 +47,7 @@ func validateToken(ctx provider.Context, s *domain.Store, ptoken string) error {
Username: clientID(ctx.Request, s),
Password: clientSecret(ctx.Request, s),
}).Client())
_, _, err := authClient.Authorizations.Check(clientID(ctx.Request, s), ptoken)
_, _, err := authClient.Authorizations.Check(context.Background(), clientID(ctx.Request, s), ptoken)
return err
}

View file

@ -12,6 +12,7 @@
package github
import (
"context"
"fmt"
"html/template"
"sort"
@ -96,7 +97,7 @@ func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit,
for _, orb := range config.Lists {
if orb.Included {
branches, _, err := client.Repositories.ListBranches(orb.Owner, orb.Repo,
branches, _, err := client.Repositories.ListBranches(context.Background(), orb.Owner, orb.Repo,
&gogithub.ListOptions{PerPage: 100})
if err == nil {
render := make([]githubBranch, len(branches))
@ -141,7 +142,7 @@ func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit,
opts.Since = *config.SincePtr
}
guff, _, err := client.Repositories.ListCommits(orb.Owner, orb.Repo, opts)
guff, _, err := client.Repositories.ListCommits(context.Background(), orb.Owner, orb.Repo, opts)
if err != nil {
return nil, nil, err

View file

@ -12,6 +12,7 @@
package github
import (
"context"
"html/template"
"sort"
"time"
@ -128,7 +129,7 @@ func getIssues(client *gogithub.Client, config *githubConfig) ([]githubIssue, er
opts.Since = *config.SincePtr
}
guff, _, err := client.Issues.ListByRepo(orb.Owner, orb.Repo, opts)
guff, _, err := client.Issues.ListByRepo(context.Background(), orb.Owner, orb.Repo, opts)
if err != nil {
return ret, err

View file

@ -12,6 +12,7 @@
package github
import (
"context"
"fmt"
"net/http"
@ -25,14 +26,14 @@ func listFailed(rt *env.Runtime, method string, config githubConfig, client *gog
case "owners":
me, _, err := client.Users.Get("")
me, _, err := client.Users.Get(context.Background(), "")
if err != nil {
rt.Log.Error("github get user details:", err)
provider.WriteError(w, "github", err)
return
}
orgs, _, err := client.Organizations.List("", nil)
orgs, _, err := client.Organizations.List(context.Background(), "", nil)
if err != nil {
rt.Log.Error("github get user's organisations:", err)
provider.WriteError(w, "github", err)
@ -56,7 +57,7 @@ func listFailed(rt *env.Runtime, method string, config githubConfig, client *gog
var render []githubBranch
if config.Owner != "" {
me, _, err := client.Users.Get("")
me, _, err := client.Users.Get(context.Background(), "")
if err != nil {
rt.Log.Error("github get user details:", err)
provider.WriteError(w, "github", err)
@ -65,12 +66,12 @@ func listFailed(rt *env.Runtime, method string, config githubConfig, client *gog
var repos []*gogithub.Repository
if config.Owner == *me.Login {
repos, _, err = client.Repositories.List(config.Owner, nil)
repos, _, err = client.Repositories.List(context.Background(), config.Owner, nil)
} else {
opt := &gogithub.RepositoryListByOrgOptions{
ListOptions: gogithub.ListOptions{PerPage: 100},
}
repos, _, err = client.Repositories.ListByOrg(config.Owner, opt)
repos, _, err = client.Repositories.ListByOrg(context.Background(), config.Owner, opt)
}
if err != nil {
rt.Log.Error("github get user/org repositories:", err)

View file

@ -12,6 +12,7 @@
package github
import (
"context"
"fmt"
"html/template"
"sort"
@ -98,7 +99,7 @@ func getMilestones(client *gogithub.Client, config *githubConfig) ([]githubMiles
State: state,
ListOptions: gogithub.ListOptions{PerPage: config.BranchLines}}
guff, _, err := client.Issues.ListMilestones(orb.Owner, orb.Repo, opts)
guff, _, err := client.Issues.ListMilestones(context.Background(), orb.Owner, orb.Repo, opts)
if err != nil {
return ret, err

View file

@ -12,6 +12,7 @@
package github
import (
"context"
"sort"
"strings"
"time"
@ -181,7 +182,7 @@ func getUserName(client *gogithub.Client, config *githubConfig, login string) (f
an = content
}
} else {
usr, _, err := client.Users.Get(login)
usr, _, err := client.Users.Get(context.Background(), login)
if err == nil {
if usr.Name != nil {
if len(*usr.Name) > 0 {