Description
PR #7067 introduced auto-generated TypeScript types from the backend OpenAPI spec via npm run generate:types. The pipeline:
- scripts/dump-openapi.js boots the app, extracts the live OpenAPI spec → openapi.json
- openapi-typescript converts that into
frontend/src/types/generated.ts
The generated types are committed, but there is no automated check to ensure they stay in sync with the backend. If someone changes a backend schema without re-running npm run generate:types, generated.ts silently drifts from the actual API.
As noted in this discussion:
"we need to find a way, maybe through CI, to have this run/checked if it's in sync with the backend. I'm not to be trusted to remember to keep them in sync and I think we should expect anyone to."
Requirement
Add a CI job that:
- Runs npm run generate:types (boots the app, dumps the OpenAPI spec, regenerates generated.ts)
- Checks for uncommitted changes via
git diff --exit-code frontend/src/types/generated.ts openapi.json
- Fails the build if the committed types don't match what the backend currently produces
Epic/Story
7067
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate
Description
PR #7067 introduced auto-generated TypeScript types from the backend OpenAPI spec via npm run generate:types. The pipeline:
frontend/src/types/generated.tsThe generated types are committed, but there is no automated check to ensure they stay in sync with the backend. If someone changes a backend schema without re-running npm run generate:types, generated.ts silently drifts from the actual API.
As noted in this discussion:
Requirement
Add a CI job that:
git diff --exit-code frontend/src/types/generated.ts openapi.jsonEpic/Story
7067
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate