From 43ea19c8c466fad960657e2ee54fe8ca9b36f9aa Mon Sep 17 00:00:00 2001 From: Fabio Wakim Trentini Date: Wed, 13 May 2026 23:21:15 -0300 Subject: [PATCH] fix(ingest): accept SSH-style remote_url (git@host:path) in payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The schema validated `remote_url` with Zod's `.url()`, which only accepts WHATWG URLs (scheme://...). The CLI's new \`remote_url\` plumbing (#48 / v1.0.7) sends whatever \`git remote get-url origin\` returns; on machines configured with SSH that's \`git@github.com:org/repo.git\` — no scheme, rejected by Zod with: "remote_url":["Invalid URL"] So the v1.0.7 CLI sends the value as intended, the server rejects the whole push, and \`repositories.remote_url\` stays NULL — defeating the fix entirely on SSH-configured machines. Relax the schema to `z.string().min(1).optional()`. The value is informational metadata: it never gets fetched, never embedded as HTML, only normalized via `normalizeRepoSlug` for DORA matching (which already understands the SSH form: `^git@([^:]+):` → `host/$1`). Co-Authored-By: Claude Opus 4.7 (1M context) --- platform/src/app/api/ingest/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/src/app/api/ingest/route.ts b/platform/src/app/api/ingest/route.ts index 2b143b7..7930e6d 100644 --- a/platform/src/app/api/ingest/route.ts +++ b/platform/src/app/api/ingest/route.ts @@ -13,7 +13,11 @@ export const maxDuration = 60; */ const ingestSchema = z.object({ repository: z.string().min(1), - remote_url: z.string().url().optional(), + // Accept any non-empty string — git remote URLs come in shapes that + // Zod's `.url()` rejects (most notably the SSH `git@host:org/repo.git` + // form, which has no scheme). The value is informational metadata + // normalized via `normalizeRepoSlug` downstream; we don't fetch it. + remote_url: z.string().min(1).optional(), window_days: z.number().int().positive().default(90), cli_version: z.string().optional(), github_user: z.string().optional(),