ci: run the contract api-schemas drift check in CI, not only in the local gate - #10268
ci: run the contract api-schemas drift check in CI, not only in the local gate#10268JSONbored wants to merge 2 commits into
Conversation
…ocal gate `contract:api-schemas:check` was reachable only from the `npm run test:ci` aggregate, so nothing in CI ever ran it. That is the same local-only gap the selfhost and miner env-reference steps already document on themselves, and it has now let this artifact drift twice with zero CI signal: once when the discovery-route schemas were added without teaching the generator, which left `main` red for every PR that ran the full local gate, and again when #10160 added `linkedIssueMaintainerExempt` without regenerating. The step is gated on the generator's three real inputs. Two were already covered -- src/openapi/schemas.ts by `backend`, apps/loopover-ui/public/ openapi.json by `ui` -- but the generator also scans the contract package's own modules to emit its imports, and no filter here watched packages/loopover-contract/** at all, so a contract-only PR would have skipped the check it most needs. Hence the new `contract` filter, shaped like its `engine` / `mcp` / `miner` siblings. This also completes the issue's "regenerating must produce a file that compiles" guard without a new test, and the pairing is worth stating: the drift check proves committed == generated, and `typecheck:packages` compiles packages/loopover-contract/src/**, which includes the generated file. Together they now prove in CI what previously only held if someone ran the local gate. The other two deliverables are already resolved on main: #10225 taught the generator to emit the discovery-route schemas, so regenerating is now a no-op rather than destructive, and the `linkedIssueMaintainerExempt` regeneration landed with it. Closes #10237
Superagent Supply Chain ScanSuperagent flagged 1 dependency introduced by this pull request. High risk:
|
|
Important 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏳ LoopOver is waiting…LoopOver has seen this pull request and is waiting on CI checks to finish before reviewing it. This comment will update once the review runs. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟨 Waiting |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Note on the red Superagent Supply Chain Scan — it is a pre-existing false positive, not something this It reports Precedent that it does not block: #10217 ( Flagging rather than acting on it: silencing a supply-chain finding is not something to do from inside an |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10268 +/- ##
=======================================
Coverage 92.28% 92.28%
=======================================
Files 939 939
Lines 114775 114775
Branches 27715 27715
=======================================
Hits 105920 105920
Misses 7553 7553
Partials 1302 1302
Flags with carried forward coverage won't be shown. Click here to find out more. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
loopover-ui | 1db8968 | Jul 31 2026, 11:23 PM |
d465fe6 to
1db8968
Compare
|
Superseded by #10280, which contains this change verbatim (the Contract api-schemas drift check step, its conditional, and the |
What
contract:api-schemas:checkwas reachable only from the localnpm run test:ciaggregate — nothing inCI ran it. This wires it into
ci.ymlalongside the other generated-artifact drift checks.Closes #10237
Two of the issue's four deliverables are already resolved on main
Verified before writing anything, since the issue's central claim is now stale:
npm run contract:api-schemas:checkfails on currentmain" — it passes.npm run contract:api-schemason current main produces an empty diff. fix(api): validate discovery routes against the schemas their spec publishes #10225 taught the generator toemit the discovery-route schemas, so the artifact and its generator no longer disagree.
linkedIssueMaintainerExemptregeneration landed with fix(api): validate discovery routes against the schemas their spec publishes #10225 too.What remains live is the issue's contributing factor 1, which is the reason both drifts went unnoticed
in the first place — and that is what this PR fixes.
The gating
The generator has three inputs, and only two were covered by existing filters:
src/openapi/schemas.tsbackend✓apps/loopover-ui/public/openapi.jsonui✓packages/loopover-contract/**So a contract-only PR would have skipped the very check it most needs. This adds a
contractfilter shapedexactly like its
engine/mcp/minersiblings.The "must produce a file that compiles" deliverable
Satisfied structurally rather than with a new test, and the pairing is worth stating explicitly:
contract:api-schemas:checkproves committed == generated;typecheck:packagesrunstsc -p packages/loopover-contract/tsconfig.json, whoseincludeissrc, soit compiles the generated file.
Together they prove the generated file compiles. Both now run in CI; previously the first held only if
someone happened to run the local gate.
Verification
npm run contract:api-schemas:check— passes on this base.npm run contract:api-schemas— empty diff, confirming the generator is no longer destructive.npm run actionlint— clean.Noted separately, not fixed here
While measuring this I found
contract:api-schemas:checkis not the exception — 22 of the 42 drift andwiring checks reachable from
test:cirun in no workflow at all (measured againstmain, this oneincluded), including
checkers-wired:check,dead-exports:check,typecheck-coverage:checkandtest-wiring:check. Fixing that wholesale is amaintainer call about CI runtime and per-check gating, not something to smuggle into this PR, so it is
filed on its own.