-
Notifications
You must be signed in to change notification settings - Fork 21
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
Allow PR review just with suggestions without requesting to change or approving #243
Comments
Interesting idea. Technically speaking, we could change the posted review to be a I think this could be controlled via a new input option with a boolean value. Off the top of my head, I think the name |
This cannot be avoided when posting reviews as comments too. The REST API endpoint that Github offers (to post PR reviews) requires extra permission to be set. There is a security concern about posting comments. To be clear, we cannot work around the required permission as that is mandated by github. FWIW, posting thread comments on a PR (not as a PR review) poses the same permission obstacle. Posting comments in a PR that originates from a fork is practically impossible. |
I'm not very familiar with permission restrictions on GH, but I can day that I faced with the situation that posting comments with |
You should be able to dismiss an entire review if your account has the permission to do so for the repo in question. I wrote a doc about some of the PR review feature's caveats. Maybe that could help in some way.
If the bot did not dismiss the outdated review, then I would suggest you look at the CI triggers (the
As for the comments posted within the diff, GH allows these diff comments to be deleted or collapsed (marked as "resolved") provided the user has the right permission. |
In my case bot is trying to dismiss but ends with an error:
I can workaround this by disabling "Restrict who can dismiss pull request reviews" option in branch protection rules, but this is not what I would like to change. |
Ah, I forgot about the branch protection rules... Well, posting reviews as a comment will still yield the same dismissal problem. Why each PR event posts a new reviewIt would be a nightmare to track which comments are outdated and which comments need updating/deleting. And thread comments can be collapsed when resolved, but there is no way to do that via GitHub REST API. Furthermore, altering an existing review via the REST API is not intuitive at all. |
Unfortunately for some reason on 2.12 the following options don't lead to post comment with diff needed to apply to satisfy code formatting.
I see only summary comment on conversation tag like this without diff: Additionally on action summary I see annotation like this:
But I expecting to see comment with actual diff (clang-format suggestions) as stated for |
|
Sorry, I completly forget that it doesn't work for draft PR. It works as expected after I marked PR ready to review. IDK but maybe it would be good to allow diff suggestions on draft PR as well regulated by some additional option. |
By definition a drafted PR is "not ready for review". So, no it isn't a good idea. Also, I explicitly prevent posting reviews on closed or drafted PRs to avoid thread pollution/noise. |
All of your thoughts are correct, but is it OK that we don't have a way to get a diff from cpp-linter during PR draft stage? From my point of view diff is important information how the formatting issues can be addressed by PR's author before real users (not bots) start reviewing PR. |
I would argue that cpp-linter isn't the only way to use clang-format and clang-tidy. In fact, cpp-linter's role has always been one of review only. Our suggestion snippets is an experimental frontier for us, but I'm struggling to keep the idea not intrusive (thread pollution/noise). The review implementation we have may also be subject to change when seeking to satisfy cpp-linter/cpp-linter#82. The bot vs user review argument doesn't hold much weight since repo admins can specify a custom PAT (personal access token) instead of the inherent If you want to fix formatting errors in an automated way during the draft stage of a PR, you could use pre-commit. We have cpp-linter pre-commit hooks that doesn't use the same cpp-linter python package, but it requires the version of clang-format/tidy be installed separately & added to TBH, it wouldn't be hard to implement a special env var that allows reviews of a drafted PR. But it would incur tech debt to maintain such functionality. I just don't see the trade off worthy enough. |
With option like
format-review
I can enable posting suggestion by bot what and how should be changed, i.e. diff to be applied to satisfy the review. At the same time this option adds review result in terms of "needs work/approved". More over for dismissing the results of previous "needs work" additional permissions should be set for a bot.I just want to see the suggestions (like normal comments) without "approve" or "request changes".
The text was updated successfully, but these errors were encountered: