pwntester / octo.nvim

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

Projects v2, take 2 #477

Closed milogert closed 8 months ago

milogert commented 8 months ago

Describe what this PR does / why we need it

This PR is identical to #436 EXCEPT for the following:

  1. During startup the scopes are cached from gh. I am on the fence about this particular feature, but it sort of tracks with the rest of the plugin world (i.e. restart Neovim after changes to see updates).
  2. There is now a check when opening an issue or pr with Octo to see if you have the required scopes (cached during startup) for projects. If you do it inserts a fragment into the respective graphql queries. If you do not just a blank string is inserted and a printed message is shown.
  3. Additionally I have added some documentation relating to this message, in the event that people who see it don't know how to add scopes off hand (like me, before I puzzled it out).
  4. Finally, I added a config option to suppress the message if you don't want to see it at all.

ℹ️ The remainder of this description is just copy/pasted for documentation purposes.

This PR implements the projects v2 interface as well as the picker for fzf-lua.

Adds:

Does this pull request fix one issue?

Addresses https://github.com/pwntester/octo.nvim/discussions/414

Describe how you did it

Followed the pattern of the other cards command. As noted above I changed the interface for the new command slightly, but to something that made sense to me and how projects v2 flowed.

Describe how to verify it

Mess around with projects v2 inside Octo. Everything should work as expected.

Special notes for reviews

I added two small additions as riders:

These are tiny changes that are just QoL adds for fzf-lua.

Also I updated the README to account for some fzf-lua changes as well.

pwntester commented 8 months ago

@milogert I got some errors since the 4th property for the pull_request_query and issue_query queries was not always present. I made a global flag set on initialization and applied it on every PR/issue queries https://github.com/pwntester/octo.nvim/pull/477/commits/5f1fbf980295282b65b2e1e2f777dda7cb0fa867 Let me know if that looks good to you

milogert commented 8 months ago

@pwntester that flow looks great! There was one spot that I believe you missed in my latest commit

Thanks again for taking a look at this!

pwntester commented 8 months ago

Thanks @milogert!