Skip to content

Commit

Permalink
fix: add PR number for paged pull requests (#18)
Browse files Browse the repository at this point in the history
We found that when a PR has a large number of reviews, that the processing of
the pull request will fail because it finds the PR number to be null (see line
994). This is because the PR number is not included in the request for
subsequent pages.
  • Loading branch information
hicksjacobp authored May 4, 2022
1 parent 4e01afc commit 13a2000
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gh-repo-stats
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ GetNextReviews() {
{
cat <<EOF
{
"query":"{ repository(owner:\"${OWNER}\" name:\"${REPO_NAME}\") { owner { login } name pullRequest(number:${PR_NUMBER}) { commits(first:1){ totalCount } timeline(first: 1) { totalCount } comments(first: 1) { totalCount } reviews(first: ${EXTRA_PAGE_SIZE}${REVIEW_NEXT_PAGE}) { totalCount pageInfo { hasNextPage endCursor } nodes { comments(first: 1) { totalCount } } } } }}"
"query":"{ repository(owner:\"${OWNER}\" name:\"${REPO_NAME}\") { owner { login } name pullRequest(number:${PR_NUMBER}) { number commits(first:1){ totalCount } timeline(first: 1) { totalCount } comments(first: 1) { totalCount } reviews(first: ${EXTRA_PAGE_SIZE}${REVIEW_NEXT_PAGE}) { totalCount pageInfo { hasNextPage endCursor } nodes { comments(first: 1) { totalCount } } } } }}"
}
EOF
}
Expand Down

0 comments on commit 13a2000

Please sign in to comment.