-
Notifications
You must be signed in to change notification settings - Fork 6.5k
The pr view
command with the --json files
flag omits some of the files changed
#9916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for raising this issue, @rosslh, let's dig into this a bit more! What's going on behind the scenes?I believe this is known limitation when this was introduced in #3414 due to a number of factors:
Though not technically a bug, I recognize it is unexpected behavior much less what someone interested in the data would desire. 👉 I want to discuss this with my fellow maintainers as I'm uncertain how realistic it is to refactor how we build such complex data objects from the GitHub API given the multiple levels of nested pagination queries involved. For more information, see detailed stack trace behind the relevant code
Lines 88 to 98 in 8990b1c
cli/pkg/cmd/pr/shared/finder.go Lines 88 to 170 in 8990b1c
cli/pkg/cmd/pr/shared/finder.go Lines 276 to 304 in 8990b1c
Lines 375 to 382 in 8990b1c
Lines 313 to 373 in 8990b1c
Lines 104 to 112 in 8990b1c
What can be done in short term?
QUERY='
query($endCursor: String){
repository(name:"svelte", owner:"sveltejs"){
pullRequest(number: 9739){
files(first:100, after: $endCursor){
totalCount
pageInfo{
endCursor
hasNextPage
}
nodes{
path
}
}
}
}
}'
gh api graphql -F query="$QUERY" --paginate --slurp | jq ".[].data.repository.pullRequest.files.nodes | length" |
I appreciate the quick response, Andy! I was able to get something working with the |
Just in the context of this issue, there are several issue and PR fields that only retrieve 100 items:
Discussing this with the core maintainers, updating the documentation for the |
Describe the bug
The
pr view
command with the--json files
flag does not return all of the files changed if the PR has modified more than 100 files.CLI version:
Steps to reproduce the behavior
gh pr view https://github.com/sveltejs/svelte/pull/9739 --json files
gh pr view https://github.com/sveltejs/svelte/pull/9739 --json changedFiles
Expected vs actual behavior
I would expect the number of files output with the
--json files
flag to match the integer output with the--json changedFiles
flag.If a limit is required for performance reasons, I would expect to be able to provide a
--limit
flag to increase the limit, like in thesearch
command.I don't see the current behaviour specified anywhere in the documentation for the view command, which is why I'm classifying this as a bug.
The text was updated successfully, but these errors were encountered: