Ask HN: What is a common PR review time at your company?
37 comments
·January 10, 2025moosedev
As a reviewer... it really, really depends on how trivial or gnarly the PR is.
If it's a simple change that is obviously correct, I'll try to unblock the author ASAP - often within minutes, even if it interrupts my flow.
If it's a giant PR with lots of risky changes in vital code, an awkward-to-unreadable diff, and/or maddeningly questionable design/coding decisions that require me to think a lot and compose some nuanced, reasoned comments to steer you in a better direction, then, well, you might find yourself nagging me for a review 2 days later. (And I'll probably ask you to split up PRs like this in future, e.g. to separate major refactoring from any logic changes.)
jofer
This x1000. It's not about the org, really. It's about what's being changed.
Yes, a lot of large codebases have things that look wrong. They're not always wrong. Trying to clean up what look like cobwebs at the core of a large codebases often means removing things that are there for a reason. The reason is usually counterintuitive and could be documented better. But often only a few people can really evaluate the change.
A small PR is likely to be accepted quickly, and a large PR is likely to take awhile. No one gets upset by that, though.
The flip side is that a small PR to a critical part of the codebase is also likely to take awhile and be treated as "default to no". It's often hard to see that from the "outside", though.
With that said, trying to go the extra mile and make things clear, concise, and better documented than before goes a long way in getting an MR reviewed quickly.
sarchertech
Here's what no one will tell you about PR reviews. Highly productive engineers often learn to work around them. Once you've been around for a while, you gain trust. This usually results in a group of people who will rubber stamp anything you send them.
I've been doing this for 20 years and I've never seen an organization where this didn't exist to a significant degree.
I review my PRs myself line by line. And because of this I've literally never had a PR reviewer catch a major bug (a bug that would have required declaring an incident and paging an on call engineer had it made it through to prod). Not a single time.
So the vast majority of the time, I don't care that someone is going to rubber-stamp my PR. Occasionally, I'll ask someone who knows more than me to give it a thorough going over just in case.
I also very rarely have someone suggest a change in PR that was worth bringing up. But most of the time if I'm doing anything non-trivial, I've already talked it over with someone else well before PR time. I think that is the real time when collaboration should be happening, not at the end of the process.
Essentially, the PR a process at most tech companies is nothing more than a gatekeeping/complicance/CYA mechanism, and realizing this can definitely help your career..
000ooo000
>Essentially, the PR a process at most tech companies is nothing more than a gatekeeping/complicance/CYA mechanism, and realizing this can definitely help your career..
It has value particularly when the team has newcomers or less-experienced developers. Writing it off as 'CYA' discards an opportunity for async feedback to be given on work.
sarchertech
Sure that’s fine when you’re the one doing the review for a newcomer or less experienced dev.
However, I think that PR reviews after the code has been written are the absolute worst time to do this.
ericyd
This isn't a bad reply but it's fairly off topic in my opinion. I think the majority of reviews on my PR are effectively rubber stamps, but sometimes it takes many business days to get that rubber stamp unless I bug people.
sarchertech
My assumption was that you didn’t have a group of people who would rubber stamp your PR based on the frustration with the wait time.
If you do have people who trust you, a slack DM when the PR goes up isn’t bugging them. Maybe they just don’t pay much attention to GH notifications.
greenthrow
If you are never getting good suggestions on your PRs that's a bad sign. Any team of more than 2 people should have some ideas sometimes for each other. Either this means everybody's too checked out to put in effort on PRs or they think it'll fall on deaf ears.
I've been a software engineer for decades and even so, teammates will have good ideas sometimes. Nobody can think of every good idea every time.
sarchertech
I said very rarely not never. I classify suggested changes in 2 flavors. The first is minor changes where someone suggests "hey this would be easier to read if you used syntax A vs syntax B here".
I get those frequently, and they are usually reasonable suggestions, and I usually graciously accept them. But I say it's not worth bringing up in a PR because 99% of the time it doesn't actually matter in the long run. Both forms will have been used in the code base previously, and which one you think is better really comes down to which one you use more. It's the kind of thing you could change with a sufficiently opinionated linter. And the kind of thing that isn't worth the cost of mandatory PR reviews.
The 2nd is where someone suggests changes to overall architecture or changes to the way the feature or code works large scale.
These are much rarer because of several reasons
1. PR reviews are almost always surface level and so are more likely to catch category 1 than category 2. The incentives at nearly every tech company push for this. 2. Very frequently one person isn't available to review all of the PRs that go into a feature, so the reviewers lack context. 3. It's very unlikely that even if someone wants to dig deeper, that they have the free time to spend even 1% of the time the person who wrote the PR spent on it.
But the biggest reason I personally don't get many of the 2nd category is because I talk through non-trivial problems with other experienced engineers before I get to the PR stage.
greenthrow
You're missing a third category which is "here's another way you could do this..." which isn't just about legibility but more tangible tradeoffs.
Certainly I agree architectural decisions shouldn't be made in every PR and ideally should be discussed before that point.
alphazard
Code review should really only exist to guide contributors to the owner of the code they are changing. A new contributor shouldn't need to know the team structure and history of the organization to get changes in. That should be solved by the tooling. Do whatever you want, and the tools will force you to bump into the right people before you can merge.
It's very strange that most companies (maybe GitHub is to blame for this) have something like a free-for-all where anyone can approve anything, as long as they themselves aren't the author. As other comments have mentioned, this reliably creates reviewer cliques as engineers seek out the path of least resistance to get changes in. Those who haven't figured out the game often lose hours of their time to nitpickers and pedants without anything better to do.
This also results in a slow decay since most of the code ends up being written by people who are good at getting code merged, and not people who are good at building the software.
harimau777
At the last place I worked it was common to wait one to two weeks for a PR review. I was the only developer who would do a review within the same day that someone requested it; as a result everyone came to me when they needed a review to actually get done.
When performance reviews came around I was criticized for not getting enough story points merged (because I couldn't get them reviewed) and the fact that I was single handedly responsible for reviewing almost all of the PRs was not deemed to be a valuable contribution to the team.
thunky
> I was criticized for not getting enough story points merged
And I bet you learned to stop doing reviews so quickly.
Your coworkers may have already figured out where the disincentives were.
sigmoid10
That is a solid red flag for any workplace.
esafak
This is what happens when an organization has no idea what matters or how to measure productivity. You did well to leave.
pickledish
Jesus. Sorry to hear it dude, FWIW I’d love to have someone like that on my team. Hope your current place is better!
decasia
Inside my team, we generally review quite promptly (same day, or the next morning). Across teams — it's more variable and depends a lot on context (or lack of context). If I'm chasing down reviews, I'll usually tag people to start out, and then message them directly to ask for reviews 24 hours later, if they don't get back to me sooner. It's rare that someone doesn't review same-day if I ask them directly.
I often find the reviews to be helpful. People come up with edge cases I haven't thought of, or notice things to clean up. I try to proofread everything before asking for reviews, but after I've started at my own diff for a while, it's hard to read it with fresh eyes.
Sometimes we ask for reviews on more experimental PRs too, just to get early design feedback before wasting too much time on polishing the changes.
000ooo000
If your PR isn't blocking someone nontechnical then I expect you to use developer tooling (i.e. VCS) to continue working without requiring that your PR be merged immediately, and I'll review the PR the next time I come to a natural break in my work. If it is blocking someone, then I'll review ASAP with consideration to the priority of whatever I'm working on.
I work with a guy who, until I said "calm down", would share his PR links in the team chat several times a day. He refused to learn rebase, or seemingly anything other than a standard Git workflow of checkout, commit, push, merge, repeat. He has since improved on both fronts.
yichi
Linus torvalds famously said you shouldn't rebase for shared work, it's not a clear cut thing that not knowing how to rebase is bad per se since you shouldn't be using it a lot in the first place in his philosophy, refusing to learn is a different story however.
Tade0
Specifically he said that changing shared history is bad - that would be the master/main branch or release branches, not e.g. your branch.
Not knowing how to rebase means that in order to stay up-to-date with a shared branch you would have to merge it each time and thus produce something akin to a spruce tree in your commit history.
lolc
We expect same day or next day response. Of course only if you're in. But if you're not I might reassign. Also if it blocks me I will ping you in less than a day or straight away.
My most common response is "needs no further review if these points are addressed". On rare occasions my only response is "need more time". Some changes take time to settle in my mind. No good comes from rushed comments.
There is an expectation not to haggle over dumb shit. When you decide to pick a battle, pull in a second reviewer for their opinion.
I'm sure you've heard the "trick" of splitting up large merges to make them easier. Yes this is good up to a point. Other than that, it really is team commitment to timely reviews. No tricks to it.
returningfory2
It depends on the specific coworker I send it to. I have coworkers who will review within an hour without any additional prodding, and coworkers who will take up to a week unless I prod.
In general for small PRs I consider a consistent latency of over 24 hours to be long and mention it negatively in peer review.
danpalmer
Our standard is that when a reviewer is no longer in flow, review should be the next thing they do. The SLO is 1 business day, which is supposed to be the maximum, and the guidance suggests it should be far lower than that. In reality, it varies wildly by team.
I find most of my PRs being reviewed by my team, on the same timezone, are reviewed within a few hours, but I suspect a big part of that is that most of my PRs are very small (they're actually CLs not PRs, and closer to a single commit in some ways, although hard to draw specific parallels to Git).
It depends on the language/ecosystem a bit, but normally I'd try to keep changes under 100 lines for an efficient PR process. Up to 500 lines is manageable but much slower. Over that is just impossible to do good review on.
Something that my previous company had a lot of success with was review by commit. Making sure that the series of commits in a PR "tells a story", with each one being simple and obvious, and then instructing reviewers to review commit by commit. It can speed things up and increase the quality of review substantially, but does require a bit more work from the author.
MattGaiser
Has heavily depended on employee incentives.
At some employers, particularly the Scrum point counting ones, PRs were unrecognized work, so everyone avoided them unless hounded and then people traded PR approvals at the end to score more points as “done.”
At employers that didn’t care about points complete per sprint, it depended on the overall importance of the work as the team leads jumped in to have them done. But even then, as it wasn’t recognized as work in any way, during crunch it got abandoned.
ericyd
I think the "not recognized as work" part feels similar to my experience but I don't really understand the psychology of it. Work is not done until it is reviewed and merged, so the review part is necessarily a part of the work cycle. I don't get the sense that you're advocating for the "not recognized as work" perspective, just responding to that viewpoint you shared.
MattGaiser
Nobody has ever praised me or (as far as I know) a colleague for reviewing work. Certainly not a manager.
My reviewing doesn't show up in Jira under the amount of work I completed.
No performance review of mine has ever mentioned reviewing code.
In summary, there is minimal credit to be had from doing the work and even when there is credit, nobody lets you exchange that credit for much.
Yes, by rule reviewing is considered work, but it is not work anyone gives you much credit for doing. As an individual with incentives not aligned with the company most of the time, that makes it not worth prioritizing.
So I suppose it is recognized as work, but it is the least rewarded of the work you could be doing.
danpalmer
I feel sorry for you working in such an environment, that really sucks.
I have received praise for my review, I have had it mentioned by my manager, including in performance reviews, I have thankfully had leadership emphasise to everyone on the team how much it matters, and I've had great retrospectives on how we can improve the quality and speed of review that resulted in further meaningful improvements.
Changing culture on this is hard, so maybe the answer is just to find a better culture elsewhere, but I can assure you that it does exist.
ericyd
I've definitely been praised for regularly doing timely reviews, but I imagine your experience is probably more common and why that mindset is widespread.
convolvatron
if your reward system isn't based solely on your performance review, but rather than the speed and quality in which your project is completed, the respect of your peers, and their willingness to engage with you in kind, then absolutely being a timely and considerate reviewer is rewarded.
DavidWoof
I've always established the team rule that most PRs must be reviewed within a day. At the very least, devs should be reviewing any open PRs before they leave or when they first get in.
Obviously, there's going to be exceptions for large changes or big rewrites on the one hand, or for tiny label changes on the other hand.
PS. Reading the comments here, people seem to work in some pretty dysfunctional environments. Get the team together and establish some guidelines that everyone agrees on. Review time should be predictable, and the work should be reasonably shared.
65
We've gotten to the point at my company where PRs are almost a formality. PR -> merge -> Put on environment for QA. QA finds issues, fix issues with new PR, merge, and so on until we have our release.
My last company was much more methodical with actually reviewing code but honestly? I kind of like the trust in developers and we're able to get code out a lot quicker.
I find myself frequently frustrated by waiting for PR reviews. There is tons of writing on the internet about short review times being better for productivity, and lots of tips-n-tricks for how to reduce PR review time.
I've started to consider that my expectations are just wrong. I'm curious what other experiences are like. What is an average duration range for your PRs to get approved or changes requested? I'm totally fine with anecdotal responses.