From aa1e54dec0c97c957fab742b8e7806447d9da431 Mon Sep 17 00:00:00 2001 From: Fluory Date: Mon, 12 Oct 2026 01:19:30 +0200 Subject: [PATCH] fix(deploy): AI ignoreCommand builds on git errors instead of failing (#119) Vercel fails a deployment on any exit code other than 0/1. In the shallow clone the last deployed commit is missing, git diff exits 128 and every main deployment of requestflow-ai ended as Error. Map errors to exit 1. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 ++ docs/technical/deployment-vercel.md | 4 +++- services/ai/vercel.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ba4ac..d5663a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ This file records what changes **in the product** – process and session state such leftovers. An approved sample whose export failed is kept (#84). ### Fixed +- AI service deployments from `main` no longer end as Error when the last deployed commit is missing from + Vercel's shallow clone: the Ignored Build Step now builds on any git error instead of failing (#119). - The review page's header fields fit their card at 1280 px: „Quelle anzeigen“ moved under the status, so the „Speichern“ button of a correction is no longer scrolled out of sight (#103). - Two `pnpm seed:samples` runs for the same company at the same time no longer interfere: the second waits for diff --git a/docs/technical/deployment-vercel.md b/docs/technical/deployment-vercel.md index c72f169..802f7cb 100644 --- a/docs/technical/deployment-vercel.md +++ b/docs/technical/deployment-vercel.md @@ -75,7 +75,9 @@ creation). The script is all-or-nothing; running it twice fails on "role already verified 2026-09-27); the first call after that pays a cold start (measured about 5.6 s). 6. **Builds only when the service changed (#98):** `services/ai/vercel.json` sets an `ignoreCommand` that skips the build unless something under `services/ai/` changed since the last successful deployment - (`VERCEL_GIT_PREVIOUS_SHA`, else the parent commit; if git cannot compare, it builds). A skipped build + (`VERCEL_GIT_PREVIOUS_SHA`, else the parent commit). Vercel skips only on exit 0 and fails the deployment on + any code other than 0 or 1, so every git error (e.g. the previous commit is not in the shallow clone) is mapped + to exit 1 and the service builds (#119). A skipped build ends as `CANCELED`; skipped builds may still count against the plan's deployment limits. A new branch without a successful AI deployment compares only its last commit (since #104 only `main` deploys, see step 7). **A redeploy runs the same step:** after changing a variable of diff --git a/services/ai/vercel.json b/services/ai/vercel.json index 9047d94..ad435e2 100644 --- a/services/ai/vercel.json +++ b/services/ai/vercel.json @@ -1,7 +1,7 @@ { "$schema": "https://openapi.vercel.sh/vercel.json", "regions": ["fra1"], - "ignoreCommand": "git diff --quiet \"${VERCEL_GIT_PREVIOUS_SHA:-HEAD^}\" HEAD -- ./", + "ignoreCommand": "git diff --quiet \"${VERCEL_GIT_PREVIOUS_SHA:-HEAD^}\" HEAD -- ./ 2>/dev/null || exit 1", "git": { "deploymentEnabled": { "**": false,