6 ms·
>"Pull requests were invented to gatekeep access to open-source projects. In open source, it's very common that not everyone is given free access to changing th
by coldtea 4y ago
>"Pull requests were invented to gatekeep access to open-source projects. In open source, it's very common that not everyone is given free access to changing the code, so contributors will issue a pull request so that a trusted person can then approve the change. "I think this is really bad way to organise a development team. "If you can't trust your team mates to make changes carefully, then your version control system is not going to fix that for you."
This guy (not the post author, but Dave Farley, the guy who wrote the above excerpt) has never heard of "trust but verify".
PR is about verifying, having another set of eyes for anythine the original dev might have missed, giving an opinion before something on a branch goes into permanent git history, and so on.
This is completely orthogonal with whether you trust your team members or not. Besides "blind trust" is not the only form of trust.
- jiggawatts 4y agoAs far back as the year 2001, way before Git existed, a small startup I worked for used mandatory code review for all commits. You couldn't just upload whatever garbage and call it a day, it had to successfully compile and be reviewed by a randomly selected peer. These days Pull Requests are used to enable the same workflow.
- winrid 4y agoWas the startup successful? :)
- jiggawatts 4y agoActually no, and IMHO a significant contribution to that failure was that they had bred a culture of cheating where developers would bypass these controls. For example, one of the managers would get his brother to approve his changes, and vice-versa, even if the code was total gibberish. Generally, the lesson I took away from that place is that you can blow $10 million in seed money and end up with worthless code if you don't pay attention to the basics. They were in the right market, at the right time, with the right product, and 3-5 years ahead of the competition, but you can't sell non-functioning software. My favourite example (of many) was that they used a source control system that could cache Java ".class" files to enable incremental compilation at all times, even without IDE support. This was literally a check-box that someone un-ticked years before I got there. I re-enabled it for myself as a local setting override and compile times went from 30 minutes to 5 seconds. That inner-loop speed-up was just insane, I could fix bugs in minutes that would take the rest of the team days. Speaking of code review, the code that I saw getting "rubber-stamped" was so bad it was unbelievable. One guy spent months working on multi-threaded animation code that I replaced with a single line of code. Which actually worked, didn't stutter, and didn't leak threads, or use threading at all for that matter. The essentials matter! Proper code review, well set up tooling, hygienic build pipelines, etc...
- brazzy 4y agoSounds to me that the real takeaway is that the essentials you list don't, in fact, matter if you have incompetent developers.
- RugnirViking 4y agowell certainly if you have incompetent developers in senior management, but is that a surprise to anyone? I don't think a good git workflow or whatever could ever fix something like that
- gorjusborg 4y agoTo me, code review is a tool that can make incompetence a temporary condition. People have to be open to constructive feedback and want to grow, however.
- jiggawatts 4y agoHaving a code review policy is like having speed limit signs on the motorway. Without enforcement, you can make the argument that speed limits don’t save lives because everyone drives as fast as they can anyway. Same thing for code review. If it’s not policed by management, then it does nothing. I saw one place that would send alert emails if a commit was approved too fast, assuming that someone must have had it insta-approved by a friend as a favour.
- arkaeologic 4y agoJust a small note: "trust but verify" is not a reasonable statement, and it was also unreasonable in its original context, which I encourage anyone to research. If you can verify, trust is not required.
- funcDropShadow 4y agoHow do you verify, that the requirements where correctly understood, if not by having another human look at it?
- bluefirebrand 4y agoThe idea is "trust early, verify eventually" As opposed to "trust blindly" The opportunity to verify immediately is rarely available.
- ilyt 4y agoI think it is usually used in context of "we don't verify because we don't trust you but because mistakes always happen".
- mpweiher 4y ago> This guy ... has never heard of "trust but verify" I think he has, and actually knows where it comes from and what it means. "Trust but verify" is a Russian proverb that was used to describe the hoped-for and treaty-mediated relationship between the Soviet Union and the United States during the Reagan-Gorbachev era. So arch-enemies of a Cold War that are pointing world-ending nuclear arsenals at each other and slowly coming to realise that maybe it would be better to limit those by negotiated treaty. If that's a good description of the relationships in your team, then I think David Farley wasn't just right, but actually being very diplomatic ;-)
- rob74 4y agoYou can hopefully trust your colleagues to make a best-effort attempt to fulfill the requirements they are given and e.g. not intentionally introduce bugs or security issues, but everyone makes mistakes, so your software development workflow should account for this - and code review catches at least some of these mistakes.
- whatshisface 4y agoHere are some examples of trust-but-verify relationships at work: - You are allowed to expense things while traveling, but someone will look at what you put on the company card afterwards. - They don't wait on your background check before moving ahead with interviews. - Someone really should look at your code, at some point, before it is released.
- Cthulhu_ 4y agoAnd to extend the last point: before it is merged, to keep the mainline in a releasable state: 1. Continuous deployment means your mainline is sacred and always in a releasable state. 2. Unit tests and automated verifications only tell part of the story 3. Churn should be avoided (e.g. fixing code style issues); if fixes are made before it enters the mainline, it is avoided. 4. Code reviews should be asynchronous, because pulling someone out of their flow to switch to doing a code review is rude and unproductive.
- 4y ago
- guntherhermann 4y ago"Trust but verify" is a nonsense statement. If you trust, you do not need to verify, and vice versa.
- regularjack 4y agoPeople make mistakes.
- dyingkneepad 4y agoEverybody introduces bugs, and for a lot of classes of bugs the best way to prevent them is manual code reviews. Not everything can be easily caught by CI and tools.
- SideburnsOfDoom 4y agoCommitting directly to main does not imply total "blind trust" - there is still a version history. Not to mention, a test suite.
- gonzo41 4y agoAlso, when you're working solo, PR's are just a great way to look at a bunch of changes before you smoosh everything together because even with a full history it's sometimes tricky unpicking everything.
- pyrale 4y agoI believe in this context, PRs refers to a process in a team about steps to check code that goes into trunk, not to the tools that were developed to do the task.
- ritzaco 4y agoI think these days the emphasis has changed a bit from "required reviews" (more senior dev or peer signs off on code) to "request review" (developer __wants__ the review, because it's a good learning experience and a way to share responsibility for the code (and any problems it might cause down the line). Anecdotal, but I feel like I see more teams where that "Merge" button is available to most people, but in general doesn't get pressed until the code has at least one review, whereas before it was often only accessible to a select few, or a review was required before it activated.
- WorldMaker 4y agoI got into a bit of a fight over whether or not "Merge" should be an option on one's own PRs. "Trust" suggests that a developer should be able to review their own code changes, especially for small/trivial things or "expert" level things that no one else feels qualified to review and just leave open for weeks/months instead of even trying to review it (in turn often making it harder to merge without conflicts). There's a great value in "every change was peer reviewed by someone", of course. There's also a value in "not every change is significant and sometimes you can trust developers to know that". You can possibly install the fear of accountability if a bug happens in code that the reviewer was the developer until they want that learning opportunity of a code review. In my experience, most of the "expert-level" developers almost always would love any feedback anyone wanted to offer because their imposter syndrome tells them it is awful and not to sign off on it, but are also more likely to get blocked if their PRs don't move fast enough.
- dahart 4y ago> PR is about verifying This is interesting as a counterpoint to trusting, but it’s funny, I’ve never thought about PRs in either of those terms, not within a team or company anyway. The Pull Request can also be about the code writer asking for review, asking the question ‘is this generally the right way to go?’ The funny thing about projecting ‘trust’ and ‘verification’ onto the process is that PRs simply do not prevent all or even most accidents, automated builds and tests are better at that. PRs can help steer things in the right direction, and they’re good as one of many tools for mentoring people about code they’re unfamiliar with. But PRs can also be used as the opposite of verification: if the reviewer is responsible for verification then PRs can be a CYA where the reviewer is implicated in a mistake along with the writer.
- lowercased 4y agoI've had groups where I eventually 'approved' a PR, because... deadlines... even when it wasn't meeting defined standards (primarily around tests/docs). Comments like "please add a test" or "please document X" were just ignored (both inside the version control system and in slack). Eventually, I would merge, and occasionally, we'd hit some bug, trace it back to that, and I would catch blame for "passing" it. Not the person who wrote it, not the same person who didn't test it or add any automated tests. I did, even though I was doing so under protest. The couple times I added to their PR - added a test to verify behaviour, for example - I got called out for "stepping on others' code". Apparently if you went out on smoke breaks with 'the guys', they were 'cool' wit h you and that was the political way of getting people 'on your side' to go along with stuff. Very ... odd dynamics. Apparently, if you're dating the dept head's niece, writing tests was optional, but I never got that memo.
- SkyBelow 4y ago>trust but verify If you have to verify, is there really trust? We need to get to the point that a lack of trust isn't some inherently bad thing. I don't trust myself to never make mistakes. A PR is a way to get others to add a layer of verification to help catch bugs. I don't even trust the PR to catch all bugs, but it is a cost effective for the amount of bugs it does catch. Why is this lack of trust a bad thing? Humans are imperfect, we should build systems that require verification because we cannot trust ourselves to never make a mistake.
- burnished 4y agoIn this context if you arent trusted then your PR isnt even looked at.
- ilyt 4y ago> This guy (not the post author, but Dave Farley, the guy who wrote the above excerpt) has never heard of "trust but verify". "This guy" sounds like someone that never worked on project size bigger than one. It is utterly idiotic take, on every level.
- nanidin 4y agoA PR is just a properly scoped nugget of review-ready changes. A formalized review process helps way more than it hurts in the long run.
- dkersten 4y agoYeah. I trust my team mates, but we use PR’s and approvals as a means of doing code review to make sure things don’t slip through and that everything has had multiple eyes. It’s not about trust, but improving quality, because we’re humans and humans miss things or make mistakes. It also provides a nice record of why changes were added, a place to link tickets/documentation, automaton hooks etc. I love PR’s as a concept and tool. I also often use PR’s to merge changes on my personal projects even when I’m the only developer.