Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projects v2, take 2 #477

Merged
merged 5 commits into from
Jan 16, 2024
Merged

Conversation

milogert
Copy link
Contributor

@milogert milogert commented Jan 13, 2024

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:

  • Projects v2 support as well as the fzf-lua picker addition.
    • The interface for the new command changed a bit. Instead of add, move, and remove I went with set and remove. I The flow of projects v2 changed a bit and add and move felt a little too similar.
  • A config option default_to_projects_v2, which makes the card command default to use projects v2. Both versions are still available under the cardlegacy and cardv2 commands, regardless of this setting.

Does this pull request fix one issue?

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

  • Adds query timeout to searching in fzf-lua to make search more responsive.
  • Adds draft PR special highlighting when viewing an pr list in fzf-lua.

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.

@milogert milogert changed the title Feat/project v2 take 2 Projects v2, take 2 Jan 13, 2024
@milogert milogert force-pushed the feat/project-v2-take-2 branch from 44a501f to 842e5ee Compare January 13, 2024 06:08
@milogert milogert marked this pull request as ready for review January 13, 2024 06:12
@pwntester
Copy link
Owner

@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 5f1fbf9
Let me know if that looks good to you

lua/octo/gh/init.lua Outdated Show resolved Hide resolved
lua/octo/gh/init.lua Show resolved Hide resolved
@milogert
Copy link
Contributor Author

@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!

@milogert milogert requested a review from pwntester January 16, 2024 01:46
@pwntester pwntester merged commit b3558ac into pwntester:master Jan 16, 2024
2 checks passed
@pwntester
Copy link
Owner

Thanks @milogert!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants