fix: run AI catalog sync as standalone script to avoid DB dependency (#18853)
## Summary - The `ci-ai-catalog-sync` cron workflow was failing because the `ai:sync-models-dev` NestJS command bootstraps the full app, which tries to connect to PostgreSQL — unavailable in CI. - Converted the sync logic to a standalone `ts-node` script (`scripts/ai-sync-models-dev.ts`) that runs without NestJS, eliminating the database dependency. - Removed the `Build twenty-server` step from the workflow since it's no longer needed, making the job faster. ## Test plan - [x] Verified the standalone script runs successfully locally via `npx nx run twenty-server:ts-node-no-deps-transpile-only -- ./scripts/ai-sync-models-dev.ts` - [x] Verified `--dry-run` flag works correctly - [x] Verified the output `ai-providers.json` is correctly written with valid JSON (135 models across 5 providers) - [x] Verified the script passes linting with zero errors - [ ] CI should pass without requiring a database service Fixes: https://github.com/twentyhq/twenty/actions/runs/23424202182/job/68135439740 Made with [Cursor](https://cursor.com)
This commit is contained in:
@@ -27,11 +27,8 @@ jobs:
|
||||
- name: Build dependencies
|
||||
run: npx nx build twenty-shared
|
||||
|
||||
- name: Build twenty-server
|
||||
run: npx nx build twenty-server
|
||||
|
||||
- name: Run catalog sync
|
||||
run: npx nx run twenty-server:command-no-deps ai:sync-models-dev
|
||||
run: npx nx run twenty-server:ts-node-no-deps-transpile-only -- ./scripts/ai-sync-models-dev.ts
|
||||
|
||||
- name: Check for changes
|
||||
id: changes
|
||||
|
||||
Reference in New Issue
Block a user