gh-dash
gh-dash copied to clipboard
Add PR approval
Is your feature request related to a problem? Please describe. Sometimes when bumping Terraform module versions, I get a bunch of renovate PRs. I would like to quickly approve them from within dash.
Describe the solution you'd like I would like to add "Approve" as a keybinding like "Merge" (https://github.com/dlvhdr/gh-dash/pull/168). Probably it popups with a message dialog to enter a comment.
Describe alternatives you've considered Currently I created my own keybinding.
Additional context I would like to implement it in the context of #hacktoberfest which is just around the corner.
cool yeah that's something I definitely want!
I didn't implement it yet as I needed to think more on the UX of it.
Reviewing a PR with gh pr review
needs flags specifying approving/rejecting and a message body.
I thought I could implement an generic input mechanism similar to vim's vim.ui.select
.
Something like this:
Would it make sense to use something like the modal window from tview (https://github.com/rivo/tview/wiki/Modal) ?
I'm not sure that'll work with bubbletea, but if it were to work, do you know how much that'll add to the binary size?
No idea. Honestly, I'm more or less a copy/paste "dev" as my background is more Ops than Dev. 🙂
But as said I would like to try a PR for #hacktoberfest. Are you fine with that?
Yeah sure, give it a try
After a quick search I know now that bubbletea is already a TUI lib 💡 and that https://github.com/erikgeiser/promptkit could be a good fit. I will explore in the bubbles field.
Yes check out https://github.com/charmbracelet/bubbles
This would be a big help for us since most of our repos require approval before a PR can be merged
@dlvhdr
I needed to think more on the UX of it.
Having separate hotkeys for approval and requesting changes would be enough for us. Simple is better than nothing. This is the last feature I need to live in the terminal. :)
Got it :) Making someone be able to live in the terminal is definitely a motivator 🥰
@rpdelaney but what about reviewing the PR before approving it? You would still need a way to add comments on lines in files. This can be done with octo nvim but if you use it then you can approve the PR through its interface.
@dudicoco Not every PR requires that I add comments.
For anyone curious, you can use gh-dash with Gum also from charm to create prompts with input.
Here is how you can do a pr approval with a comment. Can adjust for request changes, text blocks over inputs etc.
keybindings:
prs:
- key: a
command: >
gh pr review --repo {{.RepoName}} --approve --body "$(gum input --prompt='Approval Comment: ')" {{.PrNumber}}
keybindings:
prs:
- key: a
command: >
gh pr review --repo {{.RepoName}} --approve
I did not grok that this was possible already in gh-dash. Thank you so much.
Figured this out today, but left me with a quick question—is there a way to adjust the ?
help text? Asking because inevitably I'll need to check my own config several times before I "learn" my own key bindings 😂 It would be nice to be able to see my updated key binding in the help text.
That sounds like a good topic for a separate issue