Repository navigation
Skip GitHub owner scopes the access token may not search - #63
Merged
Merged
Conversation
Listing pull requests across every accessible repository searches one owner scope at a time, but a single rejected scope aborted the whole listing. GitHub answers GET /search/issues with HTTP 422 "The listed users and repositories cannot be searched" as soon as one qualifier names something the token may not search, which happens for organizations the token was never SSO-authorized for, for private repositories when the token lacks the 'repo' scope, and for repositories renamed or deleted after they were listed. The connection test then reported "FAILED Read pull requests" even though every other scope would have returned results. Run the per-scope searches through GitHubPullRequestSearch, which skips a scope GitHub refuses and only fails when no scope is searchable at all, in which case the message names the scopes and how to fix the token. Failures that are not scope rejections still propagate, so a server or network error is never mistaken for partial results. Organizations and collaborator repositories that cannot be listed no longer hide the user's own pull requests either, and the connection test reports the skipped scopes as a warning. Co-authored-by: Kurrle, Philipp <philipp.kurrle+ADVNTST@advantest.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Listing pull requests across every accessible repository searches one owner scope at a time, but a single rejected scope aborted the whole listing. GitHub answers GET /search/issues with HTTP 422 "The listed users and repositories cannot be searched" as soon as one qualifier names something the token may not search, which happens for organizations the token was never SSO-authorized for, for private repositories when the token lacks the 'repo' scope, and for repositories renamed or deleted after they were listed. The connection test then reported "FAILED Read pull requests" even though every other scope would have returned results.
Run the per-scope searches through GitHubPullRequestSearch, which skips a scope GitHub refuses and only fails when no scope is searchable at all, in which case the message names the scopes and how to fix the token. Failures that are not scope rejections still propagate, so a server or network error is never mistaken for partial results. Organizations and collaborator repositories that cannot be listed no longer hide the user's own pull requests either, and the connection test reports the skipped scopes as a warning.