3 ms·
I... don't think I like this idea. "The code works and the tests agree" is not high enough a bar for me for merging. I want a human to read through it and ens
by kelnos 6y ago
I... don't think I like this idea. "The code works and the tests agree" is not high enough a bar for me for merging.
I want a human to read through it and ensure that the code is readable and written in a way that makes it hard to write bugs. Even if there are no bugs (well, no bugs that the tests picked up) right now, there are a ton of code structure errors I see all the time that will make it easy for someone to introduce bugs later.
I want a human to verify that the code change isn't spaghetti. Any new constructs or interfaces should be vetted by someone with an eye toward future maintenance and extensibility.
It's also possible that the entire approach taken by the committer is wrong, and someone with better context and domain knowledge will catch that. Ideally an issue like that is caught well before it gets to PR/code review time, but often that's not the case.
While I like the idea that issues can be fixed in future pull requests, that's a hard culture to push for. Many times people are pushed to get things out and then move onto the next thing. If a manager or product owner asks me why a particular thing isn't out to production yet, I can say "it's still in review, and there are issues we're working through to get it into shape to be merged" and that's usually sufficient. If they instead ask (after the feature has been merged), "why haven't we moved onto the next thing?", and I answer "we had some issues with the prior feature that need to be cleaned up post-merge", the response I will get is, "we don't have time for that; you already shipped the feature, so if there are cleanups, create tickets for them and we'll find time to deal with them later". And of course "later" never arrives, at least not until those unfixed issues inevitably cause production downtime, and then suddenly, big surprise, they're a huge priority (and the engineering team looks bad regardless).
You might say that much of what I described in the previous paragraph sounds like quite a dysfunctional organization, but, well... from my experience and from what I hear, most of us work within dysfunctional orgs, and we have to do things to work around some of the garbage... like requiring pre-merge reviews.
- maverwa 6y agoThats pretty much my experience aswell. We use code reviews in pull requests from feature branch (not deployed anywhere yet) to the staging branch (deployed) and the PO/PM gets that these are important and fixes take time. If something is deployed and not utterly broken, well theres more important stuff to be done. Additionally we have caught some really nasty stuff in code reviews that had the potential to activly break the staging system which would have, at least, caused some hectic work to fix the db there. Some things are hard and impractical to test, e.g. if a migration just destroys your data. I have worked in a company before that did not have code reviews and when I tried to intruduce them they basically where "I need you to press this button" rubber stamps where most of the approvers never even looked at the code. Not going back there...
- Cthulhu_ 6y agoSame; post-commit reviews about things like style and naming will add churn to the repository, whereas pre-commit / pre-merge reviews allows the developer to fix all issues before merging, keeping history clean and code churn low.