I have a PR where I left several comments in my review on GitHub
A colleague has updated the code to apply my suggested changes, and now all my review comments appear with the outdated label.
However I still see the code in the state it was when I commented it.
What I want is an easy way to see the new code he has written, not the old. Is it possible at all?
Open the PR and Click on the files changed tab. All the latest changes that have been pushed to the branch requesting the PR will be available.
Related
Is there a way to view changes that were made after a code review by other developers?
Say, someone suggested a change and commented in GitHub on a specific file.
PR creator made changes to that specific file and checked in. - Is there a way to view that change?
Clicking view changes doesn't take me directly to the file that has comments. It takes me to all the files
This feature was very useful in BitBucket, as I could see all the changes of that specific file and comments in one place. Seems it's missing in GitHub.
This did not help:
https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request
The "Reviewing proposed changes in a pull request" you mention (as not helping) should still include a Jump to link:
That should allow you to narrow the list of files, and select the one you want to go to immediately.
I pushed a PR.
A reviewer asked for changes.
I make changes and push again.
I would like to be able to see only my new changes since his review on github to make sure I did what I was supposed to do.
Atm I can't because I haven't reviewed it yet (option disabled). Only the reviewer can click on it:
Is there a way to view it?
You should be able to see individual commits from "Commits" tab.
One way to do it is finding out the commit when the review took place and then compare it to your commit by manually editing the url and adding 2 dots between commit ids, like this
https://github.com/user/repo/compare/c3a414e..faf7c6f
source: https://help.github.com/articles/comparing-commits-across-time/#comparing-commits
I'm using Sonarqube with the Github plugin for analysing code in Pull Requests.
I get a problem when pushing code if the PR is already open. The comments made by the Github plugin in the PR are erased even if the new push doesn't fix them! Apparently because only the modified code gets analysed, and the other comments by the issue reporter user are erased. It means I'm losing the previously reported issues.
Any ideas on how to maintain the comments for the issues I still haven't solved in new commit/pushes?
The way I solved this problem was to make some additional changes on the files in my first commit.
This happened to me also. I had 1 commit when I opened the pull request, tons of issues were noted. I made a second small commit to update an unrelated configuration file, this caused sonar to remove all of the comments. I tried everything I could think of to get it to scan the full pull request: Closed/re-opened the pull request, ran the sonar preview scan again manually, reverted my 2nd commit (which created a 3rd commit).
We have git send us email reports of any comments made on our pull requests, so we had a record of all the sonar comments. We made some changes to the original files based on these comments and once we committed our fixes, sonar ran against the original files and the rest of the sonar comments popped back up!
This created a new best practice for us. If sonar finds any issues, the next commit should be fixes for those issues.
Recently GitHub introduced some new features including Pull Request Reviews.
In the past, line comments in Pull Requests would collapse like this after the line was changed in further commits:
Since the launch of the new feature, line comments no longer collapse even after further commits that address the issues. So far I've only had one PR and I'm not sure if the reviewer added single comments or used the new "Start a review" feature.
How can I get the old behaviour back or does it improve in the new "Start a review" feature?
I've watched their video tutorial on this feature and I can't determine whether the behaviour right now is what I'm supposed to be experiencing.
I sent a message to GitHub support and received the following response:
Sorry for the trouble! We are aware that with reviews comments no longer become "outdated" after new code is pushed.
This is definitely on our radar as something we need to address. I can't give a timeline for it, but we will be looking into it soon.
Since two years ago, GitHub now (august 2018) proposes "Collapse all diffs in a pull request at once":
When a pull request contains a lot of changed files, code reviewers can find it hard to isolate the changes that are relevant to them.
Now you can collapse (or expand) the contents of all diffs in a pull request by holding down the alt key and clicking on the inverted caret icon in any file header.
You can then go one step further by using the “Jump to file or symbol” dropdown to jump to the file that you’re interested in and automatically expand it.
That is not exactly the old behavior, but that does still improve the code review process.
I spent all morning in GitHub reviewing a pull request, writing detailed comments on many lines in the Diff view on the pull-request page.
I individually saved every line-by-line comment, and they all appeared in their correct places. I left the pull-request page, and when I returned to it, all my line-by-line comments were gone!
I have no idea why they disappeared, where they went, whether other users can see them and I can't, what any of this means, and whether I can trust myself going forward using GitHub, or whether I just have to go back to the telephone and fax for remote collaboration!
I did some web searches such as "how to view line comments in GitHub" for info about this, but could not find anything to relieve my panic. I will be grateful for advice and clues.
This is top result for "Can't view github comments" in google.
If you're here because you've left comments, and can see your own comments, but others cannnot, then check for a yellow pending label on your comments. Others cannot see your comment until you've completed the review process and selected whether you want to request changes. Once you click through a full review, then others will see your comments.
Note: I'm answering a slightly different question than the O.P., but I have a feeling that lots of other devs with this issue are hitting this stackoverflow question. I'm just hoping to help them. I myself had this issue and couldn't find a more relevant answer than this thread. :)
The line-comments depend on the commit that were made on.
If the person that made the pull request rebased that commit then you're not looking at what you were previously looking. It's a different commit, thus there are no comments.
Look on the 'Your Actions' tab and find a line in the actions' history were you commented on that commit, click that commit and you'll see the comments are still there.
If the commit was rebased, you wont find that commit were it used to be (some branch) and not on any repo probably (if it's not on another branch). It is just cached by git and github, until the garbage collector kicks in.
The old answer doesn't work for me because I don't see Your Actions or Public Actions now.
My pending comments disappeared after I started typing into what I thought was a comment I'd opened for editing. It wasn't open, and one of my keys may have been a shortcut. I could still see the button to finish my review (including the count of my pending comments) but the comments had disappeared.
I eventually got them back by navigating to the pull request, then to the commit I was reviewing.