Settings

Theme

Pull Request File Tree Feedback

github.com

103 points by isbadawi 4 years ago · 76 comments (74 loaded)

Reader

eloisius 4 years ago

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?

  • inetknght 4 years ago

    > 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.

    • corndoge 4 years ago

      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

      • metadat 4 years ago

        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.

        • corndoge 4 years ago

          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.

        • eloisius 4 years ago

          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.

      • inetknght 4 years ago

        wtf is refined github? A browser extension? Nah, I value my browser more than that

        • judge2020 4 years ago

          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.

    • petepete 4 years ago

      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.

      • MitchellCash 4 years ago

        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.

        • petepete 4 years ago

          A toggle in GitHub settings to automatically collapse `*.lock` files would be a massive step in the right direction.

      • iovrthoughtthis 4 years ago

        i have no idea why we include these in code reviews tbh

        • eloisius 4 years ago

          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.

  • andrewf 4 years ago

    "Our metrics tell us that with these UI changes, people are approving more PRs and it's taking them less time!", probably.

  • 88913527 4 years ago

    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.

    • jcranmer 4 years ago

      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.

      • thombles 4 years ago

        > 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.

      • sdesol 4 years ago

        > 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.

    • majormajor 4 years ago

      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!

    • eloisius 4 years ago

      This sounds like I’m “holding my phone wrong.”

    • inetknght 4 years ago

      > 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.

  • thombles 4 years ago

    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.

    • eloisius 4 years ago

      Exactly. Once they turned the page into JS framework soup instead of regular HTML, the anchor links don’t work worth a damn.

  • lachenmayer 4 years ago

    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.

  • humanwhosits 4 years ago

    Hiding of the large files has tripped me up multiple times. I've starting having to look at the diffs outside github's UI

  • formerly_proven 4 years ago

    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.

ydnaclementine 4 years ago

Not sure if this is well known, but press period `.` when viewing a PR, repo, or file and github will send you to a in-browser visual code editor. Able to make commits in there too, perfect for [nit] comments

politelemon 4 years ago

Bitbucket Server and Gitlab have this feature and it's quite useful for very large pull requests as you can easily see the folder structure of the file you're reviewing, for that bit extra bit of visual context. Bitbucket's search box is slightly better because it also does a code search within the PR, it helps you quickly find specific words (say, a class name) across all the changed files. Gitlab's only does a file name filter.

Though relatively late, I am glad it's coming to Github, more people can benefit from this kind of pull request presentation.

  • wdb 4 years ago

    Gitlab and big PR aren't a great experience. Impossible to scroll -- it's so slow

  • mrrsm 4 years ago

    If only Bitbucket Cloud would play catchup now. So many times I read about a bitbucket feature to only find out it is server only and we can't use it.

OliverGilan 4 years ago

Funny but Azure Repos actually has had this feature for a while. When I first joined Microsoft I was shocked that all our teams used Azure Repos instead of GitHub considering we own GitHub but as I've used Repos more and more I've actually come to like it more than GitHub itself. A lot of the UI is cleaner and more intuitive than GitHub to me now, maybe just from using it a lot.

  • carstenhag 4 years ago

    Agree, I really prefer DevOps' PR experience. I'm just missing the easy GitHub ci Integrations (3rd party checks & bots that post comments for example). It probably also exists for DevOps, but I never came across of it

  • oneepic 4 years ago

    +1. I had the same experience joining Microsoft. I wasn't super thrilled by Azure at first, but was surprised by how much functionality it had. Fast forward a couple years later, I moved to another big tech company using Github instead, which had setup integrations with a bunch of different external tools (and this one was no slouch when it comes to engineering tooling). I can't tell you how much I missed Azure, even though I've had my issues with MSFT.

  • voidfunc 4 years ago

    Azure DevOps is a very solid product in general. That said, the whole work items UI is terrible and inferior to the GitHub issue’s system. Too complex.

tomasreimers 4 years ago

Hi! I am one of the authors of https://graphite.dev, we are basically a really fancy client to GH that lets you review others PRs without making them change their workflow at all (posts everything to GH etc)

We've had a file tree for some time now (along with some of the other feedback I'm seeing in this thread, large diffs etc).

If anyone wants to give it a spin, happy to give you an invite :)

  • brainbag 4 years ago

    I've been looking for something like this for weeks. Seems fantastic. How do I get that invite?

    • jacobegold 4 years ago

      Send an email (from the address you use to sign into GitHub!) to jacob@graphite.dev :)

jameslao 4 years ago

If anyone is interested, I've been building a code review tool called Crocodile[0] that lets you review GitHub PRs. It has a similar file browser to the left plus floating comments, threaded discussions, and more.

[0] https://www.crocodile.dev/

  • eloisius 4 years ago

    Just casually following this thread, this is the third SaaS I've seen offering an alternative code review tool to supplement GitHub. It's either sorely needed to make up for how bad GitHub is, or it's true that we engineers can't help but makes tools for people exactly like ourselves.

    • jameslao 4 years ago

      Probably a mix of both. Many of the founders of code review tools came from companies that had internal code review tools (Microsoft has CodeFlow, Google has Critique, Facebook has Phabricator) and they missed those tools after leaving those companies.

obilgic 4 years ago

Back in the day I created something similar for CLI, which lets you diff any change in tree format.

https://github.com/oguzbilgic/tiri

noname120 4 years ago

I'm currently using Octotree[1]. It has more features than this proposed GitHub implementation. Namely, files have icons, count of added/removed lines is displayed inline, comments are displayed inline (super easy to jump from comment to comment), etc. For now I'll keep using Octotree but I'm curious of the direction this implementation will take.

[1] https://www.octotree.io/

dandigangi 4 years ago

One of the few things worth actually stealing from BitBucket. Lol

  • alkonaut 4 years ago

    Since GitHub is owned by Microsoft and their other product has had this, I’m guessing it’s yet another copy-over like GitHub Actions was from Azure Pipelines.

    Not sure how long it’s been in AzureDevOps but it could have been inspired from GitLab there I suppose.

    • RyJones 4 years ago

      ADO will go away once all of the features are migrated to GitHub.

      • alkonaut 4 years ago

        I wouldn't mind if they converged the products tbh, but there are quite a lot of things yet to migrate I think. An extensive process thing with easy ways to hook in for doing processes and reports would be much better than what ADO does now with an extremely complex model that you invariably still need to customize with extensions and hooks.

marceloabsousa 4 years ago

If you don't want just a tree but also a semantic diff that tells you what types and methods where actually changed check out Reviewpad (http://reviewpad.com).

radicality 4 years ago

After many years at Facebook I’ve recently switched jobs and have to use GitHub now for work. Compared to Phabricator (FB’s code review tool), the GitHub code review (and code merge) processes seems extremely basic and clunky.

  • jameslao 4 years ago

    I'm also working on a code review app called Crocodile that addresses GitHub's shortcomings. Signups are open and feedback is always appreciated.

    https://www.crocodile.dev

  • jacobegold 4 years ago

    Try out Graphite! Half of us are ex-FB, so we get it.

    https://graphite.dev/

    • radicality 4 years ago

      That looks cool, I put my work and personal emails on the waitlist! GitHub review is just… awful

      Side-note: I took a look at the ‘About’ page thinking ‘Hey, they said ex-FB, extremely unlikely but maybe i know someone’. Looking at your username I’m guessing you’re jacob gold and worked on messaging infra in NY. I used to work on Iris! Small world.

      • jacobegold 4 years ago

        So funny :) I was on storage but was "moonlighting" on Iris for my last couple months at FB — what a small world!

        Feel free to shoot me an email if you don't want to wait, although the list moves fairly quickly these days.

svnpenn 4 years ago

What's ironic is that discussion pages, like the one linked here, are broken on mobile. Maybe they should focus on that first.

Also, I hate repos that convert issues to discussions. Might as well close the issue, as discussion is usually a graveyard.

  • OJFord 4 years ago

    Why is closing better? Either means 'maintainer won't do anything' (beyond perhaps charitably helping you out)

    'Moved to discussion' seems better to me than 'closed; tagged question'.

    • mushyhammer 4 years ago

      > seems better

      That’s why they do it, but what they’re doing is essentially rejecting the request. If it’s a question, sure, but if it’s a feature request or worse yet a bug report then moving to discussions is bs.

      • OJFord 4 years ago

        Sure, but isn't reject + allowing discussion (e.g. from other users, or maybe a maintainer will chip in) better than reject + nothing, a closed undiscoverable issue or worse locked?

BugsJustFindMe 4 years ago

Display performance switching between files in Safari is terrible on very large PRs. I don't know what it could be doing. Maybe something to do with text reflow? But it's almost unusable.

croddin 4 years ago

That seems very useful for large pull requests. GitHub is starting to look more and more like VS Code.

  • other_herbert 4 years ago

    Just wait till you hit . On your keyboard

    • eloisius 4 years ago

      Is this why the UI had become so slow and bloated feeling? A massive IDE in the browser? I hate how every tech company finally arrives at a stage where they do everything to keep you on the platform. I won’t even be surprised if some time before 2030 the phase out Git entirely and rename it Microsoft Visual VCS, only accessible by writing code in their Electron text editor or directly in the browser.

eat_veggies 4 years ago

I've been using the Octo Tree extension for this, but it's so great to have it built-in !

lh15 4 years ago

This is why I’ve enjoyed using Bitbucket more than GitHub. Nice to see github adding it

duxup 4 years ago

I like it as a quick glance on generally what is up.

I don’t like scrolling until I see “holy cow wat”.

williamscales 4 years ago

This kills the Octotree.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection