I Ran an AI Code Governor on Next.js. Here's What It Found in 5 PRs. #93373
Replies: 1 comment 3 replies
-
|
Two of those PRs are closed, didn't merge. And part of having a test suite, is to be able to refactor or optimize code, with the guarantee that behaviors/features are protected by the tests. We have an ever growing, extensive test suite, we often open new PRs with an e2e to begin with. Some of the CI stuff would be nice to test, but then that brings up a secondary consideration, does the CI runtime have a proper testing suite? or are we just gonna mock the primitives? We have our Vercel Bot that, unlike every other tool we have tried, actually does surface errors, opens suggestions for places where a refactor was not applied, hints at optimizations, and even calls out when code, whilst being correct, doesn't adhere to patterns in the surrounding concern. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Interesting Pattern I Found While Testing My Governance Tool on Next.js
I built a tool called Zaxion that checks if PR changes match your repo's architectural rules. Spent some time running it on recent Next.js PRs and kept seeing the same thing, so figured I'd post about it.
What I ran it on
5 recent PRs from the main branch:
next build#93280 (build optimization)And the result was consistent across all of them: production code changed, but no test file changes.
What that looks like in practice
PR #93285: 339 lines modified in
scripts/release-github-api.js. Zero test updates.PR #93283: New Rust bindings added. Zero test updates.
[You get the idea - all 5 followed this pattern]
Here's the audit report:
Zaxion-Audit-vercel-next.js.html
The secondary stuff I noticed
While the tool was at it, it flagged some other things:
.catch()handlersNothing catastrophic. But patterns.
Why I'm posting this
Not to criticize Vercel. You move fast, and that's clearly a choice that works. I get it.
But I kept thinking: if this pattern shows up in Next.js, where you have dedicated reviewers and strong CI practices, it probably shows up everywhere. Which means human reviewers are probably missing things just because they're tired, or because the PR looks small.
That's what Zaxion does - it doesn't get tired. It just checks the rules.
Genuinely curious
How do you think about this tradeoff? Are the existing tests sufficient to cover these changes? Or is the test coverage something you're aware of and accepting as a speed thing?
Asking because I think most teams would benefit from having something automated catch these patterns before merge, rather than discovering test gaps later.
If anyone wants to try it on their own repos: zaxion
Login at: zaxion.dev and try Free Policy Simulator
Beta Was this translation helpful? Give feedback.
All reactions