Hello everyone, welcome to my talk. Today we're going to be talking about how we are rebuilding CI for AI scale commit volume. And this comes from a lot of experience from build and merge infrastructure that I have been working on for a decade plus at this point. And want to walk you through all the new bottlenecks we're seeing in software factories and also specifically for highly regulated industries and banks. How does that translate? How do we keep things more compliant and auditable while being able to move fast? So let's dive in. My name is Gautam. I am a co-founder and CTO at Guitar and recently joined Sonar as a principal engineer after the acquisition.
Previous to Guitar, I was at Uber for almost a decade working on build and merge infrastructure for monorepos. So everything from build, CICD, IDEs, you name it to make sure developers are productive. And now at Guitar as part of Sonar, I'm trying to make sure that code that's being checked in is verified and all the code written by agents is of high quality before it goes in. So before I get started, I want to paint a bit of history picture. At Uber, we had agent scale commit volume before they were agents. So what I mean by this is we had one giant monorepo and we were doing like thousands of changes a day and with very long running builds.
This meant that if you just kept everything serialized and merged them one at a time so as not to break your main branch, you would take a really long time up, twenty days in this case, to make sure that everything was fine. And if we skipped everything and just let everyone merge to main, we would see red main all the time because changes would conflict with each other. And even though the CI would be green on one of them combined, they might actually break. So we would see our iOS monorepo would be red all the time and that was not productive for our developers. To fix this, what we did was we made a system called Summit Queue, which we have a paper on,
and we tested all the likely possibilities of commits that are coming in and making sure that we can reduce the wait time so we can test these things in parallel. We could also predict what could break by testing all the combinations. So once we know that a PR might break, we might remove it back from the queue and let the author know that they have to go fix it before they can push it back up after rebasing. And finally, to keep the trunk green, only if it passes with all the combination of commits coming in, it would be let in to go directly onto the trunk. So you would want to make sure that the overhead was worth it for keeping our trunk green.
And this is still running today at Uber. I'm sure now we have merge queues that GitHub came up with and all the other code hosts. But for back then, there was not a system, so we developed this. So the problem with this approach is currently all these queues that we have, so that's either CI or review on a centralized bottleneck in the SDLC. So all these queues were built for human speed. And once you build it from human speed, what happens is they are not able to keep up once you go to agents. Because humans generate changes, used to generate changes like a few times an hour. So we could do testing and review one at a time.
Now with agents, developers are writing several PRs a day. And they don't always wait for the queue. They all want to come in at the same time, which means your CI and review queues are piling up and having pressure. And after that, the patterns of software factories and background agents triggering on various workflows, suddenly you see everything slowing down to a crawl because your bottlenecks are still going to CI and review and they are over capacity in this case. So what does this mean for teams today? So just to put things into perspective, our own rate of commits has almost ten times since we started GitHub about three years ago.
And it's unbelievable with the same size team. We are still very small. We are able to push so much more code. And we even see this in the industry trends on Guitar. So this graph shows you the number of PRs that we see that Guitar reviews over time. And if you look at the code trajectory, it's pretty exponential. Every month, almost we are growing 25% month over month of the amount of PRs we have to review, fix CI and other things. So this is corroborated by evidence that industry players like GitHub have been putting out where they're seeing staggering growth in PRs. And this is now coming for every single team.
If our small team is seeing this, I'm sure the larger teams and banks are seeing it at a much higher degree as they are going through their AI adoption journeys. So the problem I was talking about, right, so if agents are opening PRs and if you make them check everything through the CI system, individually they might pass. But once you merge them back on main, your trunk might still be broken. So how do you solve for this? How do you keep things green at this high rate of pace? So this is very important, how we solve SummitQ. The changes themselves are not testing against each other.
So there needs to be some sort of change in either the CI system as well as how we have to do your code and in the queues to be smarter to be able to solve this. And the problem we're also seeing with everyone trying to adopt software factories, which is having agents write all the code from the spec and then just having humans be responsible for the spec and review is that the factory line that exists today was built for human speed, as I mentioned, which means that as agents push more changes, every part of the factory line is going to be slowing down.
So for example, with build and test, you might have lots of rebuilds whenever computation breaks or you might have integration tests. You might have flaky tests that are not reproducible locally and that slows everything down. So because you have to retry them and it could take hours in many cases with a complex build. Add to the fact that now you have review and approval. So a lot of you probably already use AI to review your code. Hopefully you're not doing every single review with humans. With humans, you ideally are reviewing with AI as a first pass. Now the reviewers become the queue if you don't have that system in place.
And even after you review, there might be some criteria you might want additionally to make sure that it's approved fully. Because what's happening now in the industry is a lot of folks are just rubber stamping them because they cannot keep up with the high rate of PRs. They are relying on other signals now to be able to just get through. So the process has to change. And the other problem right now we're having is a lot of these checks are running. There's a lot of records that we keep that are expiring. So your old logs don't exist as they expire out. There is no stamp of what was actually checked because there is just an approval stamp.
So there needs to be some record of these things for auditability and compliance checks to happen. The other issue we're seeing is that as the code volume increases, the time taken for repair is adding a ton of overhead. What we see on our platform, at least 13% of PRs had a recorded CI failure. This is one or more CI failures, which means in all these cases, there is a separate round trip to go either back to the developer machine or for an agent to understand the logs, root cause failure, fix it, push another commit, and then keep iterating till it's green.
And this is just CI because most of the time if a human reviewer wants to look at a PR, they're not going to take a look unless CI screen because that's the first line of defense. So that also slows the review process because they can't go in parallel because usually we want to look at something once it's finalized. And every lap is now paying for a CI and review. So if your review comments come in and you're doing another pass, CI and make again, and it kind of repeats the cycle. So how do we make this better? What do we do to make this problem more manageable as agents are pushing down more code?
So we have discovered this obviously back to Uber, but also in Guitar team right now. The most obvious thing is, make your CI really quick and fast, which means that you may want to remove a lot of expensive checks, try to offload them to post merge even, and try to make the CI snap itself really quick because your repairs, will be much more efficient. So you can parallelize things, you can chart, you can do caching. We'll talk about some of the techniques that we have used as well. I also want to make sure the review is fast. So not just a deep review, but you also want to have maybe multiple passes that are giving quicker signal to your developers.
So they're able to use them as a way to understand in what scenarios they may want to go deeper for higher risk changes, or maybe for lower risk ones, even let the AI approve and merge them. So we have discovered this, obviously back to Uber, but also in GitHub right now. The most obvious thing is, of course, make your CI really quick and fast, which means that you may want to remove a lot of expensive checks, try to offload them to post merge even, and try to make the CI snap itself really quick because your repairs will be much more efficient. So you can parallelize things, you can chart, you can do caching.
We'll talk about some of the techniques that we have used as well. I also want to make sure the review is fast. So not just a deep review, but you also want to have maybe multiple passes that are giving quicker signal to your developers. So they're able to use them as a way to understand in what scenarios they may want to go deeper for higher risk changes, or maybe for lower risk ones, even let the AI approve and merge them. And for the checks that are already running in CI, if you can move them to the left, it's way cheaper to catch them. And this actually is very relevant to checks that happen even past CI.
For example, you might have expensive regression tests or things that might fail in production. Not every time it's possible to move things to the left, but as much as possible, if you can move them, it means you have less bottlenecks down the line. And locally agents have done more contacts anyway to fix the issue that they're facing. And you also want to have policies. This is very important for regulated industries. So a story we have at Uber is we lost the license to operate in London because there was a glitch in the software that allowed drivers to get on the platform without all the proper checks. And that was because of a feature flag change.
So we had to put in a process in place so that every change affecting London that was going through the STLC would need some sort of a lineage of, okay, this is a change affecting London. If so, what are the controls in place? And we are able to win our license back. Now, a lot of you might be facing these kinds of challenges where agents just make it much harder to understand what's happening in your code base. So how do you ensure your policies are actually being respected? So you need to have a way to enforce these rules beyond CI. Just because the code compiles doesn't mean that it's following a particular specification. It could be HIPAA, it could be DORA.
There's so many other policies that these agents are not going to be aware of unless your agents are enforcing it on the other. And also you want to make sure that you record that it was enforced for auditability. So just a quick story about how we made our CI faster as well. So we were at a baseline where I would say still fast but very annoying when you're trying to push more code. We were around 10 minutes for our CI and we wanted to bring that down significantly. So we started looking at how can we cache outputs. We used Rust for our build system. So we started caching as much as possible and reusing them. And we also looked at ways to reduce churn in the compiler.
So we added some more fixes to ensure that the compilation part is more cacheable and is invalidated less often. And by adding more fixes on top of this by sharding and by removing these overheads, we were able to bring the time of CI almost less than a minute for incremental steps, which means once the code CI is warmed up, incremental builds are way quicker and we can push a ton more code. The other issue is also review. So just because the CI is green, what was funny was when we were measuring our P90 time of PRs making into production, the vast majority of time was spent in review back at Uber.
And even today, to be honest, most teams spend more time reviewing code and doing other kinds of testing before they are comfortable merging the code into main. So this is something that needs to be on top of CI as well, because right now what's happening is agents are, of course, generating code at the same time. The AI agents are also finding issues on your code review system. And these automated reviews are also findings that you would have to now go back and address. So either you have to pull contacts locally for your agent or have an agent on CI, iterate and fix. And humans are able to review whatever is left after the AI took its first pass.
And this needs to be part of the equation. So you're not wasting precious human cycles on more and more agent-generated peers. Here's an example for us. We were refactoring our code base to have faster CI. So we were using NextText to parallelize our tests. And we had this shared database that we were spinning up to make sure that we could set it up once and all our database tests would reuse it. But the problem was that there were some guards we didn't put in place, which meant that when CI gets very busy, there is cross-contamination and tests might become flaky. Coderabbit actually caught it on our PR before we merged it. So we didn't have to waste time after.
And Coderabbit also fixed the issue for us because it suggested the fix, committed it, and added the engineer as the co-author. By doing this, we were able to prevent expensive mistakes before the code made it all the way into main. The other thing that we do at Coderabbit, interestingly, and as we see more and more of our customers start doing, is we are using policies and criteria to decide when is it appropriate to actually even approve changes.
There's a lot of changes that are routine, lower risk documentation, dependency bumps, of course, if they're not breaking any APIs or security patches, even things like lower risk changes for internal tooling that can potentially be auto-approved. So Coderabbit supports these things out of the box. And you can also add additional custom rules, which are plain English, that you can use to gate the approval and merge on. And we are seeing teams who are very AI native starting to adopt these more and more.
We see, I think, on our platform the rate at which folks are adopting the auto-approval and auto-merge grow really quickly across teams, even from large teams like 100 plus, 2,000 plus developers. So here's an example of approval policies. So if it's a dependency bump and dock changes, we should be approving them. Any changes on the sensitive stuff like payments or auth might need a human approver on top. And then, of course, you don't want to have the agent who made the change approve its change because that would not be zero trust. So in this case, as agents are generating PRs, the PRs are getting approved.
When there is a new change that doesn't meet the criteria, then we would have to escalate to another approver. And this can be done with your own agents, of course, but also our services out of the box if you want to try. And the other problem with just relying on CI today is that just because CI is green, as I mentioned, doesn't mean the code is compliant in many cases. So in this case, the CI is passing, and there is some metadata that we have about it. On the rerun, the flaky test is going to fail, which means that when you force push to fix that thing, now the branch is pointing at another piece of code.
So the problem with this is that over time, most CI data is going to be expired. So unless you have a record of what happened and what was fixed, you will not be able to be compliant or be able to audit what actually happened, which is why I think things like agent trajectories and your outcomes after each push are very important. So whatever information you can record on the PR or any other system of record is going to be a source of truth as your artifacts expire. So the control here is making sure that the change was approved and tested by someone who did not write it. If you don't have that information, it could be a problem. So here's an example.
We have a pipeline that failed on the left and the pipeline that passed. But the difference here is that if you record properly why the failure occurred when someone else was able to approve it because it was a known failure mode and it was saved with the change that made it in, this thing actually passes your checks versus something where you don't have a record of what happened, but you just blindly trust the agent pushing code because it could be a test that was actually not high quality. There was no record of all the compliance checks that were recorded.
So you want to make sure that on the more sensitive industries, you want to have all of these decisions recorded as rules or compliance checks on top of your PR in addition to code review. So what are some of the kinds of records that we want to keep? So here's a few that we keep on GitHub, which I think are just examples. It could be different for folks. So for example, which coding agent made the PR? Where did the PR originate from? What was the session that originated it? And who actually started it? Could it be a trigger from an automated workflow? Could it be just an engineer doing prompting? And for each of these CI that run, what is the commit where CI was trusted?
but you just blindly trust the agent pushing code because it could be a test that was actually not high quality. There was no record of all the compliance checks that were recorded. So you want to make sure that on the more sensitive industries, you want to have all of these decisions recorded as rules or compliance checks on top of your PR in addition to code review. So what are some of the kinds of records that we want to keep? So here's a few that we keep on the guitar, which I think are just examples. It could be different for folks.
So for example, which coding agent made the PR? Where did the PR originate from? What was the session that originated it? And who actually started it? Could it be a trigger from an automated workflow? Could it be just an engineer doing prompting? And for each of these CI that run, what is the commit where CI was trusted? And the same test report, not just the status. And making sure that each finding has a key record of how it was resolved. Was it dismissed? Was it followed up? Was it fixed on the PR?
And then making sure the approval is someone apart from the bot that was prompted by the same person. And making sure that any overrides are explicitly named. So if there is a red build or a controlled code cover script, you want to make sure there's a reason for when, why the check failed, and why we're okay with that in that scenario. And making sure that the code that merges actually has all this and it's not a small change on top that was merged. So all the checks are on every single time. So in this case, we want to make sure that agents cannot approve their own changes. Engineer who prompted it is also not an author.
And if you have these practices in place, now we can actually start removing all these bottlenecks. Because CI being faster will unlock your builds. So your flow is much nicer. And making sure you can move some checks left will also make sure that your test load is going to be reduced quite a bit on the CI side. If you can automate review for the most part and only escalate to humans for exceptional cases and potentially even auto-approve low risk or internal changes, then you remove further bottlenecks and then you have less data that is reaching humans for a software factory to perform to its potential.
And of course, after every single approval and merge, you want to record what happened because as factories are going to ramp up, if you don't have an idea of what happened in the past, that context is going to be very useful on how to iterate and make your software better over time. That's it for me. I would love for you folks to also try out guitar and see how you can improve your software factories. And with that, thank you so much for your time. when someone else was able to approve it because it was a known failure mode and it was saved with the change that made it in,
this thing actually passes your checks versus something where you don't have a record of what happened, but you just blindly trust the agent pushing code because it could be a test that was actually not high quality. There was no record of all the compliance checks that were recorded. So you want to make sure that on the more sensitive industries, you want to have all of these decisions recorded as rules or compliance checks on top of your PR in addition to code review.
So what are some of the kinds of records that we want to keep? So here's a few that we keep on the guitar, which I think are just examples. It could be different for folks. So for example, which coding agent made the PR? Where did the PR originate from? What was the session that originated it? And who actually started it? Could it be a trigger from an automated workflow? Could it be just an engineer doing prompting? And for each of these like CI that run, what is the commit where CI was trusted? And the same test report, not just the status. And making sure that each finding has a key record of how it was resolved. Was it dismissed? Was it followed up?
Was it like fixed on the PR? And then making sure the approval is someone apart from the bot that was prompted by the same person. And making sure that any overrides are explicitly named. So if there is a red build or like a controlled code cover script, you want to make sure there's a reason for when, why the check failed, and why we're okay with that in that scenario. And making sure that the code that merges actually has all this and it's not like a small change on top that was merged. So all the checks are on every single time. So in this case, we want to make sure that agents cannot approve their own changes. Engineer who prompted it is also not an author.
And if you have these practices in place, now we can actually start removing all these bottlenecks. Because the CI being faster will unlock your builds. So your flow is much nicer. And making sure you can like move some checks left will also make sure that your test load is going to be reduced quite a bit on the CI side. If you can automate review for the most part and only escalate to humans for exceptional cases and potentially even auto-approve low risk or internal changes, then you remove further bottlenecks and then you have less data that is reaching humans for a software factory to perform to its potential.
And of course, after every single approval and merge, you want to record what happened. because as factories are going to ramp up, if you don't have an idea of what happened in the past, that context is going to be very useful on how to like iterate and make your software better over time. That's it for me. I would love for you folks to also try out guitar and see how you can improve your software factories. And with that, thank you so much for your time.