fix(docker): copy retry-prisma-generate.mjs into the image build (unbreaks publish)#4156
Conversation
#4154 changed the @trigger.dev/database and @internal/run-ops-database generate scripts to call ../../scripts/retry-prisma-generate.mjs, but the builder stage replaces ./scripts with docker/scripts and only copies back specific root scripts — so the image build failed with 'Cannot find module /triggerdotdev/scripts/retry-prisma-generate.mjs' at 'pnpm run generate'. Copy the retry script too. (publish.yml only runs on push to main, so this wasn't caught in the PR CI.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
WalkthroughThis change adds a single line to the Docker builder stage that copies the scripts/retry-prisma-generate.mjs file into the image, positioned before the existing pnpm run generate command in the build process. Changes
Related PRs: None identified. Suggested labels: docker, build Suggested reviewers: None identified. Poem 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Verified locally:
Ready for review. |
…4157) ## What Adds the missing `COPY scripts/retry-prisma-generate.mjs` to the supervisor `Containerfile` builder stage, before `RUN pnpm run generate`. ## Why The `generate` scripts in `internal-packages/database` and `internal-packages/run-ops-database` shell out to `scripts/retry-prisma-generate.mjs`. The supervisor build never copied that file into the image, so `pnpm run generate` failed: ``` @internal/run-ops-database:generate: Error: Cannot find module '/app/scripts/retry-prisma-generate.mjs' ``` This is the same failure class as #4156 (webapp Dockerfile). The supervisor `Containerfile` is the **only other** build file that runs `pnpm run generate` — the coordinator / docker-provider / kubernetes-provider Containerfiles don't, so this completes the fix. ## Verification Local `docker build` of the supervisor `Containerfile` builder target — result appended below once the build completes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Build-blocker hotfix
publish.ymlonmainis failing to build the image after #4154 merged:Cause
#4154 (Windows-CI hardening) changed the
generatescripts of@trigger.dev/databaseand@internal/run-ops-databaseto callnode ../../scripts/retry-prisma-generate.mjs. Butdocker/Dockerfile'sbuilderstage doesCOPY docker/scripts ./scripts(replacing the scripts dir) and then copies back only the specific root scripts it needs (updateVersion.ts,bundleSdkDocs.ts) beforeRUN pnpm run generate— the newretry-prisma-generate.mjswasn't copied, sopnpm run generatecan't find it and the image build fails.publish.ymlonly runs on push tomain(not on PRs), so #4154's PR CI never built the image and this slipped through.Fix
One line — copy the retry script alongside the other root scripts before the generate step:
COPY --chown=node:node scripts/retry-prisma-generate.mjs scripts/retry-prisma-generate.mjsVerification
Built locally with
docker build --target builder(the stage that runspnpm run generate) to confirm the generate step now passes — result appended once it finishes.No changeset /
.server-changes— Dockerfile/build-only change, no package or server-runtime change.