Skip to content

Commit

Permalink
Prune empty pull requests in QueryPullRequests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthyx committed Dec 4, 2019
1 parent b56f01e commit c710b00
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions prow/prstatus/prstatus.go
Expand Up @@ -308,6 +308,13 @@ func (da *DashboardAgent) QueryPullRequests(ctx context.Context, ghc githubClien
totalCost += int(sq.RateLimit.Cost)
remaining = int(sq.RateLimit.Remaining)
for _, n := range sq.Search.Nodes {
org := string(n.PullRequest.Repository.Owner.Login)
repo := string(n.PullRequest.Repository.Name)
ref := string(n.PullRequest.HeadRefOID)
if org == "" || repo == "" || ref == "" {
da.log.Warningf("Skipped empty pull request returned by query \"%s\": %v", query, n.PullRequest)
continue
}
prs = append(prs, n.PullRequest)
}
if !sq.Search.PageInfo.HasNextPage {
Expand Down

0 comments on commit c710b00

Please sign in to comment.