Skip to content

fix(webapp): make SDK bundle-docs build step work in pruned Docker image#3947

Merged
d-cs merged 3 commits into
mainfrom
fix-webapp-docker-sdk-bundle-docs
Jun 15, 2026
Merged

fix(webapp): make SDK bundle-docs build step work in pruned Docker image#3947
d-cs merged 3 commits into
mainfrom
fix-webapp-docker-sdk-bundle-docs

Conversation

@d-cs

@d-cs d-cs commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

The webapp Docker image build runs pnpm run build --filter=webapp..., which builds @trigger.dev/sdk as a dependency. The SDK's build script recently gained a bundle-docs step (tsx ../../scripts/bundleSdkDocs.ts), but the build couldn't run it in the pruned image, breaking the image build.

Two things were missing:

  • docker/Dockerfile copied scripts/updateVersion.ts into the builder stage but not scripts/bundleSdkDocs.ts, so the step failed with ERR_MODULE_NOT_FOUND.
  • Even with the script present, the repo-level docs/ tree it reads is a separate workspace package that isn't in webapp's dependency graph, so turbo prune --scope=webapp excludes it — the script's missing-docs guard would then fail the build.

Design

The Dockerfile now copies bundleSdkDocs.ts alongside updateVersion.ts. bundleSdkDocs.ts skips gracefully when the repo docs/ tree is absent, which is exactly the pruned-dependency-build case (the SDK is compiled there but never published). Publishing always runs from the full monorepo where docs/ exists, so the missing-docs guard still protects releases — it only fires when docs/ is present but a cited doc is genuinely missing, rather than when the whole tree was pruned away. This avoids dragging 27M of docs into a throwaway builder stage.

Test plan

  • bundle-docs from the full monorepo still bundles all cited docs (exit 0)
  • Simulated pruned tree without docs/ skips cleanly instead of failing
  • Webapp Docker image build succeeds in CI

The webapp Docker build runs the SDK build as a dependency. The SDK's new
bundle-docs step was not runnable in the pruned image: the script was not
copied into the builder, and the repo docs/ tree it reads is pruned away.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d-cs d-cs self-assigned this Jun 15, 2026
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1d5d948

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

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 64719e6b-ae6d-4de3-aece-dbecfafe5e1a

📥 Commits

Reviewing files that changed from the base of the PR and between f073d87 and 1d5d948.

📒 Files selected for processing (2)
  • docker/Dockerfile
  • scripts/bundleSdkDocs.ts

Walkthrough

scripts/bundleSdkDocs.ts gains an early-exit path: at the start of bundleSdkDocs(), it uses fs.access to check whether the repo-level docs/ directory exists. If the directory is absent, it logs a skip message and returns without executing the manifest collection or bundling logic. docker/Dockerfile adds a COPY instruction in the builder stage to copy scripts/bundleSdkDocs.ts into the container, making it available for the subsequent pnpm run generate and build steps.

✨ 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-webapp-docker-sdk-bundle-docs

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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 and usage tips.

@d-cs d-cs marked this pull request as ready for review June 15, 2026 10:42
d-cs and others added 2 commits June 15, 2026 11:43
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d-cs d-cs enabled auto-merge (squash) June 15, 2026 10:54
@d-cs d-cs merged commit b7ef51d into main Jun 15, 2026
17 of 18 checks passed
@d-cs d-cs deleted the fix-webapp-docker-sdk-bundle-docs branch June 15, 2026 10:59
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