This is a free preview of a paid episode. To hear more, visit refactoring.fm
Today's guest is Greg Foster!
Greg is CTO at Graphite, a tool that helps teams do better code reviews, and smaller and faster code changes.
ποΈ Episode
You can watch the full episode on Youtube:
Or listen to it on Spotify, Apple, Overcast, or your podcast app of choice.
π₯ Interview Summary
If you are a π paid subscriber π you will find my own summary of the interview below.
Itβs the 10-minute, handcrafted takeaways of what we talked about, with timestamps to the relevant video moments, for those who donβt have time to sit through the 1-hour chat.
Here is the agenda:
* π Graphite and stacked changes (01:07)
* π Code review best practices (17:41)
* π€ AI's impact on software development (29:22)
* π¨βπ» Graphite's engineering team (41:05)
* π Deployment and staging practices (47:32)
β Let's dive in π
1) π Graphite and stacked changes (01:07)
Greg Foster explains that Graphite is a code change collaboration tool that works on top of GitHub. Its main goal is to help teams create, review, and merge code changes more efficiently.
Greg also provides a historical perspective on engineering practices, highlighting a continuous trend towards faster and smaller code changes.
* Today - need for even faster and smaller code changes
Graphite aims to continue this trend by enabling developers to break down work into so-called stacked changes. Stacked changes have been used by big tech companies like Google, Facebook, and Uber, for a long time through custom tooling, as they offer several advantages:
* πββοΈ Unblock engineers - they allow engineers to continue working on code without becoming blocked by reviews.
* π Improved quality - they split in smaller batches, which improves the quality of reviews.
While this workflow is also possible without specialized tools, it easily becomes cumbersome. Graphite aims to make this process seamless for teams using GitHub.
After this intro, we moved to discuss code review best practices π
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_01I mean, the principle, we can step away from stacking, but this general idea that code changes really benefit from being smaller, I think is so key. I think there's Google research papers that go back like 15 plus years ago that they would study this and they'd say, okay, whether it's the quality of the review, whether it's the number of bugs, how likely it is to be rolled back, almost everything benefits from the code changes being smaller.
SPEAKER_00Today's guest is Greg Foster. Greg is CTO at Graphite, a tool that helps teams doing better code reviews and, in general, doing smaller and faster code changes. With Greg, we talked about what good code reviews look like, how AI is changing the development process, and how the Graphite engineering team works. So let's dive right into it after a short word from our sponsors. Introducing Sidebar,
SPEAKER_00an exclusive, highly curated leadership program designed to propel you to new professional heights. Picture yourself being a part of a dynamic network of peers, including Fortune 500 leaders and groundbreaking startup CEOs, all offering their unique insights and expertise to fuel your journey. Sidebar is a tech-enabled version of the Braintrust concept. They provide a supportive and diverse professional circle for in-depth advice and
SPEAKER_00honest feedback, leading to substantial career growth. And the results are palpable. A staggering 93% of members affirm that Sidebar has been a game changer in their professional path. Nothing propels your career trajectory like a robust peer group. Learn more at Sideboard.com and join thousands of top senior leaders from companies like Microsoft, Amazon, and Meta who have taken the first step towards accelerating their career.
SPEAKER_00Hey, Greg, welcome and thank you so much for being here with us today. Thanks for having me, Luca. I'm excited to be on this podcast. Yeah, my pleasure. So, Greg, you are CTO at Graphite, which is a tool that helps teams doing better code reviews and in general, I would say, doing smaller and faster code changes, right? Exactly. So, as you know, because we have talked about this before, I got to know Graphite quite a long time ago, I think more than two years ago,
SPEAKER_00while I was doing research for an article on the newsletter about code reviews. And I remember your tool being on private beta back then. And fast forward to today, it is used and supported by hundreds of organizations. So first of all, I'm amazed by your journey and congrats for that. Yeah, thank you for the kind words.
SPEAKER_01It's been incredibly fun to be building this for the last few years.
SPEAKER_00Yeah, yeah, I can imagine. So my first question is very simple and is, in your own words, what does Graphite do?
SPEAKER_01Graphite fundamentally is a code change collaboration platform. So it's tooling to help you and your team work together on creating, reviewing, and merging in code changes. If you think about GitHub as an incredible platform for hosting code bases and then doing work in and around that, Graphite is a layer on top of GitHub with a pure focus on the code changes themselves. And a little bit of the secret sauce and what we bring into that is ways to keep
SPEAKER_01those code changes really small and really fast. And as teams create higher volumes and higher velocity code changes, you need a lot of assistance in keeping them moving really quickly. So we do a lot of stealing big ideas from Google and Facebook and Uber and other companies who have been really innovative in the space. And we try to bring those same ideas into a client that syncs right on top of GitHub and lets 99% of all the other developers in the world have access to this high velocity tooling. Again, all in the same spirit of keeping those code changes moving really fast.
SPEAKER_00Yeah. Yeah, that's perfect description. So you mentioned big tech companies like Facebook, Google. So let's dive right into it. Because when I was doing this kind of research and I stumbled onto Graphite, it was because I figured out that big tech companies in many cases were doing code reviews in a way that was different from other companies. They did, and you will explain this better, stacker changes, stacker divs. And back then there was basically no way or just cumbersome ways to replicate that
SPEAKER_00kind of workflow if you were not in one of those companies that were using like custom tooling for that. So how is this workflow different from the regular, you know, GitHub PR workflow that most companies are used to? And why should it be better for these companies? Totally, totally.
SPEAKER_01You know, I think about this because I myself have, despite helping be instrumental in building and creating momentum around stacked code changes, I'm also relatively new to this. I used to be a dev tools engineer at Airbnb. And at Airbnb, we used vanilla GitHub and we had very simple, straightforward PRs. For a decade, folks, like I said, at Facebook and Uber and some of these companies using Fabricator have been using the more advanced workflow, but I hadn't been exposed to that.
SPEAKER_01I think like most developers in the world, they're familiar with just creating vanilla GitHub PRs, vanilla Git branches. And what I think is kind of interesting is if you look back even further, like over the last 40 years or so, software development, it is this continuous march in one direction towards faster code changes, towards smaller code changes. You have a world where you used to have annual software release cycles. People would work on code. They'd sit at a desk shoulder to shoulder, like reviewing it, looking for bugs.
SPEAKER_01You have a world where source code starts being stored on servers and people are checking out different changes and inspecting it. And eventually in the mid 2000s, you get to this world where Git becomes really popular. People are putting up pull requests. The idea of a code change starts becoming its own entity. It's something that gets tested, that gets reviewed, that gets commented on. That becomes more and more popular. And that's actually where a lot of the world has kind of stalled out on. So we're still in this world for the last 10 or 15 years where we're just looking at these pull requests.
SPEAKER_01But if you pull in that thread and you keep going further, you can say, okay, hey, a 500 or 1,000 line PR that gets reviewed on median in like 18 hours, maybe slower, we can actually do better than that. What would it look like for that to be broken up into smaller code changes Maybe each is, on average, 50 or 100 lines. Each can be independently reviewed or passing CI. And then you can either merge them in one at a time, or if a batch of them are ready, you can merge them in all at once.
SPEAKER_01But most importantly, you kind of start unlocking parallelization. Because up until this point, each time an engineer works on a code change, You put it up and you're somewhat blocked. You can either continue expanding that same code change or you can work on something else. You could try to branch off a branch. This is what you were talking about. You could try to do this without the assistive tool. You could try to branch off a branch. A lot of engineers at some point in their life give this a shot, but really quickly you get feedback on the first PR and now you're trying to
SPEAKER_01incorporate that and you're trying to rebase your second and third PR on top and it becomes this kind of a car crash. But the premise is there. If you could do it, it would be really powerful. It's almost, you know, what's interesting is if you think about this hard enough, it almost reminds you of what Git originally aspired to do, which is that you'd have a feature branch and you'd create a commit and you'd work a little more, you'd create a commit, you'd work a little more. And it seems like we lost our way a little bit. When we started doing these pull requests, it didn't really matter what the commits were on the PR. You just have an atomic change and that would get merged in and people could try to
SPEAKER_01manicure their commits, but you were pretty much blocked. So a lot of what Graphite and the stacking workflow that's bigger than Graphite, a lot of this idea is to say, okay, let's keep chunking this down to smaller and smaller bits. Let's make it less waterfall, more continuous, Don't be blocked. Allow these changes to be parallelized, reviewed, passing CI merged in. Yeah, and I think to me that this is just such a natural arc of history. And because of where we're at, it's not trivial without extra tooling, but it is the right idea, I think.
SPEAKER_00Yeah, I love the whole perspective that you said at the beginning that we not just in code reviews, but in the general development process, we are moving towards doing things faster in smaller batches, more frequently. And I think we're seeing that on so many levels, you know, even I think a lot of the progress in the development process can be explained like that. You know, the whole even agile versus waterfall is basically let's do the whole cycle smaller
SPEAKER_00and more frequently. That's driven development. Let's test things earlier and do more frequently. And now we're seeing that with code reviews, et cetera. And Code reviews are just a part of the workflow, but are you seeing also them maybe looking at companies who use graphite embracing more other continuous delivery practices like trunk based development and short lived branches? So do you advise for combining this kind of workflow workflow with other practices as well?
SPEAKER_01No, yeah, I completely agree. Yes, is my short answer. We are in the really wonderful spot where we have users at so many amazing companies. It's engineers at Datadog and Vercel and Asana and all these really, really amazing companies. And we get to talk with them and see what their top-notch development practices are, see what's trending in the industry. And we have to look at this because we're trying to build features that support this. We're saying, what's actually trending here? And What's interesting to us,
SPEAKER_01we started at this intersection of code review for a very specific reason, because we think that it's one of the less-innovated areas, and it's one of the slower blockers. Think about it, deployment these days takes maybe 30 minutes, maybe an hour. Running your CI maybe takes 20 minutes. Creating the code, that's up to you. Maybe that takes an hour, maybe that takes a day. That's up to you. But the reviews, like I said before, you know, on average, on median, it takes tens and tens of hours,
SPEAKER_01maybe even more than a day, even at really top notch companies. So we're like, wow, this is really it's a really interesting blocker in this in this workflow process. But it's but it's required for security compliance for so many good reasons. You've got to you've got to have eyeballs on that code review. Yeah. And what's more, it's also the perfect intersection for collaboration. If you think about, let's say you and I, Luke, are on the same engineering team, and you're over there coding in Vim, and I'm in IntelliJ or VS Code, and you have custom scripts, and I have my fancy keyboard that's split.
SPEAKER_01We will have quite a different engineering set of tools and practices until we get to the pull request page. That is the first part, and I think in the software development lifecycle, where suddenly we are using the exact same website, the exact same set of tests, the same rules about what can be merged, what can't be, we're looking at the same interface. So I think it's the ultimate branching off point for collaboration, and like you were kind of talking about, all of these more unified and standardized set of principles. You might have been doing whatever you wanted locally, but now we're both doing trunk development,
SPEAKER_01and now we're both doing continuous integration testing and continuous delivery. So Graphite, we really wanted to get involved at what we thought was the most center part of the process, and then honestly work with teams to help continue leveling them up. Say, hey, we can help you with the code review, but also if you're really bought into small, fast code changes, you have a whole host of problems. Yeah. Problems around merging in a ton of more code changes. You have challenges around executing your CI really quickly, around discovering code changes that need to be actioned rather than waiting for
SPEAKER_01your teammate to send you a Slack ping. There's kind of these branching off problems. If every engineer creates five times the number of PRs, you actually create a whole host of problems. And we try to get in at that moment of collaboration, help advise the best possible practices. Trunk-based development, like you said, is one of those ones where we're very strong believers. Monorepos, there's a whole host of these that we see trending.
SPEAKER_00So are you a believer? I mean, I'm starting from the end. Are you a believer in monorepos versus polyrepos for the dev process in general? I would say in general, yes.
SPEAKER_01And there's no such thing as a one size fits all rule. There's always special cases and stuff. But in general, for closed source development, I think monorepos are usually the correct call. And historically, I think some things have gone wrong here. I think in the mid 2010s, poly repos and microservices got really popular. Kubernetes was exploding. Everyone was creating all these different microservices. And I actually think there was a little bit of a conflation of a microservice and a poly repo.
SPEAKER_01They thought each service needs to go into its own repository. I watched Airbnb walk down this road. But I think a lot of the drift, a lot of the retaliation against monorepos and the excitement a decade ago for polyrebos was partly from a lack of tooling. I saw this happen at Airbnb where there was a major frustration point in the merging and deployment process, for example. If you had a large enough team, people would really start stalling out on those merged trains and trying to get their changes in without hitting conflicts, without breaking CI. And they would realize maybe it's just easier to put it in its own repository.
SPEAKER_01But i think that that ideally you're actually in the same same repository and you have smart enough tooling to help you manage those conflicts i look at google's like it's like one of the world's best you know players in the space and they're very sophisticated um they have systems called like tap they have very sophisticated systems around how they're testing very quickly merging in and automatically dqing for merge queues and so on yeah changes so that they can, I think they have multiple commits every second into this insanely massive monorepo. So if you have sophisticated enough tooling,
SPEAKER_01and Graphite's trying to provide this, there's open source tools, there's other companies, but if you have good enough tooling, I think monorepos are the best option. And why? I think the atomicity of being able to make individual changes without having to do multi-step deployments, to do sweeping code mods. This is so powerful for the high velocity needs of a company. I think it's worth fighting for and trying to solve the pain points around.
SPEAKER_00Yeah, this is very interesting because I think there are a set of practices that we believe they are like agnostic from tools. While instead, when you look deep down enough, you discover that we actually do the things in some way because of the tooling limitations. Maybe we are not even aware of that. So what you're saying is basically. the whole poly repo practices have proliferated because whether people understood this or not,
SPEAKER_00tooling was limited. And so there was not a good way to handle multiple services and separate deployments within a single repo, but the tooling is there now. And so there is, I mean, you're left only with the drawbacks of poly repos, basically with none of the, none of the upsets.
SPEAKER_01Pretty much. And I think that maybe the one exception I'll carve out, there's maybe a couple, but one worth calling out is sometimes I think companies have open source needs and they want to be able to open source part of their code, but not all of their code. That's maybe a good example of like when you'd want to bring in a separate repository. But I would advise if I'm speaking to a friend, I would always advise them like, hey, start with a monorepo unless you have a really good reason to move away from that. Try to keep it there as long as you can.
SPEAKER_00Yeah, yeah, that's a great take. So another big divide, I think, in code reviews is whether, I mean, figuring out when it's worth it to have a synchronous code review, like you pair on code reviews together with the author versus when it is better to have, you know, asynchronous code reviews like most companies do. Because many, I mean, we have had a thoughtful conversation in the refactoring community also on this. Many believe that Asynchronous code reviews tend themselves sometimes to be shallow because the
SPEAKER_00reviewer has little context. It's hard to replicate things, check for correctness. So many times you're better off just pairing with the author and that can walk you through the changes. You have smaller cycle time in general and the deeper review as well. So do you have any experience or advice based on how you see companies using graphite or doing code reviews in general about this?
SPEAKER_01Yeah, it's an interesting question. You know, this one I'm a little bit less opinionated on. I don't want to be too prescriptive on. how someone should be going about conducting the code review. But I do have a lot of reflections here. You know, you mentioned cycle time, right? Keeping cycles and iterations down. How many back and forths are people having? And is there a day in between every one of those back and forths? You leave comments. I fix them. You review it again. I address it again. Do we just waste four days going back and forth? And should we have just hopped on a phone call or grabbed a whiteboard to talk it out?
SPEAKER_01Definitely, that's a real consideration. I think... Within like, you gotta kind of anchor to like, why are people doing code reviews in the first place, right? There's a variety of reasons. One, security, that comes up a lot, right? Like you wanna actually be making sure that people are thinking thoroughly about the code changes that two pairs of eyes are being put on every single code change. You want knowledge sharing. You want to make sure as people are constantly evolving this code base, their teammates understand what changes are happening so that their coding and
SPEAKER_01their thing about architecture, they have a loose understanding of what's going on. You want consistency. Maybe folks are adding a new endpoint, but they're not doing it in a way that's consistent with the practices of the code base, and they don't know until their teammate flags it. Sometimes you have nits. I'm kind of a proponent that in general, nits should be attempted to be encoded within linters. And if you're creating a lot of nits and things, it's maybe a sign that you should be trying to automate some of that. Bugs themselves, I actually think you should try and call it out if you see it in a code review.
SPEAKER_01But code review is not a fantastic place for catching bugs. I think those are better caught within automated testing, monitoring deployment practices. That shouldn't be the primary responsibility. It used to be. It's interesting. If you think, again, back to very, very old school code reviews, it was more focused on how many bugs and faults could you find. But now that we have all these really modern practices around continuous testing and monitoring, I think it's less of a primary focus for code review. So these are some of the things that you're trying to get out of it. So the next question is, how can you get all these things out of good code review while keeping velocity
SPEAKER_01high and keeping developers unblocked? Because that's the con, right? You don't want to be doing all this back and forth, these cycles. but then causing engineers to sit on their hands or have to go for more lunch breaks than they want to. And I think like, how do we achieve that? keep those code changes really small, utilize tools or best practices like stacking so that developers can keep coding even if the person who needs to review it is far away or can't meet synchronously. And then lastly,
SPEAKER_01I think there's a really human element you kind of touched on this, which is at a certain point, I personally, if I go back and forth one or two times in the comments on a PR, I just want to talk to that person. We can really usually just talk it out, talk about the concerns, get on the same page. And then I'll go back to that PR. I'll write down and say, hey, we met offline. We talked it out. This was the conclusion we came to. And then we'll just proceed. And it's in vain of like, how do we keep the velocity high? How do we stay unblocked, but also honor what we're actually doing in this code review?
SPEAKER_00Yeah, I love that you went back to, you know, first principles about why we are having even code reviews in the first place and mentioning that this code probably changes over time, even because of better and better tooling that is more and more able to catch up things that before were just caught by humans and now you have tools for that. In my professional experience, I've always worked in workflows where basically all changes needed to be reviewed
SPEAKER_00by other humans, right? And lately I've started even try to challenge this because I think that tools like pipelines are becoming better and better. Static analysis is getting better and better, even thanks to AI. So there are some changes like, you know, you are the bug fix, you are just a test or you're updating documentation, you're updating dependencies that maybe are not even worthy of a manual review, because if your pipeline is mature enough and there is not much knowledge to be
SPEAKER_00shared back to the goal of sharing knowledge, So do you think that all changes should be reviewed by others that is not the author? Or do you think that in mature workflows, you can automate part of the more trivial code reviews?
SPEAKER_01Yeah, it's such an interesting question. You know, I think back to the companies I've had a chance to work with. One, I don't think I'm giving away a secret, but, you know, one company I think is so interesting is Watershed. They do carbon credits. They're a really popular company out in the Bay Area. And for the longest time, they did post-merge code reviews, which I found so interesting. I'd only ever heard of a couple of companies. They were one of the biggest modern companies doing this. where they would say, I don't know if this was, I think this was most of their code changes.
SPEAKER_01Maybe there were some areas of the code base they wouldn't, but they would have a practice where you could, if you pass CI, you could merge in. And then I think someone was encouraged to give it a post-merge review, but they didn't want to block on it. They wanted to keep the velocity high. And they believed that their pipeline and their tooling was sophisticated enough to catch most of the common problems here. And perhaps the context can be caught asynchronously. Perhaps, I don't know, perhaps they weren't as worried about security in different areas of the code base and so on.
SPEAKER_01What's also really interesting, they've also just rolled back this practice. They've just cut over to pre-merge code reviews as a more standard practice. So I was really interested in kind of watching them. They were a Graphite user and they were able to use Graphite regardless, but I was curious, and I'd ask them, like, how's that working out for you? Like, is this really, really helping? And I think that this is a case where diverting from the norms wasn't particularly helping them, and they end up moving back to a more normal practice as they got bigger and more sophisticated.
SPEAKER_01So this is kind of one interesting answer to your question. I'm unaware of any company who's gone long enough, hard enough, um and and and really deviate from code reviews now you point out also like what if it's a data science repo what if it's uh documentation what if it's like internal test or another a really common one will be what if you're spinning up a new internal service but it's it's not externally exposed and you're just trying to get some some rapid zero to one boilerplate in there these are cases where i think one can be a little bit more relaxed about code review um i think it needs to be case
SPEAKER_01by case you need to you need to ask the question i think Am I okay with the security implications? Am I okay with the lack of context that other people are going to have around me? If so, I think it's a fair trade-off. And you're saying, hey, I want to move exceptionally fast. I'm okay sacrificing these other principles. In general, at scale, even with the assistance of AI, I'm not aware of a good way around this.
SPEAKER_00Yeah, I mean, I would love to hear the story about how that company rolled back from post-merge reviews because they look like a reasonable solution. Not for changes, of course, but for a good chunk of changes for which maybe you're okay with sharing knowledge later, trying to improve quality later, but you're not too much concerned about... security or finding bugs early. Maybe there is a whole set of changes that fit that kind of definition. So if you talk with them, feel free to reach out and let me know.
SPEAKER_01Tell me. I was reflecting. I think that there's a question of if someone really wants to skip code review, what's the desire within that? Again, I think it often comes from a really nice place of urgency, of velocity. You're passionate about what you're building. You want to get it out there as fast as possible. My answer to these people, and of course I'm biased because of what I work on, but I really do believe there's a correct answer and it's some sort of stacking-based workflow. What can you do to remove that blocker?
SPEAKER_01Why do you feel like you need to bother your teammate to give you a review faster? It's because for some reason you feel like you can't keep proceeding and developing and expanding your work until they unblock you and give you an answer. And the more that we can decouple the code reviews from your sense of continuing to engineer, what we find with engineers, and you talk to Facebookers, they'll tell you this, they aren't too fussed about how slow their teammate is about getting around to reviewing them because they weren't blocked. They'll create 10 or 20 or even 30 PRs stacked on top of each other.
SPEAKER_01And whenever their teammates get around or several people get around to reviewing them, great, boom, I'll batch merge them all in. But there isn't that same sense of urgency. And I think it's worth asking ourselves like, why do we feel the need to skip code review and is it is it kind of the wrong answer to skip it is is there other things we could do to keep moving really
SPEAKER_00quickly yeah i i love this angle i think the primary goal is to not keep people blocked you know not bottleneck other people so it's exactly what you said and i think you know this bottleneck might be either you know people are blocked from doing additional work Or the pipeline for deploying is cumbersome and unreliable, unpredictable. So people don't know exactly when their code will go to production. And so they can't check for logs and instrumentation in production to see that everything works.
SPEAKER_00they have to context switch. They lose some kind of context and so everything gets messy. I think these are kind of the situations. But as long as you can stack your changes and keep working, of course, it's fine, in my opinion. The important thing is that you don't get blocked. Exactly, exactly. Yeah. And so based on the scenarios that you have seen, companies were using graphite and more, what are the most common mistakes people do with code reviews?
SPEAKER_00I think many we have already mentioned, but what are the most common offenders?
SPEAKER_01Yeah. You know, one that comes to mind is And it's not just the reviews, it's the mutual effort, but it's people putting up too large of code changes. I mean, the principle, we can step away from stacking, but this general idea that code changes really benefit from being smaller, I think is so key. I think there's Google research papers that go back like 15 plus years ago that they would study this and they'd say, okay, whether it's the quality of the review, whether it's the number of bugs,
SPEAKER_01how likely it is to be rolled back, almost everything benefits from the code changes being smaller. I think there's memes online where if it's 100 line PR, you'll get five comments. And if it's a 5,000 line PR, you'll get like an LGTM. People's eyes just glaze over. I think this is one of the most common mistakes I see in the world of code changes is an engineer, you know, they're just going along, they're just kind of bloating and expanding and creating this big code change. They put it up, they're gonna get a mediocre review.
SPEAKER_01They're also, maybe they're gonna fail CI and they have, it's a lot harder to debug 5,000 lines rather than if you had five different PRs and only one of those failing. It's much harder to isolate what's actually going wrong within that code change. And yeah, for all these reasons. And then you merge it in and you have one little bug and you have to roll back the entire effort. If you'd broken that up, you can merge in some of the code, it'll stay, one bit needs to be rolled back. I watched people create two large code changes and I think it hurts the whole process a little bit.
SPEAKER_01It's a cosmic state. We've all been there where your teammate in code review says, hey, can you please break this up? You're like, I really don't want to, but you know it's good for you.
SPEAKER_00Yeah, I agree. And another trend that I think it's very interesting is how AI is possibly changing the way we are doing this part of the workflow. Because with AI writing more and more of the code that an engineer produces, do you think this is going to change how we are going to review code or maintain that kind of code? Do you already see something from your point of view?
SPEAKER_01I do, I do. I think it's so interesting. I mean, I would say half our team uses Copilot or other tools to help create code. I know some of the statistics that have been published by GitHub that first it was 20%, then 40%. Now I can believe it's cusping over 50%. of code being generated is AI-assisted, Copilot, Cursor. You have agents creating code like Sweep and Devon.
SPEAKER_01To some degree, some good amount of all the code that is flowing through the systems is becoming AI-generated. And it's not so scary. The whole PR was created through AI. It's often like half of each line was created with AI. But it still begs the question, what are the effects of this? And I think There's a couple of downstream effects. One is that there is a meaningful increase in the net volume of code that the average engineer is producing, especially as we keep pulling on this thread. It's kind of good, but it's kind of interesting.
SPEAKER_01A 10-person team may be producing the amount of code that a 100-person team used to be producing. A 100-person team is now acting like a 1,000-person team. And what downstream effects does it have if people are putting up more and more code? It's going to put strain on these other parts of the system. The review, your CI machines are going to be running hot, your deployments are going to be getting clogged up. How do we make sure that the whole outer loop of software development, everything that's not just you at the keyboard creating the code, but everything around that is still operating really smoothly?
SPEAKER_01Let's assume that AI is helping create these code changes, but it's resulting in volume. And I think about, you know, as AI gets more sophisticated, is there ways that it can intelligently help these other aspects? And the quick answer people will jump to is they'll say, okay, well, can we just get GPT to review this stuff and check it for us and help us test it? And maybe not merge it in, but, you know, at least do some of this. And what we found through kind of studying this is not really,
SPEAKER_01it may be able to help in aspects, but there's something really core to humans being in the loop and reviewing and considering and reading these code changes, even if they're AI-generated. Perhaps even more importantly, if they're AI-generated. Because sometimes the AI-generated stuff... The original author hardly read it in the first place. Their own eyes glossed over. It's almost doubly important that you have at some point some human checking this. This is critical for security. This is critical for that context building. It's critical for catching really subtle bugs,
SPEAKER_01which I know we were saying, hey, code review is not the most important for catching bugs. But it has been shown time and time again that a lot of this AI generated stuff has very subtle bugs involved in it. What we're seeing, and you asked me what trends are we seeing, we think that the continued more and more code being generated by AI is actually putting more emphasis on review, CI, and deployment, and kind of the human elements of that. You might be able to use AI to help with some level of like linting and checking
SPEAKER_01for common nits and checking for consistency, but I really don't see any time in the future, even if it gets a lot smarter, where you're gonna remove humans from reading that code. Even though my most base argument is a security consideration. Let's say you have a malicious actor in your company. You've got to have a second pair of eyes considering that. I don't want someone writing a comment that says, the line below is guaranteed secure, I promise. And then an AI reviewer reading that and being like, oh, well, it's so easy to trick these bots. You wouldn't want to see that happening in important code bases.
SPEAKER_01So those are some of the downstream effects we're starting to witness here.
SPEAKER_00Yeah, it's all very interesting. And I know it's also all very early. So we are kind of speculating about where this is going to go in the next few years, because I mean, things are changing very rapidly. So do you think that I mean, the development process has several steps and parts. Do you think that AI is going to affect all of them horizontally, like AI behaving like other humans, basically doing everything that other developers do? Or are you seeing that,
SPEAKER_00for example, we are going to split duties and responsibilities, like, for example, code reviews might be something that humans for security and other reasons we keep doing more than AI or maybe AI writes the code and we write more tests, not to have the same people doing the same stuff. Are you looking at patterns already or is it too early?
SPEAKER_01You know, my sense of it so far, we are in the world of speculation, you know, but my sense is that I don't think it'll be pure divisions of responsibility. I think that the shape it's taking is that of a modern tool. You know, our text editors get better. They used to not have syntax highlighting. Eventually, they have syntax highlighting. They used to not have, like, tab completion. They get tab completion. This happens across so many industries. Whoa. whether you're an artist or you're a dentist or car mechanic,
SPEAKER_01you get better and smarter and more advanced tools. And I, and often this takes the form, not of like, okay, we no longer need to do half our job, but rather I can, I can do it faster, more effectively with higher leverage. I see that happening within software engineering. So on the code creation part of it, I think it's going to remain crucial that you have a human at the helm thinking about the architecture, thinking about where they're trying to take the product, what problems are they trying to solve? and the AI is going to help them put pen to paper a little bit faster,
SPEAKER_01a little bit more consistently, avoid Googling things. Review, I could imagine the same thing where it's still critically important you have a real person considering the implications of that code change. But perhaps AI is helpful in summarizing, in explaining, in referencing and pulling context from other parts of the code base for old code changes that you might not easily have access to. So what is GPT so good at? It's good at translation, summarization, and search. It's not always the best at really advanced reasoning.
SPEAKER_01So I think you can layer this in. Maybe an author is going to be able to do slightly higher quality code reviews. Maybe they're going to be able to do slightly more code reviews. Maybe tests and failing CI, you're gonna be able to analyze that a little bit faster. You're gonna be able to like pull out exactly what went wrong, flag it to the author, let them create the change. The builds and deployments I think about too. That one I actually don't have an immediate answer to how AI will help that. I think Bazel and Buck and some of these DAG based deployment systems
SPEAKER_01are about as optimized as possible through caching and parallelization. It's not clear to me that AI will boost that. And I think deployments are in a similar boat where they're mostly rate limited on the upper echelons of caching and parallelization. Maybe AI helps people just maintain those YAML files a little bit better, but I think that part of the software release cycle will not be hugely affected.
SPEAKER_00Yeah, I love thinking about this and this kind of speculation. I think there is a lot that is going to change, both on how we work on the actual development cycle, and also I think in general, the whole... software model, open source model probably is going to change in some way because, I mean, I've been trying these very recent models like Cloud 3.5, GPT-4.0, and they're amazing at writing code. And one thing that I noticed, for example, is that they tend to write most of the code from scratch,
SPEAKER_00right? Or all the code from scratch. I mean, when you're a developer, your first instinct when you have to do something new is, let me find a library that does that, right? And that's not what AI does. And AI tends to, they want to write all the code by themselves. And I think that's gonna change, you know, code bases significantly. I mean, not necessarily for the better or the worse. I mean, you will have probably less dependencies, which might be, you know, for the better in some cases. But also, you know,
SPEAKER_00I wonder where this leaves the whole, you know, open source model that has worked very well so far And I'm not really sure. I mean, I don't have a question about that. This is just some thoughts that I was thinking while you were speaking.
SPEAKER_01You know, the other thing I imagine that I'm also thinking about here is the further and further emphasis on smart architecture, clean coding principles, really understanding the bigger picture of software engineering. I think that AI is doing a pretty good job of... the really nitty gritty, like given you wanna write this function, it's gonna help you complete that function. And you're not gonna have to remember the syntax, but you still need to be really thoughtful around what are my interfaces? How am I modularizing this?
SPEAKER_01What is like the general complexity and all the different dependencies? What are the possible ways this can break? How am I thinking about testing and monitoring and observing this? That stuff, I don't know, maybe one day there'll be an AI architect, but that stuff is not going anywhere anytime soon. It makes me a little bit concerned, honestly, for... The employment industry, because I think about this, it's often in the life cycle of a software engineer, you have like an intern or a new grad really focusing on just getting that function right, fixing that bug.
SPEAKER_01And then as they mature and they get reps, and now they're thinking about project management, they're thinking about the architecture, thinking about the life cycle of how the system is going to go, and they're leveling up into that. Now, what happens if the earlier stage of work is being a little bit more automated or trivialized? And the emphasis and values being put on the higher level of work, what is the path for like a new grad to get into their career into the higher level? That's a little bit concerning. I hope there remains a really healthy path. And, you know, maybe this is trivially solved because...
SPEAKER_01Young folks are really smart and they're going to pick up the tooling and just immediately advance to those higher levels. But I really do maintain faith that there's great value in the big older principles, whether you're clean architecture, some of these older textbooks that you can read. I think a lot of those principles are more valuable than ever. The more we trivialize just the really basics.
SPEAKER_00Yeah, this is so interesting. I think your remarks about the you know, the, the, the journey of junior, uh, engineers, that's really, uh, a really on point. And I mean, what happens if, you know, the work of junior engineers is, uh, all of a sudden basically free, you know, and of course maybe the, the work of senior engineers is even more valuable than before, but how you get there, if, if companies stop or, I mean, or, or hire way less junior engineers than before.
SPEAKER_00Yeah.
SPEAKER_02Yeah.
SPEAKER_00Yeah, it's sick. We will see. But I mean, this is a very interesting conversation. So speaking of teams and speaking of seniority and how engineers work, I'm curious about Graphite itself. So how is your engineering team organized? I mean, how many people, what kind of teams, managers, how does it work?
SPEAKER_01Absolutely. Yeah, we are a relatively small startup. I think we're about 22 people as of today. If you're watching the video stream, you can see behind me, I'm sitting in an office out in New York City. We're full in person five days a week, which is semi-uncommon for tech companies these days. We also chose to be based out of New York, which in 2020 was a little bit more scary for a pure DevTools company. And I'm so excited and proud to say that that has never been a blocker. And as we've been out here,
SPEAKER_01I think there's been more and more growth around deep tech out in New York City. It's not been purely e-commerce or fintech, which has been nice to see. Our team is about... I would say roughly half engineers and half folks working on product, design, go-to-market, other functions. But across the board, it's a very technical team because we're building the most dev tool of dev tools. We're building the software collaboration tool. And every one of our features is like a deep dive into how Git rebases should work
SPEAKER_01or how exactly should it function in the terminal. And so... Every person, even if they're not an engineer, needs to be a little bit technically minded. And we try to get everyone involved in using the product day to day. I have never worked on something that is more dog fooded than graphite. Every person on this team uses it for hours every day just to build it, just to look at their code changes. Once in a while, someone goes back to GitHub and literally people on the team will be like, oh my God, I don't even remember how to review a PR kit. I've forgotten where the buttons are because I've been so...
SPEAKER_01in the graphite workflow um but the way we structure it it's it's um a single person acting as engineering manager currently that that's me one of the founders and then uh like i said about 10 ic engineers folks across the board are operating mostly at a senior to staff level um a board of experience responsibility not because you know we think that that's the be-all end-all but We're looking for folks on this team to be very thoughtful and wise and experienced
SPEAKER_01in the world of engineering, because we're trying to give teammates high autonomy and decision-making over not just how to build a good product, but how should engineers around the world create code, right? We are defining patterns and defaults and workflows for such smart people. Like I said, you know, it's like the people we look up to, like Purcell, and Datadog and Figma, these are amazing engineers. And we're going to them and we're saying, hey, we really think your default workflow should be this. And when you run this command, it should do that.
SPEAKER_01We strongly don't agree with that type of merging. the people on our team better be really thoughtful and experienced in order to be weighing in on those discussions and building that into the product. So we kind of bias a little bit more senior, I think, than average. But yeah, it's an absolutely amazing, geeky, nerdy team, folks who are just true craftsmen about software engineering as an art.
SPEAKER_00Yeah. I love how you explained why it is absolutely necessary that people have to be thoughtful and experienced about that. And I think there's a lot of controversy about startups that need to ship fast and do this kind of MVPs, but I think it's more nuanced than that because the The V in MVP, the viable, pretty much depends on what you're building. I mean, in case you're doing something completely new, then you can probably, you know, afford to release something that is a little bit more scrappy.
SPEAKER_00But I feel that in your case, the bar that you have to clear, you know, with respect to, you know, win over the status quo is so high. That viable for you means an incredibly thoughtful product that has all the corners figured out. And I totally understand that. I think that's what we're saying.
SPEAKER_01And I completely agree. We take this challenge on very wholeheartedly. One of the design decisions of Graphite is to say, hey, this is a client that syncs 100% the best of its ability back to GitHub. And this is interesting because no one has ever made a code collaboration platform that perfectly syncs back to GitHub, right? If you think about Bitbucket, GitLab, Fabricator, critique, Garrett, like you name it, they've all always said,
SPEAKER_01hey, if you wanna create code changes with us, you better move your whole repository over to us. Your whole team better be interfacing here. And with Graphite, we wanted to honor what we think is really important for dev tools and developers, which is to give people an incremental tool, something that they can try a little bit, but they can still fall back on their old tools. They can fall in love with or choose to stop using at any point, and they don't have to commit whole hog across like a ton of different developers. And so part of that deal is to say, We're creating a product where you can always stop using it.
SPEAKER_01You can always go back to GitHub and take actions on pull request and start using Git and merging it natively. So we better create a good enough product experience where despite having that safety and that option, folks are still coming and choosing us day in and day out because they're really enjoying it and they're really getting meaningful value. And you're right, that means the minimum viable product is a pretty high bar because the early versions of the website weren't polished enough or had too many bugs. And we and what we do is we have a dashboard and we look at it every day in the office.
SPEAKER_01And for all of our users, it shows across creation, review and submit how what percentage of their work are they doing on GitHub versus graphite? Because they can always do all of it on GitHub. So we're challenging ourselves to say, can we can we create a nice enough tool where they're choosing to do more and more of that work with graphite? So that's a nice benchmark.
SPEAKER_00Yeah, absolutely. And I guess, I mean, as you said at the beginning, you're dogfooding your tool all the time. And so I wonder what's your delivery process internally? What's the, you know, the life cycle of code from development to production at Graphite?
SPEAKER_01Totally, totally. Yeah, we dog food this thing so much. I'll answer the delivery process, but I'll also say one funny anecdote that people sometimes tease us about is we try to write automated tests. We try to do our best here, but some stuff is best best worked on through dogfooding and we found we would dogfood so much of the product and we would really understand bugs or pain points except for one flow which was the sign-in flow and the setup flow because everyone on the team set up so we would never actually like dogfood this thing and so we'd always have a little
SPEAKER_01bit of rough edges And so one day during a hackathon, we added a bot, which it's called the Roulette Bot. And once a day, it randomly picks a team member and deletes their Graphite account. Not their GitHub account, because it's still their GitHub account, but it deletes their Graphite account. And next time they come to work, they go through the onboarding flow and, you know, reselect their repos, repick their settings and stuff. And this has caught more bugs and rough edges than like anything else we've built. It takes only five minutes. It's once a month for each person. But we really believe in trying to use our own tool,
SPEAKER_01empathize with things that users have to do every day. Hundreds of people got to go through that onboarding setup every day. We should be really empathetic to the feeling and the rough edges there. As far as our actual delivery mechanisms, the team I used to work on at Airbnb was the continuous delivery team, along with the DevTools team. So I came in with a lot of opinions. It's a lot of the classic things. I believe in keeping things, like I said, monorepo. I believe we use a merge queue.
SPEAKER_01We deploy onto AWS, and we use AWS CodePipeline to ship all our code changes using classic automated delivery practices. One thing that we do that's very interesting is, because of partly this belief of dogfooding, we have a separate AWS account called staging, separate from production. that contains a full replica of our infrastructure. And because we're not a social network, we are a company where data is somewhat bound to each organization,
SPEAKER_01we're able to shard. And so we shard just the Graphite internal organization onto staging. And every employee, when they're using the website Dogfooding, they're actually working off of staging. And staging has a one-hour lag time before it promotes to production. And so if all else fails and if our automated test didn't catch something and code review didn't catch something, we'll deploy to staging that everyone is using consistently and continuously throughout the day. And that'll be our last defense for catching bugs. And there's buttons in our UI if you're signing in as an employee to just click a
SPEAKER_01button and halt the deployment pipeline if something's going wrong or if alerts are firing. And we can automatically pause that. And that gives us a chance to fix forward or roll back or take action while keeping production as safe as possible.
SPEAKER_00So when you said there is one hour lag, it means that otherwise staging gets automatically promoted to production if no one intervenes. Exactly, exactly.
SPEAKER_01And I think it's important. I remember at Airbnb in around 2016, they would also do staging deployments, but there was some critical elements missing. One, staging didn't have organic traffic. They would ask people to go in and try to poke their feature, but it wasn't getting natural organic traffic. And number two, every engineer who had a change in the change set deployed to staging had to acknowledge and press an upvote button before the deployment train could promote. And that would result in this really annoying process where one person of 20 would
SPEAKER_01be out to lunch and the whole deployment pipeline would be stalled and you're just slowing down the release cycle. So I think for us, it was like, okay, one, how do we make sure there's meaningful, healthy traffic on this? And then two, let's keep it automatic. Let's keep the train moving by default. We also disable production deployments in off hours during the evenings and the weekends. We continue those staging deployments so engineers can still ship code, feel like it's landing, but by turning it off in the middle of the night, we significantly reduce the chance that someone needs to be paged and woken up in
SPEAKER_01the evenings or on the weekends.
SPEAKER_00And you said one of the things that makes staging work for you is that basically you don't have user-generated content, so you can create a replica of all the meaningful data about the things that would go on in production as well, so that staging is a faithful replica that can intercept the most bugs that would happen on prod.
SPEAKER_01Exactly, because there's no cross-org data in Graphite. And I think my advice to others listening would be if your product is of a shape where you don't have cross-org data, what would that be? That's like a linear, that's like a Figma or a GitHub. It's really great to shard on these environments because a company can live indefinitely, an organization can live indefinitely on that environment and get early versions of the code. It's harder if you're an Airbnb or Uber or Facebook,
SPEAKER_01because how do you just how do you take like some subset of users and put them in like a separate data isolate environment? This is even really important for TV migrations. Right. So because because we have an entirely separate AWS account, we also have a separate set of Postgres databases. and we're able to apply dangerous DB migrations in advance, make sure the site's still functional, make sure under realistic, I mean, it's going to be less load, but some amount of load and some amount of data volume that everything is still functional before we then apply that to production.
SPEAKER_01So there's a lot of really nice benefits that come out of having a realistic and continuously utilized staging environment that is always leading ahead of production. We strongly recommend it if folks are able to pull it off in their product.
SPEAKER_00Yeah, so basically your recommendations about the good staging environment, because, you know, otherwise there are nightmare stories about staging environments that go wrong, is that you should automate the process so that the merged production happens automatically, periodically, and there is no manual blocking going on. And the data replication is faithful. So, you know, it represents what happens in production and you have meaningful organic traffic that can replicate that.
SPEAKER_01Totally, totally. The way this goes wrong is if you have some staging environment, but it's not utilized, it's unmaintained, it's constantly a bit broken, and people aren't actually trafficking on it. That's where this kind of goes wrong. And then you've just created a higher maintenance burden.
SPEAKER_00Yeah, love that. Great takeaways. So Greg, thank you so much for this chat. I loved how much ground we covered, starting from code reviews to AI to staging environments. So thank you again for coming on the show.
SPEAKER_01Amazing. Luca, hey, thank you so much for having me. This is my favorite topic to talk about, so I'm glad I got to come on today and have a good conversation.
SPEAKER_00Absolutely. And I hope like one year from now, we'll chat again and discuss how AI has changed, you know, the whole workflow. And yeah, I'd love that. So thank you. Thank you again. Thank you. Thank you so much for listening. If you found this chat valuable, you can subscribe to the show on YouTube, Apple Podcasts, Spotify, or your favorite podcast app. Also, please consider giving us a rating or leaving a review as that really helps other
SPEAKER_00listeners find the show. You can find all past episodes and learn more about the show at refactoring.fm. See you in the next episode.
This is a free preview of a paid episode. To hear more, visit refactoring.fm Listen now: YouTube | Apple | Spotify Todayβs episode is brought to you by: TRM Labs Criminals are scaling with AI. Build the technology that...
This is a free preview of a paid episode. To hear more, visit refactoring.fm Listen now:YouTube | Apple | Spotify - Todayβs episode is brought to you by: TRM Labs Criminals are scaling with AI. Build the technology that...
This is a free preview of a paid episode. To hear more, visit refactoring.fm Listen now:YouTube | Apple | Spotify Todayβs episode is brought to you by: TRM Labs Criminals are scaling with AI. Build the technology that...
This is a free preview of a paid episode. To hear more, visit refactoring.fm Listen now:YouTube | Apple | Spotify Todayβs episode is brought to you by: Notion Learn more about Notionβs Developer Platform today at...
This is a free preview of a paid episode. To hear more, visit refactoring.fm Listen now:YouTube | Apple | Spotify Todayβs episode is brought to you by: Notion Learn more about Notionβs Developer Platform today at...