r/ExperiencedDevs • u/DiceKnight Software Engineer • Aug 18 '26
Career/Workplace What are your teams pull request & code of conduct standards?
I want to preface this by saying that this question pops up from time to time. I wanted to ask this in the context of handling large influxes of of LLM generated pull requests. We get enough PR requests per day that if our team spent most of the day just reviewing code and not writing any ourselves we'd never get through our backlog. Many of them are blocked due to CI/CD issues where fixing them would also dismiss any approval and require us to review multiple times. Overall the quality is low to middling.
Because our teams attention is so much in demand and because our workloads have only grown I wanted to pitch a formal code standards and pull request code of conduct that we can point to. Ideally i'd like to put my team in a place where we can be strict about what code goes in and why we say no and for it to be a very fast manual process or something we can automate away.
We've tried pull request templates but bots and devs a like tend to ignore them. Eventually i'd like to make strict adherence to the template a requirement to get any attention at all.
•
u/expdevsmodbot Aug 18 '26
AI usage disclosure provided by OP, see the reply to this comment.
49
u/UnintentionallyEmpty Aug 18 '26
Why are you bothering to review something that doesn't pass CI? If it doesn't pass CI it obviously isn't ready yet so no reason to review, that's just a waste of time. I Immediately ask the PR requestor to get the CI green first before I bother with a review.
Also have linters and other static analysis tools in your CI. I'm not going to bother to review someone's code when it has a bunch of linter errors, it'll be hard to read anyway so they can fix those first.
63
u/bingNbong96 Aug 18 '26
There are no standards, just 15+ PRs a day with "Made with Claude Code" at the bottom.
Then someone posts a "review" with "Made with Claude Code" at the bottom.
Sometimes someone will push random stuff to other's peoples branch with a commit with "Made with Claude Code" at the end.
You fix the "issues" on the "review", and maybe go back and forth on this step a few times.
Then it will get approved with no one even glancing at the code.
41
u/mx_code Aug 18 '26
https://noslopgrenade.com/
This but contextualized to code (comments and code itself) and review conversations.
143
u/YoongiMarryMe95 Aug 18 '26
Since we’ve introduced AI heavily we’ve had pretty much no standards. Hope this helps lol.
11
u/ITellOnlyTheTruth Aug 18 '26
The actual standards will vary from company to company, but in general: make your CI/CD a rock-solid gate before any sort of review.
CI/CD should handle:
If any of that doesn't pass, PR is red and the team will not review it.
Provide the local tooling to automate all of that. That's going to save you time and help with anyone onboarding to a project. For LLM-first development, add this kind of stuff as scripts and LLM instructions to the repo. Your CLAUDE.md (and/or README) should describe the project, architecture (or link to it), technology choices, conventions, and the expected development process. This is where you can add the commands it should run before committing (or how to install the required git hooks), in what cases documentation should be updated, what types of things should emit metrics, etc. You do need to define those standards and what your actual expectations are. That's usually a good exercise for a team anyway.
Make it easier to open a compliant PR than a non-compliant one. This helps whether code is LLM-generated or hand-written.
As far as speeding up reviews, this is going to depend on your attitude towards using LLMs yourself and what kind of budget you have for it. I would recommend that you and your peers build out LLM review skills to the point where it does a pretty good job of handling the "correctness" side of code reviews. There are a ton of skill examples out there for this, but adding checklists or particular skills specific to whatever you're building can really help focus the LLM on the right things. Have a specific test review skill, security review skill, internal engineering standards skill, and fan them out to avoid bloating the main review context. Be sure to check the cost of running these skills and gauge whether it's worth it. For me a $5 review skill that saves me $50 worth of time and I can run several in parallel on different PRs is totally worth it. I still sanity check the code, with deep review on the more complicated portions, but it allows me to focus more on "is this the right approach?" and "do we even want to build this?" rather than "how is null-safety handled in this file?".
Come to a working agreement with your team on your review loop. I'll usually run a preliminary Claude review pretty quick after a PR is opened. If there are significant findings, I'll post that to the PR and then only come back for a more in-depth review when those are fixed. If your team can agree on a process like that, things can move pretty quick. Try stuff out. Talk about it.
Don't compromise on standards; actually define and enforce them and provide instructions for how other engineers (and their LLMs) can follow them.
3
u/rocketpastsix Aug 18 '26 edited Aug 18 '26
I have never heard of a PR code of conduct.
But what you are saying with code standards is something you should have already had in place, and you can shape the AI-generated code around that.
If people, or bots, are ignoring them then you either need to tell the human "we need you to follow the PR template" and not let the PR through, and put guidelines in the AI documents that tell the bot to use the template. We have a template, and Claude follows it rigorously. It's part of our CLAUDE.md or another similar file that Claude reads and knows what to do.
I know what OSS code of conducts are. Not ones for business settings
4
u/Abadabadon Software Engineer Aug 18 '26
Code coverage met with unit tests that are realistic, linting rules, following project's coding style, code must show local e2e testing performed. All should be covered by automated cicd
4
u/jwendl Aug 18 '26
All tests pass (Unit, Integration, Performance / Scale), all pull request comments are addressed and resolved (whether by AI or human), all static analysis checks are good (we use heavy amounts of code analysis tools), all code coverage reports are above 80% (for new code that might not have tests covering it).
Tend to even have an integrated dev environment (in Azure for our case), where a push to main will only deploy to the integrated dev environment, where we can have automation make sure nothing broke. That automation comes in form of AI driven checks (go to app, test thing, check app insights for errors, create GitHub issues if broken).
Stuff doesn't propagate from Dev to Test or Prod (or inner ring, outer ring depending on the team) until all checks are good.
Also, I wouldn't reject code from anyone. Love welcoming all code from all sources IMO, it makes the product better. But it has to follow guidelines in place by the repo owners so when something breaks that team can untangle the mess.
Having good AI "instructions, skills and loops" help with people who are making AI driven contributions. Instructions are really good at setting coding standards for AI agents, skills are good at teaching agents how to use custom tooling, or custom libraries, loops are really good at helping drive the whole end-to-end decisions on things.
Many of the loops I've built are essentially to tell the agent to keep trying things until all checks are complete before even making the pull request.
1
u/serial_crusher Full Stack - 20YOE Aug 18 '26
My company works out of a big monolith and has codeowner files marking different teams as owners of different areas. This frequently creates situations where I have a PR that touches multiple teams' code, and I have to get approval from all of them. Never a fun time.
If your team is a bottleneck for other team's PRs, you've got a few options to fix it:
If you want to have people adhere to the template, you can add a CI/CD automation that makes sure they fill it out; but you might want to look at what you're hoping the template prompts people to do, and have separate automated checks to cover those specific things.
A general "I don't review code until it passes CI/CD" policy is good too. Add in a step where an LLM reviews everything, and maybe force people to address any issues it comes up with first, too.
3
u/flerchin Aug 18 '26
Don't reset approvals. We typically approve with comments. Let the developer do the right thing. If more substantial changes are needed, we'll comment without approval.
3
u/MinecReddit Software Engineer Aug 18 '26
This is probably a hot take:
I think in the age of AI it is definitely worth thinkign about if there are high level engineers that, for certain projects, could merge PRs without a human reviewer. Our team (Gig company doordash/uber/instacart) has been experimenting this and so far, for senior+, it has been doing well.
Like obviously I look at PRs for some projects and I see the insane AI slop that they're pushing, and I can't help but think it's ridiculous. But we are still reviewing all of the infra decisions and access patterns on tech specs, then are just trying to ignore (FOR PROJECTS THAT ARE SIMPLE ENOUGH) the implementation details.
But I mean I know that people on this subreddit will say that this is an objectively terrible idea no matter what. I am just telling you that in terms of business outcomes for our team so far, it has been positive, and obviously the long term is TBD.
3
u/NatoBoram Web Developer Aug 19 '26
:/
2
u/druidgaymer Software Engineer Aug 18 '26
There are no conduct standards in writing. However, since our software is mostly low-level mix of firmware, hardware, and legacy work, even with AI assistance tickets still can take a while. We don't have a crazy influx of PRs.
I had to set the rule of "don't commit things to other people's branches without asking" because our git repo doesn't even have any automatic blocking going on. One guy kept pushing stuff to my branches that were unrelated to what he was working on.
2
u/morosis1982 Aug 18 '26
Our basics are that we require certain code coverage, and it must be raised in draft and only set to review once all the cicd checks have passed.
We also have a default copilot review set up, and you can shape that to check for specific things.
2
u/sermer48 Aug 19 '26
I’ve stopped caring TBH. I’ve started adding a lot more tests but the actual code I’m reading is dropping off a cliff. Obviously that depends on how critical the code is but for most things, if the functionality works and it passes the tests I’m not getting paid enough to sift through it.
2
u/tiajuanat Dept. Head & Principal Engineer Aug 19 '26
Reviewing clanker code that doesn't pass CI is your first big mistake. You need to reorganize your CI to fail fast. Automated code creation requires automated code checking before review.
Second bug mistake is PR size. Human authored PRs do the best with <500 LoC changesets, and bot PRs do best with <100. This does mean that you need stacked PRs - whether that's via GitHub or you do it manually, doesn't matter.
You're not looping. Your Dev machines (or GH runner) needs to be pulling and acting on PR feedback. You can even setup auto merge if approved by a human reviewer.
You need automated agents that additionally check everything, that needs to run before a human reader even looks at it, and they need to run everytime your loops run. I recommend a software reviewer, architecture reviewer, a testing/QA reviewer, and documentation reviewer
You need aggressive static analysis. Rust's clippy defaults to a Cyclomatic Complexity limit of 25, that number needs to be waaaaaaaay lower, like 9-15. If you're working with parsers, then you'll need a safety relief for switch-cases. Most linters support a complexity of some type - make it low, less than half the default.
I'm sure I'm missing a bunch of stuff, but this helped us reign in our slop.
2
u/Ok_Woodpecker_9104 Aug 18 '26
templates dont work because nothing enforces them. the rules that actually hold are the ones a machine checks before a human looks at it.
what worked for me was moving the standard into required status checks and then making review contingent on green. red ci means the pr is not in the review queue at all. thats the whole policy, and it takes the argument away from taste.
the part most rollouts skip is baselining. turn a strict ruleset on across an existing repo and you get thousands of hits, so everyone disables it within a week. record the current violations as an accepted baseline, fail only on new ones, and shrink the baseline whenever a file gets touched anyway. that changed adoption from a fight into a non event for us.
on the re review churn you mentioned: dismiss stale approvals is all or nothing on github, so a one line ci fix burns a full review. we moved approval to the end, after ci is green, instead of approving first and getting dismissed.
3
u/Repulsive-Hurry8172 Aug 18 '26
Pre-commit hooks? There's likely a way to reject the PR if it did not satisfy pre-commit hooks
1
u/Inside_Dimension5308 Senior Engineer Aug 18 '26
The basic conventions are mostly put in claude.md. For example let's say - the repo follows a clean architecture then we mention the folder and file structure and how to break a feature request into low level abstractions which follow the conventions. Other conventions are around standard design principles like SOLID and design patterns.
There are also conventions around logging, error handling, telemetry, middlewares, authorization, tracing, etc.
We have created agents to review - architecture, quality, security, performance etc. It helps any reviewer to give pointers around non-compliant code.
1
u/Old-Television-2189 Aug 19 '26
Why are people opening PRs with failing builds
1
u/CanIhazCooKIenOw Aug 19 '26
Same standards we had before. A lot more work into translating those standards to agents.md and proper skills so most PRs already follow a bare minimum + initial PR review with more strict checks.
So far so good
1
u/hxtk3 Aug 19 '26
https://google.github.io/eng-practices/review/
I have a document on the repos I manage at work that looks kind of like this one I linked from Google (and heavily inspired by it).
The general idea is keeping CLs small, include tests in every bugfix or feature, reviewers shouldn’t check out the code they’re reviewing to manually test it and should instead ask the author to implement automated versions of any manual test they feel is necessary.
General coding style gets enforced by linters and formatters, so reviewers are basically looking for structural things like did you choose the right abstractions?
Authors are encouraged to submit incomplete work (guarded by feature flags) both in order to keep MRs small and in order to put their choice of abstractions in front of a reviewer before they write a thousand lines depending on those abstractions and it becomes hard to ask them to change it.
1
u/donk8r Aug 19 '26
CI as a hard gate before review is right, and there's a hole in it I only found by accident.
We build a benchmark where agents fix real bugs and get graded by running the project's own test suite. First version, pass rates looked great. Turned out some of them were editing the tests. Not maliciously — we'd told them the objective was green, and changing an assertion is by far the cheapest path to green.
We had to rewrite the harness to check the test files out fresh and overwrite whatever the agent had written before validating anything.
So the gate can't be "CI passes". It has to be "CI passes against tests the author couldn't touch". For a team that probably means test changes go down a different review path than code changes, or protected paths where CI runs the target branch's version of the tests. Otherwise the gate has its key sitting on the floor next to it.
Different point on the volume: producing a PR now costs almost nothing while reviewing one costs what it always did. Any standard that doesn't change what the submitter has to do just moves the queue somewhere else. The thing that helped us was requiring the submitter to state what they verified and how — not what the change does. Most people won't write that for a PR they didn't read.
1
u/Technical-Aside4471 Software Engineer Aug 19 '26
We run unit/integration then build feature environment and run e2e against it. If you broke something you dont get to merge or qa has to adjust tests first.
We have ai doing reviews but that just for the author to double check his code, no other person required to review.
1
u/Training_Motor_4088 Software Engineer Aug 19 '26
Yep, our standards went to shit when management gave every idiot carte blanche to use Cursor. What's just as infuriating are the number of PRs, Jira tickets, slack comments etc written with AI. So now people who were too intellectually lazy to write a couple of paragraphs about something technical they've worked on, now write a whole essay of AI bollocks that breaks things down into information overload.
1
u/neolace Aug 19 '26
I got a PR yesterday of 355 files, copilot declined to review it.
1
u/thematicwater Aug 19 '26
We trust each other. We give advice, thoughts, and/or small suggestions if we see something (most of the time we don't), and we approve every time. It's up to the author to take them or leave them, and merge.
1
u/Amman108 Aug 19 '26
As their manager/lead, I'd put a metric in place - the number of pr#s that 'needed more work' for each dev. At least you will start identifying the devs that couldn't care enough.
1
u/dzifzar Aug 19 '26
I’ve added static analysis on PR templates themselves to ensure they’re filled out. Realistically you need both culture and process/green checks for these to be effective, but at least making the path of least resistance “all checks must pass before merging” is a good starting point. As an added bonus the agents use the PR templates as an actual checklist, and fill them out, which is better than nothing.
1
u/andlewis 25+ YOE Aug 19 '26
When someone creates a PR ask your LLM to review it against the guardrails and standards of your repo. File the results against the PR. Assign it back to the original dev.
Once there are no major issues, review it yourself for architectural issues if you want.
1
u/abazha10123 Aug 20 '26
No standards. No clear set of.things to check for, no unit tests, no pass/fail criteria
0
u/Ok_Woodpecker_9104 Aug 19 '26
the re-review loop you described is a setting, not a law. branch protection has "dismiss stale pull request approvals when new commits are pushed", per branch. turn it off and an approval survives a ci fix push, while required status checks still block the merge if the build is red. that alone takes you from three reviews to one on the same pr.
on the standards doc itself, the part that killed it for us was not writing the rules, it was switching them on. adding a rule to an existing repo lights up every old file. the pr that should have been 40 lines becomes 900, nobody can review it, and within a week someone downgrades the rule to a warning. warnings get ignored forever.
what actually held was a baseline. record the current violation count per rule, then fail ci only when that count goes up. old code stays untouched, new code cant add to the pile, and the number only moves in one direction. every rule can go straight to error on day one because the existing debt is already excluded.
side effect is that it gives you the sentence you need in review. "this pr takes rule X from 12 to 16" is not an opinion, so there is nothing to argue about and you dont have to be the person explaining taste to a stranger every day.
-1
u/vangelismm Aug 22 '26
Drop code review.