pwntester / octo.nvim

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

Filtering PRs doesn't work #281

Closed witoszekdev closed 2 years ago

witoszekdev commented 2 years ago

Issue Description

Type: bug report

Describe what happened (or what feature you want)

I try to filter Pull Requests by their author, however Octo returns the entire PR list for the repo

Describe what you expected to happen

Return PR list filtered by author like in the GitHub UI or gh CLI tool

CleanShot 2022-04-11 at 14 50 20@2x CleanShot 2022-04-11 at 14 50 46@2x

or if the params are invalid an error message

How to reproduce it (as minimally and precisely as possible)

  1. Type :Octo pr list createdBy=taniotanio7 or :Octo pr list author=taniotanio7
  2. List is not filtered

https://user-images.githubusercontent.com/4144459/162743692-31fe4e8e-f3bc-42ad-b861-85bd5beb10f7.mp4

Tell us your environment

macOS

NVIM v0.6.1 Build type: Release LuaJIT 2.1.0-beta3

gh version 2.7.0 (2022-03-30)

Tested on repo: https://github.com/saleor/saleor-dashboard Vim configuration: https://github.com/taniotanio7/dotfiles/tree/main/.config/nvim

Anything else we need to know?

I think the issue might be the GraphQL query - in GitHub docs there is an option to search PRs by author https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-author however it cannot be done when viewing repo - only search query accepts params for filtering PRs the repository query doesn't have this option

pwntester commented 2 years ago

Hi @taniotanio7, your guess was right, with Octo issue list you can only filter by the keys documented here. These keys include createdBy so :Octo issue list createdBy=taniotanio7 should work, but not for PRs that only accept the following keys. You can use the search command for that. eg: lua require("octo.pickers.telescope.provider").search({prompt="is:pr author:pwntester repo:github/codeql"})

witoszekdev commented 2 years ago

Great! Thanks :) I totally missed the search command.

I've made this PR to update the README https://github.com/pwntester/octo.nvim/pull/284

pwntester commented 2 years ago

Cool, thank!