feat(openapi): document GET /v1/repos/:owner/:repo/gate-config/effective - #6687
Conversation
…ive (JSONbored#6611) `gate-config/effective` (src/api/routes.ts) is the direct sibling of `live-gate-thresholds` — same auth (requireStaticProtectedApiToken + mcp-allowlist) — but was missing from the OpenAPI contract entirely (no schema, no registerPath, no test), so it never appeared in the generated openapi.json or the frontend copy, even though its live sibling did. - Add GateConfigEffectiveResponseSchema to src/openapi/schemas.ts matching the handler's inline response shape ({ repoFullName, effective: { confidenceFloor, scopeCap: { files, lines } }, shadowPending }), with the same .openapi("GateConfigEffectiveResponse") convention as the adjacent LiveGateThresholdsResponseSchema. - Register the schema and a registry.registerPath for GET /v1/repos/{owner}/{repo}/gate-config/effective in src/openapi/spec.ts, adjacent to live-gate-thresholds; the handler returns 200/401/403 (it always returns data with nulls rather than 404-ing). - Add a .toBeDefined() assertion for the new path to test/unit/openapi.test.ts. - Regenerate apps/loopover-ui/public/openapi.json (ui:openapi:check passes). Scoped to gate-config/effective only; no other undocumented route is touched. Closes JSONbored#6611
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6687 +/- ##
=======================================
Coverage 93.65% 93.65%
=======================================
Files 681 682 +1
Lines 68114 68118 +4
Branches 18706 18711 +5
=======================================
+ Hits 63791 63795 +4
Misses 3347 3347
Partials 976 976
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 19:21:43 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
What
GET /v1/repos/:owner/:repo/gate-config/effective(src/api/routes.ts) is the direct sibling oflive-gate-thresholds— back-to-back handlers sharing the exact same auth (requireStaticProtectedApiToken+ themcp-allowlist check) — but was missing from the OpenAPI contract entirely: no schema, noregisterPath, no test assertion. So it never appeared in the generatedopenapi.json(orapps/loopover-ui/public/openapi.json), even though its live sibling did, leaving API consumers to reverse-engineer it from the route implementation.Resolves #6611.
Change
src/openapi/schemas.ts: addGateConfigEffectiveResponseSchemamatching the handler's inline response shape —{ repoFullName, effective: { confidenceFloor, scopeCap: { files, lines } }, shadowPending }— with the same.openapi(...)convention as the adjacentLiveGateThresholdsResponseSchema.src/openapi/spec.ts: register the schema and add aregistry.registerPathforGET /v1/repos/{owner}/{repo}/gate-config/effective, adjacent tolive-gate-thresholds. The handler always returns data (nulls when no override) rather than 404-ing, and returns 401 (bad token) / 403 (not allowlisted) / 200 — so those are the documented statuses.test/unit/openapi.test.ts:.toBeDefined()assertion for the new path, so a future regression is caught by CI.apps/loopover-ui/public/openapi.json(ui:openapi:checkpasses).Scoped to
gate-config/effectiveonly — no other undocumented route is touched.Locally green:
npx vitest run test/unit/openapi.test.ts→ 3/3;tsx scripts/write-ui-openapi.ts --checkpasses; spec.ts coverage 100% lines; eslint clean.