Skip to content

fix(docker): copy retry-prisma-generate.mjs into the image build (unbreaks publish)#4156

Merged
d-cs merged 1 commit into
mainfrom
fix/docker-generate-retry-script
Jul 5, 2026
Merged

fix(docker): copy retry-prisma-generate.mjs into the image build (unbreaks publish)#4156
d-cs merged 1 commit into
mainfrom
fix/docker-generate-retry-script

Conversation

@d-cs

@d-cs d-cs commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Build-blocker hotfix

publish.yml on main is failing to build the image after #4154 merged:

@trigger.dev/database:generate: Error: Cannot find module '/triggerdotdev/scripts/retry-prisma-generate.mjs'
… ERROR: process "/bin/sh -c pnpm run generate" did not complete successfully: exit code: 1

Cause

#4154 (Windows-CI hardening) changed the generate scripts of @trigger.dev/database and @internal/run-ops-database to call node ../../scripts/retry-prisma-generate.mjs. But docker/Dockerfile's builder stage does COPY docker/scripts ./scripts (replacing the scripts dir) and then copies back only the specific root scripts it needs (updateVersion.ts, bundleSdkDocs.ts) before RUN pnpm run generate — the new retry-prisma-generate.mjs wasn't copied, so pnpm run generate can't find it and the image build fails.

publish.yml only runs on push to main (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.mjs

Verification

Built locally with docker build --target builder (the stage that runs pnpm 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.

#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>
@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5e9df90

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@d-cs d-cs self-assigned this Jul 5, 2026
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This 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

File Summary
docker/Dockerfile Added a COPY instruction to include scripts/retry-prisma-generate.mjs in the builder stage.

Related PRs: None identified.

Suggested labels: docker, build

Suggested reviewers: None identified.

Poem
A script hops in before the build,
Copied in, its purpose filled.
Retry logic, tucked with care,
Waiting in the builder's lair.
🐇 Docker layers, one line more.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it misses required template sections like Closes #, checklist, Testing, Changelog, and Screenshots. Add the required template sections: Closes #, checklist items, Testing steps, Changelog summary, and Screenshots or note that none are needed.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately describes the Docker build fix and its impact.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docker-generate-retry-script

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@d-cs d-cs marked this pull request as ready for review July 5, 2026 09:23

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@d-cs

d-cs commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

Verified locally: docker build --target builder -f docker/Dockerfile . now completes clean (exit 0).

  • pnpm run generate — the step that failed in the publish build with Cannot find module '/triggerdotdev/scripts/retry-prisma-generate.mjs' — runs successfully; all 18 turbo tasks pass and the image exports.
  • Root cause: the generate npm scripts in internal-packages/{database,run-ops-database} shell out to scripts/retry-prisma-generate.mjs, but the builder stage never COPYed that file into the image. Adding the single COPY line before RUN pnpm run generate fixes it.

Ready for review.

@d-cs d-cs merged commit b31ded7 into main Jul 5, 2026
25 checks passed
@d-cs d-cs deleted the fix/docker-generate-retry-script branch July 5, 2026 09:33
d-cs added a commit that referenced this pull request Jul 5, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants