edgafner / dorkag

Issue Tracker repository for all Dorkag plugins
Other
5 stars 0 forks source link

[FEATURE]: Save all comments #118

Open tjhleeds opened 2 months ago

tjhleeds commented 2 months ago

Is your feature request related to a problem? Please describe.

When I find something I'm unsure about in a PR, I don't necessarily know if it's a problem or not. I may need more information from other files in the PR before I know if I want to leave a comment or not. In the Azure DevOps UI, I typically write a comment but don't save it. I can then come back to it and edit/discard it as I get more information.

Once I finish my review, Azure DevOps will save all unsaved comments with very little friction. There is a button to do this, and it also happens automatically when submitting a review for the PR.

Describe the solution you'd like

I would like a quick way to save all comments, either at the point of submitting a review or separately. (Personally I don't mind which.)

It would also be nice if we could quickly jump between unsaved comments (or just between comments in general, regardless of it they're saved) so that I can find them to edit/discard them. This would be especially helpful for the occasions where a comment is left on some code which hasn't changed (e.g. to bring the author's attention to it and suggest that they should change it).

Describe alternatives you've considered

I'm still trialling the use of AZD so I haven't yet settled on a single workaround. I might end up using the Azure DevOps UI for comments which I don't want to save immediately, or might just jump between changes in AZD to manually find and save all the comments I've left unsaved.

Additional context

Another benefit of leaving comments unsaved then saving them all at the end of the review is when reviewing large PRs. If comments are saved as I review, then sometimes the author starts replying or making changes to their code in response to the comments. This makes it more difficult to focus on the review of the original code, and is secondary reason why it can be useful to save all comments.

Jonatha1983 commented 2 months ago

This request is tricky since Azure DevOps doesn't have a Review status like GitLab and GitHub.

If I understand correctly, you are writing the comments, but don't click the comment button. You keep navigating through the PR files, ensuring you don't leave or refresh the PR web page (since you will lose all your comments, right?)

Unfortunately, I don't see an easy way to do this with the REST API—but let me investigate it further.

Thanks for the request.

tjhleeds commented 2 months ago

Yes that's exactly what I do. I found that AZD keeps the comments while I navigate between files, but I still need to go through each comment manually to save them.

If it helps, I suspect the Azure DevOps UI just loops through the comments saving them one at a time, rather than actually doing a bulk save server-side. I've never actually checked the network logs, but something about the way the UI responds make me think it's doing that. I don't know if that would be a viable approach for AZD?

Jonatha1983 commented 2 months ago

Yeah valid request will add that as well to the next major backlog.