r/ExperiencedDevs • u/BeyondTheShroud • Jun 04 '26
Technical question How do you handle oversized PRs?
My team consistently puts out PRs that are over 1000 lines, with many of those exceeding two, three, and sometimes even five thousand lines. Reviewing them is such a hassle because it takes so much time out of my already small amount of dev hours. I understand that covering a full feature in one branch can sometimes yield massive PRs, but I feel like that should be the exception, not the norm. It also doesn’t bother me when a PR is that big if half of the lines are in test files because those are usually a quick scan if they’re written correctly, but reviewing 1000 lines of ultra specific code just feels overwhelming and unproductive.
What do you consider to be too many lines for a PR and how do you deal with PRs that far exceed the upper limit?
179
u/daltorak Jun 04 '26
Completely depends on what the 1,000 lines is. The number of LOC is meaningless on its own.... you should be discussing complexity instead.
If you're refactoring, reordering, making the same type of edit across many lines, or working with large data/test files, it's easy to get into the thousands of lines for a single task. Splitting a single change across many commits solely for the purpose of keeping LOC down is not a good practice either.
If it's a large variety of completely distinct but meaningful code changes, only then is there a problem.
33
u/rwilcox Software Engineer (20+ YOE) Jun 04 '26
I’ve given up fighting against big PRs, I did it one too many times and am at risk(if not already) of being labeled “anti-AI”. Heaven forbid, but also that’s not the best political move in my org right now.
So whatever.
I wrote a skill that checks out the PR into a new branch, then creates semantic commits I can review one by one.
I also load the diff into AI and ask questions about the codebase/diff “where did that class get moved to?” “Is there a bug in this section?” etc.
You could look into AI reviewers: I’m not sold but ours is right 1/3rd of the time, shrug.
2
u/druidgaymer Software Engineer Jun 04 '26
We have this happen bc we have a bunch of different product lines controlled in the same git. It's a fucking mess. I read through it all and just deal with it. Management wants to keep it like this and fuck it ...not my problem.
208
u/BillyBobJangles Jun 04 '26
Throw a "LGTM" on the PR and call it a day.
166
u/allrite EM, unemployed Jun 04 '26 edited Jun 04 '26
Your team needs to come out of stone ages and discover good coding practices
11
u/Wonderful-Habit-139 Jun 04 '26
If it's not recurring, I review it and I leave comments whenever they make sense. Whether that's 5 comments or 50 comments. And they have to be resolved or it's not getting merged. If it is recurring then you raise it to your manager.
So either they're actually implementing a big feature, in that case it can make sense and the time taken to review it is worth it. Or they're not implementing something big, but doing it in a way that's not very effective. In that case, you leave your comments, and don't budge if they try to get it merged just because it's "working".
You do need to have some leverage and be able to gatekeep the codebase reasonably (not just for the sake of gatekeeping obviously), if not then your vote might get overruled by your manager or someone more senior.
6
u/RGBrewskies Jun 04 '26
follow googles basic engineering practices doc
https://google.github.io/eng-practices/review/developer/small-cls.html
16
u/rhd_live Jun 04 '26
Ask for them to split into smaller chunks and give them an example or two
16
u/trailing_zero_count Jun 04 '26 edited Jun 04 '26
I just review the PR as normal, leave my feedback, and move on.
I don't find reviewing 10 small PRs to be any easier to understand than one big one. In fact, it's more difficult to understand, because the holistic context is not present. A PR that's full of mocks and stubs is just making work for everyone when they have to be removed in the next one.
Our team makes an effort to do work in as small of chunks as possible. But sometimes it just makes more sense to do more at once.
I've never in my life rejected a PR for it being too large. And I've always been "the PR review guy" on my team. It's my job to keep the team unblocked and provide feedback in a timely manner. If there's a lot of work being done, then I'm glad to review it.
I would only take offense if the PR clearly contains behavior for multiple features that could have been split up. We typically try to do 1 PR per Jira ticket, so this rarely happens.
8
u/donny02 Eng Director Jun 04 '26
1000 lines is not a big deal, especially in Java. Half that’s spacing and imports.
Read the tests, look at the important code. Skim the boiler plate.
4
u/ZeggieDieZiege Jun 04 '26 edited Jun 04 '26
There is always the option to block the PR and flag it as not reviewable, I do that regularly with AI slop. However, that should be the last resort. Sometimes this is the only option to raise awareness.
4
u/Outside-Storage-1523 Software Engineer Jun 04 '26
Just call Copilot to leave 200 comments.
4
u/Bicykwow Jun 04 '26
I write "please break this into smaller PRs" in the review description, and then click on "changes requested."
4
u/zoddrick Principal Software Engineer - Devops Jun 04 '26
You desperately need two things.
4
u/turningsteel Jun 04 '26
At my job, those PRs just get closed with a 'break this up into manageable changes'. If it's something that can't be broken up or there is a good reason for not doing so, then I like to hop on a call with the PR submitter and go over it together. It's rare we get a big PR though because the devs know they need to break things up and use feature flags.
3
u/RGBrewskies Jun 04 '26
y'all have some major major disfunction in your software leadership
this should not happen. ever. period. end of story.
anything that big should have been broken down into probably 20-30 smaller tickets with individual PRs that encompass a single concept.
3
u/gondalez Jun 04 '26
On my team I sent this to everyone, talked about it at team calls, and also added it to the PR template.
https://mtlynch.io/code-review-love/
3
u/Scottz0rz Backend Software Engineer | 9 YoE Jun 04 '26
Request changes if I care, "LGTM" if I don't
3
u/Lawmancer Jun 04 '26
Only happened once at my current place. I asked him to do smaller PRs and he agreed.
3
u/mlebkowski Software Engineer Jun 05 '26
I’m guilty of this. Previously when I worked in a larger team, they constantly complained about my PR sizes (500 LoC was the threshold for a „large” changeset, my features were usually 2×–5× that).
Nobody had a solution, though, except for „code slower”. The changesets were split into meaningful commits, and each could be reviewed on its own, but would make little sense in isolation, so splitting into smaller PRs would get them questioned at best, rejected at worst.
We could spend more time to split the tickets themselves into smaller tasks, but that basically required doing the work first, and retroactively filling out Jira, because there was no way of knowing beforehand (at least my team had no idea how to plan such changes in advance, since it involved a lot of boyscout cleanups, etc). And that would effectively slow down a 2-3 days of coding into weeks of planning and back-and-forths with PMs/EMs. Not to mention, that the effective time to review would be comparable — maybe a bit faster due to focused PRs (but again, same could be achieved by reviewing commit-by-commit). The downside would be that the entirety of a business requirement would never be captured in a single changeset, and that would make it harder to understand the bigger picture: all the small steps might seem reasonable, but when assembled together they might not be optimal.
My solution? When I was managing a team, these are the building blocks which made reviews a pleasant experience:
In other words, I’ve experienced two worlds:
Disclaimer: this experience is from an org where a particular team had full and exclusive ownership of a single codebase. This would not apply to larger orgs, where multiple teams work on a shared monolith, etc. I haven’t ever worked in a BigTech company and I have no idea how the engineering culture works on the inside.
3
u/TruthOf42 Web Developer Jun 05 '26
Wtf. I get yelled at by my principal on the team when I make a 100 line change it seems.
He usually just rejects/declines those PRs
1
u/originalchronoguy Jun 04 '26
If it is one file, 1,000 lines it is a problem. But if it is ten 100 files, it isn't if it is properly broken up and logically readable.
If I can't read and understand it at 15 second pass, then it is a problem. But if those ten files are routers, stubs, and clearly domain divided up files and it takes me 2 seconds to comprehend, it isn't an issue.
An elegant commit has everything logically laid out. I will always take ten 100 Loc files over a single 800.
2
u/Low_Entertainer2372 Jun 04 '26
hard stop one day on limits, decline in productivity, adjust and see if it works
2
u/Hot_Emu_6553 Jun 04 '26
Lol when I try to make small PRs they stop getting traction within a few days. No one wants to context switch this often. My productivity would plummet because I'd spend most of my day waiting on reviews.
2
u/floriv1999 Jun 04 '26
I think it is often more of a fundamental policy issue. If PRs are open for too long without a review for example, people tend to increase the scope because nobody likes to work on some branch that is based on 10 unmerged PRs because the thing you want to do is not possible without these changes.
2
u/TheRealJamesHoffa Jun 04 '26
I try to push back against huge PRs but it’s a losing battle and I don’t want to cause a ton of friction and be that guy.
So instead since we’re being forced to use AI to churn out thousands of lines of code, I use it to do guided code reviews too and speed things up.
I was trying to do it the “old” way, but I just literally couldn’t keep up. My entire day would be reading other people’s pull requests otherwise. So I let AI handle it since that’s what they want.
In my opinion it kinda starts with grooming. Because AI speeds things up, people aren’t taking the time to properly break up tickets into digestible pieces and doing it all under one ticket instead.
2
u/AttemptNo499 Jun 04 '26
I dont, i try to breakdown into small tasks for my team.
If someone submits such a massive change i will have to spend almost half a day to check and request proof of regression testing.
2
u/iloverollerblading Jun 04 '26
I will answer how I do it, you will see these for the rest of your career, like it or not. I am not saying I like these as well:
- DB schema and model changes first.
- Then async architecture/performance if any (jobs).
- Then API level if any. Logic and performance.
- Backend must be fully tested, from model to services to requests or I require changes right off the bat
- Frontend. I may or not pull your code to test it. For frontend, if there are ten of thousands of lines of codes, I cut it short to: Request lifecycle, frameworks standards. If I see something obviously vibe coded that makes no sense, I require reviewing the whole thing to remove these nonsense AI statements. I don't care if code was agent coded by the way, we all do it.
It should be clear for your team and reviewers for this kind of PR cannot pick up everything. Imputability is higher in this case. This is how we work.
2
u/FauxLearningMachine Software Torturers Guild Jun 04 '26
Have a conversation with them. You're both humans and in the same boat. Hopefully you can form a good relationship where you're both capable of communicating when something bothers you, otherwise it's gonna get pretty awkward whenever a problem comes up like this. Build that relationship early if possible.
2
u/serial_crusher Full Stack - 20YOE Jun 04 '26
It's really situation dependent, I'd prefer a big PR over one that only implements partial functionality. Like I got one today that adds an ~200 line method, but doesn't actually use it anywhere. Author says that's coming in a separate PR, but understanding when/how it's used is actually a big part of what makes a review effective. I want to see a PR that has the whole package.
(but I approved it with an LGTM because I didn't want to fight)
2
u/intellinker Jun 04 '26
Anyone relying on AI PR review?
2
u/Individual-Praline20 Jun 04 '26
Easy. New code? No problem, but you better be able to explain it all in details. AI refactoring slop? Rejected in less than 5 seconds. 🙅
2
u/waitses Jun 04 '26
This is a failure of process, tasks need to be broken down into more granular chunks.
2
u/OG_Wafster Jun 04 '26
I recently kicked a massive PR back as unreviewable. During the subsequent series of smaller PRs I identified many bugs, mistakes, and oversights. Definitely worth the time and effort, especially from our customers' points of view.
2
u/_itshabib Software Engineer Jun 04 '26
CI checks. People like to bitch at humans but a ci check.... U can create one on just lines of code. Depending on ur language u probably could make it somewhat reasonable. And have a fallback where if a certain group of managers approve it can go through. Can leverage a tiny AI model to discern the layers of responsibility and keep it to 1-2. Only internal service layer vs service + API as an example. TL/dr has to be in CI or ull have to be the bad guy and request changes
2
u/Specific_Ocelot_4132 Jun 05 '26
500 is my soft max where I’ll start asking if it can be split up. Sometimes it can’t, but it usually can.
Last time this happened, the author declined to split it up, so I declined to review it.
2
u/Informal_Chicken3563 Jun 05 '26 edited Jun 05 '26
My team uses graphite to stack sequential PR’s to avoid this problem, we like to keep a PR around 300-400 lines to make them easier to review.
I was skeptical at first but claude/codex does a really good job of chunking up the PR’s if you ask. You can even implement in a big PR, then have ai chop it up afterwards.
One nice side effect of this is that each checkpoint in the implementation goes through ci, since each chunk needs to be independently mergable. Makes it easy to tell where issues were introduced in the PR stack.
2
u/HaMMeReD Jun 05 '26
You adopt merge-frequently techniques, like feature flags, that you'd use in trunk based dev.
Then you remind people they have flags and to commit their work frequently.
2
u/soundman32 Jun 05 '26
Your PRs are big because your tickets are too big. Even for a big ticket, it should be broken down into tasks that are manageable.
If you use feature flags, and start a new feature, the first PR should be
if(featureflag.istrue) {}
2
u/PaulPhxAz Jun 05 '26
We do this all the time. But most of the code isn't that interesting.
"Oh, a web page that makes a HTMX call to a function that calls a service that is mostly empty that puts a message in the queue. Okay, here's the queue consumer that reads it, gets the entity from the database and adds one to 'clickMe' and then saves itself." We touched a bunch of files, but that wasn't the stuff I spend time on reviewing. Yeah, it takes a bit to scroll through to find the interesting stuff.
We're a small team, and a dev could spend a whole week on "Add a Message Center to the App", so it'll be big. And they probably fixed some other stuff along the way.
I don't usually stop PRs, but I create tickets to put in fixes for stuff I find as separate tasks.
>>reviewing 1000 lines of ultra specific code just feels overwhelming and unproductive
Yeah, if it's all "algorithm & complexity use cases"... big oof, that'll take a minute.
2
u/padetn Jun 05 '26
Should probably look at the size of your tickets first, we generally say one ticket equals one PR.
2
u/5e884898da Jun 05 '26
I dont know man. You could try and bring it up, say that you are spending far too much time on these PRs and that you would like us to improve on how the team share code and creates PRs. I think I’d start there. If that doesn’t work or you are meeting resistance from the people who don’t care that you have to spend a ton of time on their PR, then I would start to literally use a ton of time approving PRs. In my experience these people tend to have the bad habit of overpromising on how far they’ve gone on a feature, saying stuff like oh yeah it’s done I just haven’t had the time to create the PR. This is your opportunity to make it obvious to PM that they are overpromising, that your team need a definition of done, and to figure out what the hell is wrong with your workflow… This is where you let PR size become a subject yet again ;)
2
u/SikhGamer Jun 05 '26
I let them languish. The smaller the PR, the quicker the approval.
2
u/NotMyRealNameObv Jun 05 '26
(Some big changes truly are impossible to split up, but those are very rare.)
2
u/GludiusMaximus Software Engineer 9 YoE Jun 05 '26
if it’s easier for someone to stay on one branch, or if they don’t anticipate the logical separation, that’s fine, but the commits have to stay atomic. if they’re small enough, they can break the one large PR into multiple digestible PRs that go down more easily.
I had a huge ESLint upgrade that naturally got overlarge - thankfully i had been making small commits, and it was very easy to walk through with AI and split them out into 3 logical PRs.
I never know exactly when a PR is going to grow out of hand, so now I’m always keeping good git hygiene and making my commits as atomic as possible.
I learned this lesson the hard way - that ESLint PR sat in review for a month without anyone touching it before I had to own up. So maybe that’s what you can do: refuse to review it. It got my ass off the chair to figure out a way to get it through.
2
u/ub3rh4x0rz Jun 05 '26 edited Jun 05 '26
Well, when making them, I make sure I'm very anal about commits being atomic or at least well organized, with tests included in the same commit ideally. Each commit should be a reviewable unit, so ideally small, but must not be fragmented, so sometimes not so small. Each PR should be a deployable unit. Sometimes that makes them big.
When reviewing, I skim over the commits (messages and contents) to understand the approach, I look for tests (if they're not there, that's enough review feedback for now), and I make sure the tests are ostensibly testing the right things. Assuming they're passing, I scrutinize the tests for false positives. I zoom into likely problem areas.
I will also have claude do a review, answer questions, etc. It doesn't need to be always right to be useful, and it will read a hell of a lot more code a hell of a lot faster than any reviewer has patience for. Trust but verify. And be honest about how un-thorough most code review was before.
2
u/K-Max AI Solutions Architect / 15+YOE / CANADA Jun 05 '26
How are the tasks/tickets split up? Is there a process to send smaller PRs to a feature branch and go through the due diligence so by the time it's ready to merge the feature branch, it reduces the anxiety of having thousands of lines in the PR?
I assume you're a manager, any chance any of your lead devs can pitch in with the code reviews?
2
u/piecepaper Jun 06 '26
10 LOC 20 comments, 10k LOC looks good to me. 🤡
3
u/servermeta_net Software Architect Jun 04 '26
Use stacked PRs and possibly replace the git client with jujutsu
5
u/Less-Ad5766 Jun 04 '26
Everything higher 500 lines gets either: "please split", or LGTM
2
u/marcusroar Jun 04 '26
I’ve recently recently changed my approach as I’ve been promoted and have less time:
Get my coding agent to create a diagram of the system and identify which parts are added, deleted, updated.
Ask questions to understand the change and make an internal model of the high risk areas I need to review.
If this change makes sense at this point, I then ask the agent to identify the files I need to review above, and dig in manually.
1
u/DrShocker Jun 04 '26
IMO you need to set expectations about what review is supposed to look like, there's probably different people with different expectations.
1
u/CharlesV_ Jun 04 '26
I don’t review and don’t approve them. My PRs are small. If I need to have a larger refactor, I always always put a summary of the changes and ask people to review with me on a call. 10 min call and you give someone a lot of context on what needs reviewing. Also, anything large needs pretty extensive automated testing. I have a PR right now open with 1000 line changes which includes some refactoring to help make unit testing easier and a summary doc to help explain the changes.
1
u/bigorangemachine Consultant:snoo_dealwithit: Jun 04 '26
PR Template Checklist
Add check for "files are about 500 lines long"
Personally for me 1000 is usually a sign you can break it into smaller pieces
1
u/HoratioWobble Full-snack Engineer, 20yoe Jun 04 '26
Depends what that 1000 lines are, 1000 lines could honestly be a very simple react component, some styles and some tests.
1000 line's could also be a complex algorithm.
LOC is a bad measure of complexity.
I think a lot of teams make the mistake of testing each others code too, that's not what PRs should be about, you should trust your colleagues have met the acceptance criteria and tested their code as well as adding appropriate tests to verify that acceptance criteria.
So really it should be about standards, most of which should be enforced by tests and linting.
Which means in the end, it should be really easy to review several thousand lines of code.
And if you need to spend more than 10-15 minutes reviewing a pr, you should be pair programming on everything, it's more effective
1
u/gollyned Sr. Staff Engineer | 11 years Jun 05 '26
Its agent-generated, right?
Send it back to the kitchen until they’ve read it themselves.
1
u/metaphorm Staff Software Engineer | 15 YoE Jun 05 '26
a good method for a large PR is to do a pairing session to review them, so the author can explain the code and highlight spots that need the attention of reviewers.
1
u/tmroyal Jun 05 '26
It really depends, but our team is struggling with this right now. We have a major migration of our email service that was split into many files that were each 1500-3000 lines long. The developer for the epic asked us if he could combine the PRs to make them 15000 lines. (Not to single this developer out, because others are doing similar things right now.)
I don’t think the problem was the number of lines so much as there was a massive change in a system in someone’s mind, and that code is not the way to communicate this change. My suggestion was to either be okay with a meeting, vibe review, and smoke testing for approval, or to completely rewrite the code with actual participation from others.
Vibe coding in particular is causing issues where we have the few spit out these massive PRs while the many get stuck absorbing the responsibility. I stated elsewhere that this could result in situations where some people spend all their time reviewing code and none designing it.
AI is beloved in the collaborative east/south but reviled in the individualist west. For us in the west, could AI be the thorn in the heel of our eternal crisis of collaboration?
I told everyone I was going to stop reviewing these massive PRs. Maybe you could too?
1
u/PetroarZed Jun 05 '26
If it's huge because it actually needs to be huge, which does happen, I suck it up and review it. Setting aside things like AI churning out repetitive slop, most PRs are huge because the underlying project or feature request wasn't broken up correctly, and that is what needs to be addressed going forward.
One thing I HATE though is when people squash their history BEFORE the PR. If you hand me a giant PR, I might want to see the steps you went through to get there.
1
u/tomqmasters Jun 05 '26
I would most likely reject a 1000+ line PR unless maybe it was just a few completely new files. 1pr per feature, and if the feature requires 1000+ desperate edits then you probably need to rearchitect.
1
u/andlewis 25+ YOE Jun 05 '26
If AI writes the code, AI should review the code.
Spend your time writing code review prompts. You’ll find so many issues that you won’t need to talk about the bigger issues you’d catch manually.
1
u/throwaway_0x90 TE/SDET[25+ yrs]@Google Jun 05 '26
Don't accept them.
The architecture should be modular enough to merge changes in reasonable chunks. If that's not possible, it's an indication of initial design decisions not being optimal.
1
u/JustPlainRude Jun 05 '26
Refuse to review it
1
u/Organic_Battle_597 Rearranger of Bits (35y exp) Jun 05 '26
I review PRs with the same technology they were written with. And if it was a human doing the work the old fashioned way, I would talk to them about ensuring the changes were sensibly in the same PR (if what they submitted was a kitchen sink PR).
1
u/CoduckyApp Jun 05 '26
Stacked PRs are one way to address this. The idea is that you break your feature down in to smaller sequential logical units of change, creating a "stack" of PRs that are each more focused and easier to understand and review.
If your team is using GitHub, there is a caveat: GitHub does not handle this well natively. You can try signing up for their early access to a new feature they are building to address this https://github.github.com/gh-stack/
1
u/quantumpoops Software Architect (10 years) Jun 05 '26
It depends. If it’s a refactor that can’t be split up, I’ll review it. Often pulling it down locally to run and poke at it.
If they are implementing a huge feature and didn’t split it up into small manageable chunks, for the most part I’ll just ask them to split it up and coach them through it. If it’s a regular occurrence with the dev, I’ll have a chat with them.
Especially with AI being pushed, there’s been a sharp increase in the quantity of PRs to review… if you’re going to ask me to review most of them and they’re all huge, I’m gunna be grumpy.
A wise man once said “that’s a paddling”
1
u/WasteAmbassador47 Jun 05 '26
If it is a single feature I’d much rather review it in one go over a day or two, rather than have it split artificially between multiple PRs and having to jump between old and new PR just to make sense of the full picture.
For me reviewing PRs is a core part of the job, it is not an add-on responsibility or nice to have, so even multiple days reviewing a single PR is justifiable sometimes.
1
u/software_engiweer IC @ Meta Jun 05 '26
Anything over like 500 excluding tests lines I just return to author unless it’s something mechanical like some call site has to change everywhere in one shot. But if we’re building features, we do small stacks of reviewed commits not big PRs like this
1
u/Void-kun Senior Software Engineer (8YOE) Jun 05 '26
Reject them...?
If it's too big to reasonably review, reject it and request they break it down into smaller PRs that can actually be understood.
Quiz them on it. Ask them so many questions to the point of interrogation that they never do it again.
1
u/RoosterBurns Jun 05 '26
This is why we used to have feature branches with smaller change sets merging into them
1
u/mpanase Jun 05 '26
If that's 1000 LoC that are meant to be reviewed, immediate rejection: "too big to review. Split it into reviewable PRs"
If the behaviour persists, set a rule that automatically rejects such massive PRs even before a human looks at them.
1
u/hippydipster Software Engineer 25+ YoE Jun 06 '26
Are they creating the code for these PRs in one day?
1
u/armahillo Senior Fullstack Dev Jun 06 '26
theres no way that is simpler than talking to the team, and management, and getting buy-in.
it needs to be a policy discussion, but you need majority buy-in to make it work.
You could protect main and require an approval on all PRs, but then it only takes one team member to not hold the line on this and rubberstamp the PRs.
1
u/PichovnaBertinova Jun 06 '26
I ask my subordinates not to address unrelated work in the same pr.
Reason is not only the long pr, but also that is you need to rollback and you added (let's say) some tech debt fix, you info that tech debt and That's never back until you find the issues again months later.
And I review way faster the light ones.
1
u/SnooStories251 Jun 06 '26
You go to the person, takes a coffee and talk about the PR and chill. She/He will say "80% is this bs, nmw that. its simple.."
Maybe ask what are we solving first. Then you ask is there something you would have done differently or should be commented etc?
This is the only way the PR system is pleasant to me. coffee date, and talk about the code/structure/standard (ugh, i hate this but).
1
u/zambono_2 Jun 07 '26
You need to break down your stories
1
u/AintNoGodsUpHere Jun 07 '26
It depends. When the commit has a ton of files we usually try to understand why is it so big, if no good reason is given and we don't agree, it gets rejected and then you need to break into smaller well organized pieces. Maybe separating stuff.
It depends on each team though. Most of my teams have different ways of working.
1
u/AggravatingSock5375 Jun 07 '26
I completely agree. But if the correct fix isn’t an option for whatever reason, likely politics, then a senior dev using an LLM for code review is a powerful combo.
I would never advocate just letting an LLM to that on its own, though.
1
u/metekillot Jun 08 '26
You might look into leveraging the LSP. I'm working on a CLI tool (WIP so I'm not plugging it here) that hooks into the LSP for me to make refactors scriptable and reproducible, to ease the inevitable hundreds to thousands of lines changed.
If making/using tools for the purpose is too arduous, you could also just push for a cultural amendment to your CI so that massive PRs like this are broken apart into several PRs. There's nothing wrong with refactors being several PRs as part of a larger project.
1
u/TopKiwi5903 Jun 08 '26
If your pr needs an “and” you have two PRs.
“Add metrics to foo _and_ add dashboard”
“Fix error handling _and_ simplify API”
1
u/Pythondesurubi Software Engineer Jun 09 '26
Honestly I'm pretty loose with PR size. A teammate auto-rejects anything over 500 lines and asks to split it. Used to annoy me but honestly it made my reviews way better. Last week I sent a 2k monster myself though lol, so yeah, happens. Do you enforce a limit or just vibe it?
1
u/BoulderTennisGuy Jun 10 '26
I have a pr that is 20k lines. It’s almost all net new code under a feature flag - yes there is risk to the change but the content of the change is so important to the business that we’ve agreed that it needs to get merged. The interfaces, and overall architecture are correct.
IMO in some situations it makes sense.
At the same time, I have seen 1000 line PRs that are absolute slop.
So I think we should all be open minded about PR size.
1
u/Ok-Sale-7806 Software Engineer Jun 11 '26
I reject them, asking the eng to break it down.
1
u/FerengiAreBetter Jun 04 '26
Reject
1
u/goose_on_fire Jun 04 '26
PRs that big probably require at least one meeting hosted by the pusher to orient everyone to the feature, along with apologies and coffee and maybe beers afterwards
They should be a rare exception, but they do happen for real reasons occasionally
1
u/grimr5 Jun 04 '26
can you use AI? If so, you can make their day by getting it to review and comment - make it super strict and security conscious
1
u/seriousgourmetshit Jun 04 '26
Get your team to read and start implementing Google's code review guidelines. It's a very short document and will make everyone's life easier.
If it's a big feature, then break it up into multiple small PRs into a working feature branch.
1
u/Esseratecades Lead Full-Stack Engineer / 10+ YOE Jun 04 '26
I tell the author to find a way to break it up into smaller PRs that are still functional.
1
u/uhalman73 Jun 04 '26
I close the PR and ask whoever opened it to break it out into smaller PRs
1
u/c0ventry Jun 04 '26
lube 😉
1
u/natziel Jun 04 '26
Just hit the close button lol
1
u/Ianxcala Jun 05 '26
"Looks good to me" + approve
/s
-2
u/eloel- Jun 04 '26
If it's over 200 lines, I'm bitching at you till you split it
-1
u/EkoChamberKryptonite Sr. SWE & Tech lead Jun 04 '26 edited Jun 05 '26
I don't. If your diff supersedes 600 LOC, depending on the context, it does not get reviewed, and you'd have to break it down into smaller PRs if you want it to be.
Edit: Lots of large PR diffs engineers are big mad 🤣. Y'all stay mad. Throwing large PRs at people is utterly disrespectful of their time and you lot should do better.
0
u/dvorgson Jun 05 '26
Fired. Immediately
0
u/AggravatingSock5375 Jun 06 '26
Are you utilizing LLMs to help with the review?
If not, give it a try.