fix(selfhost): build gittensory-engine before bundling the self-host image - #4034
Merged
Merged
Conversation
…image The self-host Docker build was failing for every open PR: esbuild couldn't resolve "@jsonbored/gittensory-engine" while bundling gittensory-miner's checked-in lib/*.js artifacts (#2281 extracted their reward-risk scoring into this workspace package). Two compounding problems, confirmed by reproducing the failure both locally and in an actual `docker build`: 1. gittensory-engine ships no committed dist/ -- nothing built it before the self-host bundle step ran. 2. The Dockerfile copied only the root package*.json before running `npm ci` (the usual dependency-layer caching trick), so no workspace package.json existed yet for npm to resolve -- it silently skipped every workspace symlink under node_modules, including gittensory-engine's. Building the engine afterward was not enough on its own: esbuild still couldn't find the module at all, only its dist/ would have been missing if the symlink had existed. Fix: copy the full source before `npm ci` (workspace symlinks resolve correctly), then explicitly build gittensory-engine before the self-host bundle step. Verified with an actual `docker build` (both the `build` target alone and the full multi-stage image) against a clean checkout -- fails identically to CI without this change, builds clean with it.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This was referenced Jul 7, 2026
JSONbored
added a commit
that referenced
this pull request
Jul 8, 2026
…4081) (#4084) src/mcp/find-opportunities.ts (since #3986) imports packages/gittensory-miner/lib/ opportunity-fanout.js (committed, pre-built), which imports @jsonbored/gittensory-engine. That package's dist/ is gitignored and only exists after an explicit build step -- Cloudflare's Workers Builds pipeline for gittensory-api runs npm run deploy:api directly with no such step, so wrangler deploy's bundler has failed to resolve the import on every push to main since 487d26a (2026-07-07T09:36:46Z). Mirrors the identical fix already applied to the self-host image build (#4034), the release build (#4063), and the backend test suite (#4036).
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
build + boot smoke testCI job) is currently failing for every open PR: esbuild can't resolve@jsonbored/gittensory-enginewhile bundlinggittensory-miner's checked-inlib/*.jsartifacts (feat(miner-foundation): extract reward-risk scoring into gittensory-engine #2281 extracted their reward-risk scoring into this workspace package).docker build:gittensory-engineships no committeddist/— nothing built it before the self-host bundle step ran.package*.jsonbeforenpm ci(the usual dependency-layer caching trick), so no workspacepackage.jsonexisted yet for npm to resolve — it silently skipped every workspace symlink undernode_modules, includinggittensory-engine's. Building the engine afterward alone wasn't enough: esbuild couldn't find the module at all (not just itsdist/), since the symlink itself never existed.npm ciso workspace symlinks resolve correctly, then explicitly buildgittensory-enginebefore the self-host bundle step runs.Scope
Dockerfile-onlywantedPaths-restricted (build config)Validation
docker build --target buildon a clean checkout oforigin/maindocker build --target build --no-cache— now succeeds (engine builds, self-host bundle builds, sourcemap validates)docker build(build + runtime-base + runtime) — succeeds end to endnpm run typecheck— cleanSafety
site/,CNAME,lovable/, or the changelog