MCPcopy Index your code
hub / github.com/etcd-io/etcd / getOpenIssues

Function getOpenIssues

tools/testgrid-analysis/cmd/github.go:33–55  ·  view source on GitHub ↗
(labels []string)

Source from the content-addressed store, hash-verified

31}
32
33func getOpenIssues(labels []string) []*github.Issue {
34 client := github.NewClient(nil).WithAuthToken(os.Getenv("GITHUB_TOKEN"))
35 ctx := context.Background()
36 // list open issues with label type/flake
37 issueOpt := &github.IssueListByRepoOptions{
38 Labels: labels,
39 ListOptions: github.ListOptions{PerPage: 100},
40 }
41 allIssues := []*github.Issue{}
42 for {
43 issues, resp, err := client.Issues.ListByRepo(ctx, githubOwner, githubRepo, issueOpt)
44 if err != nil {
45 panic(err)
46 }
47 allIssues = append(allIssues, issues...)
48 if resp.NextPage == 0 {
49 break
50 }
51 issueOpt.Page = resp.NextPage
52 }
53 fmt.Printf("There are %d issues open with label %v\n", len(allIssues), labels)
54 return allIssues
55}
56
57func createIssueIfNonExist(t *TestResultSummary, issues []*github.Issue, labels []string) {
58 // check if there is already an open issue regarding this test

Callers 1

createIssuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…