Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This file records what changes **in the product** – process and session state
### Changed
- The AI service's Vercel project builds only when something under `services/ai/` changed: fewer images in its
container registry and fewer builds. A redeploy after changing its variables must not be skipped (runbook §3.6) (#98).
- The AI service project deploys only from `main`: pull-request branches create no AI deployment at all, so
they no longer use up the Vercel plan's deployment limits (runbook §3.7) (#104).
- A unit correction is stored like the extraction stores units: „Stk.“, „Stück“ or „Meter“ become the ERP units
`pcs` and `m`; other units stay as typed. The correction field shows „Stk.“, and the audit event keeps what
was typed (#96).
Expand Down
13 changes: 11 additions & 2 deletions docs/technical/deployment-vercel.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ creation). The script is all-or-nothing; running it twice fails on "role already
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
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, so an AI preview may be missing there
(production is not affected). **A redeploy runs the same step:** after changing a variable of
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
`requestflow-ai` (§9), redeploy without the Ignored Build Step (untick it in the Redeploy dialog if offered)
and check that the deployment reaches **Ready** – `CANCELED` means the new value is not active.
Every build pushes an image to the project's container registry, which has a maximum number of images on
Expand All @@ -87,6 +87,15 @@ creation). The script is all-or-nothing; running it twice fails on "role already
`vercel vcr image ls dockerfile --project requestflow-ai` and
`vercel vcr image rm dockerfile <image-id> --project requestflow-ai`), keeping the image of the current
production deployment and one rollback candidate. Deleting an image is permanent.
7. **Only `main` deploys (#104):** `services/ai/vercel.json` sets `git.deploymentEnabled` to
`{ "**": false, "main": true }` – a push to any other branch (every PR) creates **no** `requestflow-ai`
deployment at all, not even a skipped one, so PRs no longer use up the plan's deployment limits. When
several patterns match, `true` wins; `**` also covers branch names with `/` (minimatch). A merge to `main`
that touches `services/ai/` still deploys production (step 6 decides whether it builds). The setting gates
only deployments triggered by a Git push – a redeploy from the dashboard (§9) still works. No AI preview is
needed: CI builds the image and checks `/healthz` on AI-image changes (#79), and web previews do not call
the AI service (§4: Preview variables stay empty). The preview protection of step 2 only matters if Git
deployments of other branches are ever switched back on.

## 4. Vercel project

Expand Down
8 changes: 7 additions & 1 deletion services/ai/vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"$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 -- ./",
"git": {
"deploymentEnabled": {
"**": false,
"main": true
}
}
}
Loading