fix(ci): stop failing the API audit for adding a compliant route - #7027
Conversation
`totalRoutes` sits at 1162 and the repo has exactly 1162 routes, so the next
route fails CI whether or not it is contract-backed:
API validation audit failed:
- route count increased from 1161 to 1162
The invariant worth holding is that every route has a contract, and
`nonZodRoutes` states exactly that. It is 0, and it rises the moment a route
ships without one — `zodRoutes === totalRoutes` today, so the total adds no
information the other two counters do not already carry.
What it adds instead is a habit. The only way past it is editing the number, and
this file holds seven other baselines that work only while nobody bumps a
baseline casually.
The total is still printed; it is no longer a failure. Verified both directions:
a compliant new route passes where it previously failed, and a route without a
contract still fails through `nonZodRoutes`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 99c1616. Configure here. |
Greptile SummaryRemoves the aggregate route-count failure from the API validation audit while retaining route-count reporting and the gate on non-Zod routes.
Confidence Score: 5/5The PR appears safe to merge because it removes only the aggregate route-count failure while preserving the audit’s contract-compliance gate. Discovered routes remain exhaustively divided into Zod-backed and non-Zod counts, and any increase in the latter still fails the audit.
|
| Filename | Overview |
|---|---|
| scripts/check-api-validation-contracts.ts | The audit no longer fails solely because the total number of routes increased; its non-Zod and strict boundary-policy checks remain intact. |
Reviews (1): Last reviewed commit: "fix(ci): stop failing the API audit for ..." | Re-trigger Greptile
The next route fails CI regardless of quality
BASELINE.totalRoutesis 1162 and the repo has exactly 1162 routes. The gate is:Route 1163 turns CI red whether or not it is contract-backed. Reproduced by dropping the baseline by one:
It gates nothing the other counters miss
Live output:
total routes: 1162 / Zod-backed: 1162 / non-Zod: 0.The invariant worth holding is every route has a contract, and
nonZodRoutesstates exactly that — it is 0 and rises the moment a route ships without one. WithzodRoutes === totalRoutes, the total carries no information the other two counters don't.What it adds instead is a bad habit
The only way past this failure is editing the number. This file holds seven other baselines —
routeZodImports,routeLocalSchemaConstructors,clientHookZodImportsand the rest — and every one of them works only while nobody bumps a baseline casually.A gate you must bump to add a compliant route trains exactly the reflex that erodes the gates that matter.
Change
The total is still printed as a metric. It is no longer a failure condition. Nothing else moves.
Verified both directions
totalover baseline,nonZodstill 0)nonZodrises)The second was checked by lowering
nonZodRoutesto-1, which correctly producednon-Zod routes increased from -1 to 0 (1162 Zod-backed routes)and exit 1.check:api-validationandcheck:api-validation:strictboth exit 0 on the restored file.