pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.24k stars 124 forks source link

Improve the `Octo pr list` command #546

Open alexkalderimis opened 1 month ago

alexkalderimis commented 1 month ago

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 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:

Special notes for reviews

pwntester commented 3 weeks ago

Thanks for the PR! added a few comments