This PR includes improvements to the pr list command. Specifically:
it changes the fetch implementation to one based on REST rather than GraphQL, since GraphQL lacks several important features, such as the ability to filter on authors or assignees or labels.
it abandons the attempt to fetch all PRs via pagination, since repos with hundreds or even thousands of PRs will cause this to be inefficient or unusable
it changes the display in telescope of PRs to show authors and branches, and allows the user to filter based on these values. This is very important in organizations where practices such as including ticket IDs in branch names are followed.
Does this pull request fix one issue?
Fixes #551
Describe how you did it
The main changes are in pickers/telescope/entry_maker.lua and pickers/telescope/provider.lua. These files define both the mechanism for retrieving pull requests and how they are passed to the telescope picker.
A new function gen_from_pull_request is added in entry_maker.lua to handle the display of the pull request data, including the addition of the new author and branch columns. The ordinal for pull requests now includes the author and branch information, allowing this to be used in filtering (displaying this is not enough).
The retrieval is changed in telescope/provider.lua (specifically in the pull_requests function). Here we call gh pr list rather than using the exisiting GraphQL implementation in order to provide access to the additional features that allows.
The retrieved records are modified to conform to the GraphQL result schema, meaning that they can be used in existing functions if necessary.
Describe how to verify it
The following actions will be useful in verification:
run Octo pr list and then use telescope to filter by author name
run Octo pr list author=@me and see that only your PRs are shown
Describe what this PR does / why we need it
This PR includes improvements to the
pr list
command. Specifically:Does this pull request fix one issue?
Fixes #551
Describe how you did it
The main changes are in
pickers/telescope/entry_maker.lua
andpickers/telescope/provider.lua
. These files define both the mechanism for retrieving pull requests and how they are passed to the telescope picker.A new function
gen_from_pull_request
is added inentry_maker.lua
to handle the display of the pull request data, including the addition of the new author and branch columns. Theordinal
for pull requests now includes the author and branch information, allowing this to be used in filtering (displaying this is not enough).The retrieval is changed in
telescope/provider.lua
(specifically in thepull_requests
function). Here we callgh pr list
rather than using the exisiting GraphQL implementation in order to provide access to the additional features that allows.The retrieved records are modified to conform to the GraphQL result schema, meaning that they can be used in existing functions if necessary.
Describe how to verify it
The following actions will be useful in verification:
Octo pr list
and then use telescope to filter by author nameOcto pr list author=@me
and see that only your PRs are shownSpecial notes for reviews