CI: guard against generated frontend api.ts drift #680
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Recurring concern across PR #673 and PR #679 (Tobias/DevOps): when a backend model or endpoint changes,
frontend/src/lib/generated/api.tsmust be regenerated vianpm run generate:api. In the import-migration phase work this file has repeatedly been hand-edited (no dev backend available in the isolated worktrees) to match the backend, and the only verification has been manual reading + reviewer cross-checks. There is no CI gate that fails when the committedapi.tsdrifts from whatgenerate:apiwould produce.Why it matters
A silent drift (a hand-edit that doesn't match the real OpenAPI output) ships type lies to the frontend — the exact failure mode that nearly bit #673.
Suggested approach
generate:apineeds the OpenAPI spec — options:devprofile in CI (heavier), runnpm run generate:api, thengit diff --exit-code frontend/src/lib/generated/api.ts; oropenapi.jsonas an artifact, and runopenapi-typescriptagainst that file in the frontend job (no running backend needed), then diff.Out of scope / notes