chore(selfhost): remove orphaned register-selfhost.mjs Docker entrypoint script - #2937
Conversation
…int script Its own header claimed it was used as the Docker entry via `node --import ./scripts/register-selfhost.mjs dist/server.mjs`, but the Dockerfile CMD has no --import flag, and no other script/doc/workflow step ever invoked it that way -- only a stale CI path filter referenced the file's existence, not its runtime use. Verified empirically rather than just by inspection: rebuilt the self-host bundle with `node scripts/build-selfhost.mjs --all` (the exact mode the Dockerfile's own build step uses) and grepped the resulting fully-bundled dist/server.mjs for any `cloudflare:` string -- zero matches. The build-time esbuild stub plugin (cloudflare:workers / @cloudflare/puppeteer / agents/mcp) already eliminates every reachable cloudflare:* specifier from the actual Docker image, including transitive node_modules internals, so the runtime --import hook this script provided was fully redundant. Removes the script and its stale reference in .github/workflows/selfhost.yml's path filters.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-04 06:07:27 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2937 +/- ##
=======================================
Coverage 96.05% 96.05%
=======================================
Files 259 259
Lines 28461 28461
Branches 10351 10351
=======================================
Hits 27339 27339
Misses 489 489
Partials 633 633 🚀 New features to boost your workflow:
|
Summary
scripts/register-selfhost.mjs's own header comment claimed it was used as the Docker entrypoint vianode --import ./scripts/register-selfhost.mjs dist/server.mjs, providing a runtimenode:moduleresolution hook that stubs anycloudflare:*import. ButDockerfile:68's actualCMDis["node", "dist/server.mjs"]— no--importflag — and no other script, doc, or CI step ever invoked it that way. The only other reference was a stale path filter in.github/workflows/selfhost.ymlthat just triggered the workflow when the file changed, not an actual runtime dependency.Verified empirically before removing, not just by inspection (per this issue's own requirement to confirm the build-time stub actually covers everything the runtime hook covered):
node scripts/build-selfhost.mjs --all— the exact modeDockerfile:19uses (RUN node scripts/build-selfhost.mjs --all), which bundles every dependency (including transitivenode_modulesinternals) into one self-contained file.dist/server.mjsfor the literal stringcloudflare:— zero matches.Since
--allmode traverses and inlines the entire reachable dependency graph, this is a complete check, not a superficial one: if any transitive dependency anywhere had its own internalcloudflare:sockets/cloudflare:email/etc. import, it would have been bundled and shown up in that grep. It didn't. The build-time esbuild plugin (cloudflare:workers→cf-workers-shim.ts,@cloudflare/puppeteer→ a local stub,agents/mcp→ a local stub) already eliminates every reachablecloudflare:*specifier from the actual Docker image, so the runtime--importhook was fully redundant.Resolves #2909. Part of the #1667 self-host review-stack roadmap.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run actionlint— validates the.github/workflows/selfhost.ymlpath-filter editnode scripts/build-selfhost.mjs --all(Dockerfile's exact build invocation) thengrep -c "cloudflare:" dist/server.mjs→0.github/workflows/selfhost.ymland effectivelyDockerfile's own build inputs, so CI's dedicated "build + boot smoke test" job (realdocker buildx build+ container boot +/health//ready//metricschecks) will run and is the authoritative confirmation that the image still boots cleanly without this scriptnpm run test:workers/npm run build:mcp/npm run test:mcp-pack/npm audit/ui:*— not run locally; no worker-pool, MCP-package, or UI files touched. CI runs the full gate.If any required check was skipped, explain why:
test:coverage/test:cinot run locally — this diff is a script deletion + a 2-line CI path-filter removal, zerosrc/**/test/**changes, so there is nothing for Codecov's patch-coverage gate to evaluate. CI's self-host workflow (which WILL run on this PR, since it touches that workflow's own paths) is the real validation for this specific change.Safety