News for hackers. Stuff that matters.
Re:Pull Request File Tree Feedback by eloisius on Friday March 11, 2022 @07:18PM (#30647744)
I’d settle for them making PRs as useful as they were in 2015, before they messed up some of the most basic functionality: showing the diff, and showing review comments. They hide big diffs behind a “load more” link, and as a result people often fail to code review the most substantial part of a change because they scan right past it, thinking it’s a removed file or binary or something. Then, once you submit a review, they only show 10 comments. In the middle, there’s an easy-to-miss “load more comments” button.

These are the two most fundamental features of a PR. How could they decide so few as 10 is the right number of comments?

Re:Pull Request File Tree Feedback by inetknght on Friday March 11, 2022 @07:33PM (#30647828)
> They hide big diffs behind a “load more” link, and as a result people often fail to code review the most substantial part of a change because they scan right past it, thinking it’s a removed file or binary or something.

This. Every PR I have to do ctrl-F "load diff" and then immediately click on _all_ of the diffs. It's !@#$ing annoying.

I've also lost comments when the comment is part of a review and pushed to the PR after the the PR has been merged by someone else.

Re:Pull Request File Tree Feedback by corndoge on Friday March 11, 2022 @07:38PM (#30647858)
Might be worth making a bounty for it in refined github[0], similar things have been implemented in the past[1]

[0] https://github.com/refined-github/refined-github

[1] https://github.com/refined-github/refined-github/issues/2151

Re:Pull Request File Tree Feedback by metadat on Friday March 11, 2022 @08:46PM (#30648226)
An extension shouldn't be needed for a dev-centric service like GH to be usable. This is the wrong way to fight bad UX, as it's ridiculous to make installation of a potential security vulnerability of an addon necessary to make a git-frontend website work well.

Better to just find a dev-first platform instead.

Re:Pull Request File Tree Feedback by corndoge on Friday March 11, 2022 @09:22PM (#30648396)
Perhaps you are more fortunate than me, but in my career, there have been times where I couldn't dictate the platform used. This is actually the case for many people - I daresay the majority - who work in the software industry. So while I understand (and of course agree with) the sentiment, it's rather trite. Plugins are there for the rest of us.
Re:Pull Request File Tree Feedback by eloisius on Friday March 11, 2022 @09:04PM (#30648304)
Seriously. If they’re too busy making sketchy copyright decisions with their AI code generation to bother with basic usable UI, they don’t deserve to be the de facto home of open source. I’ve been giving sourcehut a try, and the simplicity is refreshing.
Re:Pull Request File Tree Feedback by metadat on Friday March 11, 2022 @09:06PM (#30648311)
There's no denying the appeal of underdogs like SirHat :)
Re:Pull Request File Tree Feedback by inetknght on Friday March 11, 2022 @08:25PM (#30648115)
wtf is refined github? A browser extension? Nah, I value my browser more than that
Re:Pull Request File Tree Feedback by judge2020 on Friday March 11, 2022 @08:48PM (#30648240)
Especially for GitHub.com cookies and access. With over 50k users, this has to be a prime target for phishing/other attacks against the maintainers to publish a malicious update to the extension. Think passively stealing creds and source code.
Re:Pull Request File Tree Feedback by petepete on Saturday March 12, 2022 @06:08AM (#30650582)
For the stuff I work on I prefer the big diffs to be hidden. It's nearly always yarn.lock and I have no desire to see that monstrosity in all its glory.
Re:Pull Request File Tree Feedback by MitchellCash on Saturday March 12, 2022 @06:30AM (#30650661)
I think we can get the best of both worlds by hiding lock files by default and always showing any actual code file diffs. Performance may be a factor for very large diffs, but this would actually be my preference to how the default behaviour would work as I agree with you and the parent post.
Re:Pull Request File Tree Feedback by petepete on Saturday March 12, 2022 @09:18AM (#30651531)
A toggle in GitHub settings to automatically collapse `*.lock` files would be a massive step in the right direction.
Re:Pull Request File Tree Feedback by iovrthoughtthis on Saturday March 12, 2022 @06:18AM (#30650617)
i have no idea why we include these in code reviews tbh
Re:Pull Request File Tree Feedback by eloisius on Sunday March 13, 2022 @01:49AM (#30658637)
Not saying I review dependency locks as well as I should, but one reason to is to prevent supply chain attacks. E.g. making a typo that installs a malicious package. I recently saw a $60k beast of a machine with 64 cores get pwnd. We all wondered why “-bash” was burning 48 cores of CPU until I attached strace to it and we saw JSON RPC messages indicative of crypto mining. Everyone with access to the machine is trustworthy, but someone may have typo’d a pip install or something like that.
Re:Pull Request File Tree Feedback by andrewf on Friday March 11, 2022 @07:55PM (#30647958)
"Our metrics tell us that with these UI changes, people are approving more PRs and it's taking them less time!", probably.
Re:Pull Request File Tree Feedback by 88913527 on Friday March 11, 2022 @07:37PM (#30647850)
Maybe they're trying to nudge us towards smaller PRs. Many reviewers gloss over 300+ line changes in a single file. Approved with a "LGTM" and no further comment, but perhaps that's more a cultural issue with the team than anything.
Re:Pull Request File Tree Feedback by jcranmer on Friday March 11, 2022 @07:46PM (#30647902)
Perhaps, but github's PR UI goes to utterly atrocious if you try to do something along the lines of "a series of small atomic changes". In my recent reviewing experience, anything involving multiple commits in a single PR results in the diff more or less lying to you: you get diffs of something, but it's not clear what, and even less clear how to get what I want to actually diff.

I think the evidence is pretty clear that the most effective development process for large codebases is to look at changes as effectively a series of patches applied to head-of-trunk (and those patches may evolve during review)... and github seems to almost go out of its way to prevent you from thinking about PRs as if they were patches.

Re:Pull Request File Tree Feedback by thombles on Friday March 11, 2022 @08:29PM (#30648139)
> github seems to almost go out of its way to prevent you from thinking about PRs as if they were patches

Those who take care to write meaningful per-commit descriptions are actively punished by the eager collapsing. Either reviewers have to (1) spot the ellipsis (2) click on it for each individual commit, or the submitter has to copy-paste all of their commit information into the PR description.

Re:Pull Request File Tree Feedback by sdesol on Friday March 11, 2022 @08:53PM (#30648264)
> anything involving multiple commits in a single PR results in the diff more or less lying to you: you get diffs of something, but it's not clear what, and even less clear how to get what I want to actually diff.

I'm trying to work on solving this and I have a first iteration of it which I wouldn't mind getting feedback on. If you look at the following PR:

https://oss.gitsense.com/insights/github?bt=open&q=microsoft...

you can easily identify which commit does what. For example, if you select the first two commits and filter by them, the PR tree will show you the files that were changed by those commits and if you click on the commit in the tree, you can view the diff for that commit.

In the future, I want to support what you described and make it very easy to diff any revision.

Re:Pull Request File Tree Feedback by majormajor on Friday March 11, 2022 @07:41PM (#30647871)
While smaller PRs are better when practical/possible, the current Github design doesn't encourage them at all. If anything, it makes it too easy to submit giant ones - a bunch of the changes may get hidden anyway, making it look less intimidating than it should be!
Re:Pull Request File Tree Feedback by eloisius on Friday March 11, 2022 @09:08PM (#30648325)
This sounds like I’m “holding my phone wrong.”
Re:Pull Request File Tree Feedback by inetknght on Friday March 11, 2022 @11:03PM (#30648901)
> Maybe they're trying to nudge us towards smaller PRs. Many reviewers gloss over 300+ line changes in a single file.

Unfortunately there are a massive number of codebases where a "simple" change can mean changing _lots_ of places.

Re:Pull Request File Tree Feedback by thombles on Friday March 11, 2022 @08:24PM (#30648110)
Additionally, the notification email links to "View it on GitHub" don't reliably cause the relevant parts of the page to expand so you end up wading through a huge PR expanding things at random until you find the message.
Re:Pull Request File Tree Feedback by eloisius on Friday March 11, 2022 @09:09PM (#30648330)
Exactly. Once they turned the page into JS framework soup instead of regular HTML, the anchor links don’t work worth a damn.
Re:Pull Request File Tree Feedback by lachenmayer on Saturday March 12, 2022 @02:48AM (#30649754)
This is by far the most infuriating thing about the PR UI, along with the fact that you can't comment anywhere outside of the "patch", meaning you can't point out anything that is more than a couple of lines away.
Re:Pull Request File Tree Feedback by isbadawi on Saturday March 12, 2022 @08:32AM (#30651205)
There's an item on their roadmap to allow commenting on unchanged lines: https://github.com/github/roadmap/issues/456
Re:Pull Request File Tree Feedback by humanwhosits on Friday March 11, 2022 @07:30PM (#30647811)
Hiding of the large files has tripped me up multiple times. I've starting having to look at the diffs outside github's UI
Re:Pull Request File Tree Feedback by formerly_proven on Saturday March 12, 2022 @07:39AM (#30650968)
It's still not as bad as BitBucket which makes it basically impossible to read commit messages in a pull request. Is that a good level to be at? Probably not.

In the screenshot in the post it looks like the navigation tree is crammed into the 1280px wide grid, but that's not the case - enabling the feature preview makes the page full-width. So it doesn't make the diff area unreadable.