r/AskProgramming • u/Tird_bandit • Sep 30 '26
Normal amount of lines for PR review
Hey guys, hoping to get some insight and opinions here.
As you all know with the boom of AI, people are vibe coding away which results in crazy amounts of code lines (newly added and removed). I'm just wondering what the general consensus is of what is acceptable to review, in one go by one person. Currently I'm staring at a PR with 3200 lines of newly added code. As of late, this is becoming the new norm whereas I was used to maybe a few hundred, MAYBE 1000. In another post, someone mentioned 0-500 was the norm prior to AI
What do you all think?
2
u/omgseriouslynoway Sep 30 '26
Instant reject on the PR. Tell them to break it into features.
2
u/mredding Sep 30 '26
This is something to take up with your boss - how much time should any one PR take, and what's more important - PR reviews or writing code? What is the point of a PR here?
Because PRs were an opportunity for you to look over the implementation and glean the solution design, as well as look for oversights in the details. I expect a reviewer to understand the solution as the developer does, and can attest to every line. It also meant as a way of staying at least familiar with what the code across the project does.
But why even review AI generated code? How could it not be right? The AI can review itself. The AI can generate its own test cases (and what's the point of that if the AI is generating correct code?), the AI can generate the documentation and the change set.
Are you supposed to be checking for hallucinations? Or something? That sounds like an AI job. And YOU can't GET familiar with 3,200 LOC at a time, every time.
What you should then be doing is reviewing the prompts used to generate the solution to check for inclusiveness, scope, breadth, and oversights.
So you need to talk to the boss and ask what you're all doing here. ASK YOUR BOSS if he can pull the metrics and see just how long everyone is engaging in code reviews. Dollars to donuts - everyone is just hitting approve with almost no review whatsoever.
Overall, your shop has problems, and everyone needs to align on what you're all doing there.
9
u/PatchyWhiskers Sep 30 '26
Humans simply cannot review that much code. If you expect them to it will just result in them clicking "approve" without doing more than skimming, because if you spend all day reviewing 1 PR you are going to get PIPed.
Most companies doing this sort of PR review with AI, which seems to me to defeat the purpose. Might as well YOLO it.
6
u/Any_Sense_2263 Sep 30 '26
300-500 lines of changed code. If there is even one more, I simply don't review. If human approval is needed, the PR must be fully readable by humans.
11
u/ForTheBread Sep 30 '26 edited Sep 30 '26
To me its more an issue with the ticket at that point. If the ticket requires that many changes its probabaly not broken down enough.
PRs on my team are usually no more than a couple hundred and most of that is just changes to the agent documentation/exec plans.
4
u/aleques-itj Sep 30 '26
I just try to go by "do one thing, and do it well"
If your PR is legitimately just solving what it set out to do, so be it (within reason, that means what you're trying to solve shouldn't be something that rewrites half the app).
If you pulled in a bunch of shit that's technically unrelated because "eh, it was right there and I needed to fix it too anyway" then that's less defensible
4
u/Ok_For_Free Sep 30 '26
I a fan of making refactor PRs separate from functional changes. If I'm going to review agent code myself, I'd ask it to do the same.
1
u/Doug2825 Sep 30 '26
Depends in how it is organized.
A PR that is 3200 lines total but broken up into commits that are 100 lines is fine. A PR that is one 3200 line mega commit is unacceptable.
1
u/itemluminouswadison Sep 30 '26
yeah 1-300 wasn't too brutal. at 1000+ you're mainly leaning on tests being written and passing and stupid stuff like no harded coded tokens, or general pattern stuff (bro you have 999 magic strings learn what an enum/const is please and try again)
1
u/Crazy-Smile-4929 Sep 30 '26
Look. Back in my day that was more the norm with Java. You got used to skipping over the parts that were more boilerplate and focus on the actual logic. So number of lines wasn't something that mattered too much.
These days, with or without AI, I aim for 1000 for what I give to others. No problems reviewing that or higher myself.
I don't think there's a real right answer to this one. Sometimes you just can't break up a change that much while still keeping enough context in it
1
u/babysealpoutine Sep 30 '26
Too big. Ask them to break it up into smaller chunks that build on each other. 3200 lines for a completely new feature?
I'd recommend they break that down into smaller pieces (see elephant carpaccio). If they have a high-level design as the end goal, they can also include a reference to it so reviewers can see what they're building toward.
Yeah, it's certainly easier to let AI crank out large amounts of code, but at the end of the day, the team is responsible for it, so it still needs some level of trusted review.
1
u/HealyUnit Oct 08 '26
Number of lines is not really ever a good metric of anything when it comes to coding. For example, for the project I work on, we're running an architecture with a lot of microservices. Each of those microservices has its own Kubernetes config files, but in a lot of places those config files are almost or nearly identical. So let's say I updated those config files all from something like
maxMemory: 16GBtomaxMemory: 64GB. In this case, a dev who doesn't wanna waste time (and all devs want to not waste time!) might just do a find-replace. So even if I'm replacing this same line in 150 different files, it's pretty easy to see that this is just one change. Even if I were replacing 100 lines in each of those 150 files (15k lines total)*, if it's abundantly clear that the change is just a copy-paste in each file, then it'd actually make more sense to do this all in one PR than arbitrarily saying something like "let's do the first 2000 randomly-picked services in this one PR, and then the next 2000, and so on".Instead, what I'd focus on are atomic changes. Is the "purpose" of your PR something that can be reasonably** broken down into further sub-tasks? If so, it's not atomic. For example, let's say you wanna add a username/password login form to your web app. Your tasks might be:
Your first task here would be to only add UI code to present a login interface to the user. If the PR from this does more than that, reject it: it's over-stuffed.
* Of course, I'm ignoring the fact that it'd make more sense to have a central common config file here. Let's just ignore that.
**"reasonably" of course here is extremely nebulous. You could potentially have a series of PRs where each one adds or removes exactly one letter of code, and just never run a merge pipeline. Use your judgement here.
1
u/EntrepreneurHuge5008 Sep 30 '26
The new norm is also that PRs are reviewed by AI, too.
But yes, for human review, keep it under 500. I even think 500 is too big a change.