multi-gitter icon indicating copy to clipboard operation
multi-gitter copied to clipboard

feat: review command

Open raffis opened this issue 1 year ago • 4 comments

What does this change

Hey me again 🙈 ,

This pr adds the ability for approving pull requests supported by all platforms. Basically reviewers now get an easy option to approve pr's made by multi-gitter (or other(s)). Usually pull requests require approval in branch protected repos and there is currently no good way to batch approve multi pr's. For example we collect all batch operations in a repository, a reviewer can grab the config from there and start a straight forward review process with the same tool. (Using the --batch option this could even be fully automated in a ci pipeline).

This pr adds the review command with a couple of options:

  • --comment for a review comment (can also be overwritten while reviewing pr's)
  • --all to batch review all of them. Basically review a diff output from all pr's. Useful if you have 100 pr's with a single line change where you don't want to review each individually.
  • --batch=x Approve/Decline/Comment all targeted pull requests without asking questions
  • --no-pager This pr pipes the diffs to a pager (less, more (windows), PAGER env). If no pager should be used one can dump to stdout directly using this option
  • --include-approved By default approve ignores pull requests which are already approved by the reviewing person.

example using vim with syntax highlighting:

 PAGER=vim multi-gitter review --log-level=debug --config config.yaml -c "lgtm" --all

What issue does it fix

Currently reviewing is hard. If you open 100 pr's with a simple change you either have to wait until people reviewed them, try to push them or whatever... There are also some workarounds like verify 2 and then batch approve everything via the api.

Notes for the reviewer

  • No tests added so far, waiting for your comments if this will be merged.
  • I did not test it on windows yet
  • I was unable to test bitbucket so far

Checklist

  • [x] Made sure the PR follows the CONTRIBUTING.md guidelines
  • [ ] Tests if something new is added

raffis avatar Mar 22 '23 16:03 raffis

Hey. Thanks for the PR! But please create an issue discussion about the addition so that you don't create anything unnecessarily ;)

I do think this is a good addition but will have to take some time before looking at it since the changes are extensive. Let me get back to you with a review in a few days :)

lindell avatar Mar 24 '23 12:03 lindell

Hey. Thanks for the PR! But please create an issue discussion about the addition so that you don't create anything unnecessarily ;)

I do think this is a good addition but will have to take some time before looking at it since the changes are extensive. Let me get back to you with a review in a few days :)

Yeah should have commented (fixes #295). Sure take your time 👍🏻

raffis avatar Mar 24 '23 12:03 raffis

Just used this new command to batch review and merge hundred pr's opened by renovate (not created using multi-gitter itself). Thats also a nice use case for this command.

raffis avatar Mar 29 '23 09:03 raffis

Hi @lindell,

Firstly thank you for sharing your excellent work that is this tool. Is there anything else left to do with this PR before you would merge it? This will be super handy for the core maintainers of the tools under https://github.com/zosOpenTools/

v1gnesh avatar Jan 15 '24 04:01 v1gnesh