fix(contrail): run sync from compiled dist, not ts-node src#581
Merged
Conversation
The production Docker image only ships dist/; src/ is removed in the release stage (except mail templates). The CronJob's `npm run contrail:sync` was invoking `ts-node ./src/contrail/sync.ts`, which fails immediately in-cluster with "Cannot find module './sync.ts'". Switch the npm script to `node dist/contrail/sync.js`. sync.ts only uses relative imports (no NestJS path aliases), so tsconfig-paths isn't needed. The smoke command stays on ts-node because it's a developer tool run against local TypeScript. Surfaced when manually triggering the suspended contrail-sync CronJob during Phase 1 dev validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dist/;src/is removed in the release stage (exceptsrc/mail/mail-templates).contrail-syncCronJob (suspended; manually triggered today during Phase 1 dev validation) callsnpm run contrail:sync, which wasts-node ./src/contrail/sync.ts— fails immediately withCannot find module './sync.ts'.node dist/contrail/sync.js.sync.tsuses only relative imports, sotsconfig-pathsisn't needed.contrail:smokestays onts-node(developer-local tool, not run in-cluster).Why this wasn't caught in #580
src/andts-nodeexist, so the bug was invisible.migration:run:prodandseed:run:prodshare the same shape but are run from developer hosts (seeCLAUDE.md), so they aren't exercised in-cluster.contrail-syncis the first script of this shape that actually runs as a Kubernetes Job.Test plan
contrail-syncCronJob in dev:kubectl create job --from=cronjob/contrail-sync contrail-sync-manual -n dev=== Contrail sync (schema=contrail) ===followed by Discovery + Backfill output.curl 'https://api-dev.openmeet.net/xrpc/net.openmeet.event.listRecords?sort=rsvpsCount&limit=3'returns real records (was empty before).