(labels []string)
| 31 | } |
| 32 | |
| 33 | func 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 | |
| 57 | func createIssueIfNonExist(t *TestResultSummary, issues []*github.Issue, labels []string) { |
| 58 | // check if there is already an open issue regarding this test |
no outgoing calls
no test coverage detected
searching dependent graphs…