feat(pwa): run app.moshcode.sh on Bun instead of Node - #552
Merged
Merged
Conversation
Only the PWA container's runtime changes. The CLI stays a Node/pnpm product and apps/pwa keeps its package-lock, so the image still installs with `npm ci`: - Dockerfile: a node:22-slim deps stage (npm ci, as before), then a Debian 12 runtime (node:22-slim's base) with Bun's single binary and no node, running `bun apps/pwa/src/server.mjs` as uid 1000 with --chown (dev2's checkout is group-only), HEALTHCHECK on /healthz. Port, env and /healthz unchanged. - server.mjs: SIGTERM/SIGINT handler (PID 1), so `docker stop` no longer waits 10 s. - moshpit-gateway-host test: the assertion that pins undici's fetch() dropping a caller-supplied Host is skipped under Bun, whose fetch() keeps it; the gateway's own http.request path stays covered. Still 5/5 under node --test. - CI (pwa on bun): every PWA test file under Bun, one process per file, plus a boot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan0 finding(s) in the 4 file(s) this pull request changes. Nothing in the files this pull request changes. 104 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 85 | **LOW**: 11Not introduced by this pull request. The full set is in the Security tab.
…and 84 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
ralyodio
marked this pull request as ready for review
October 1, 2026 16:30
…tests seed 5000 names) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
This PR moves the app.moshcode.sh container (
apps/pwa) from Node to Bun. It is part of the fleet-wide Node → Bun migration, and only the PWA's production runtime changes. The CLI stays a Node/pnpm product, andapps/pwakeeps itspackage-lock.json, so the image still installs withnpm ciand no lockfile changes. There is no npm/CLI release:publish.ymlpublishes the CLI on a GitHub release, and nothing in the CLI changed.Changes
node:22-slimstage still runsnpm ci, exactly as before. The runtime is now Debian 12 (node:22-slim's base) with Bun's single binary and no node. It runsbun apps/pwa/src/server.mjsas uid 1000, with--chownbecause dev2's checkout is group-only, and has a HEALTHCHECK on/healthz. Port, env and/healthzare unchanged.server.mjs: adds a SIGTERM/SIGINT handler. The server is PID 1, sodocker stopno longer waits 10 s; it now stops in 0.3 s.moshpit-gateway-hosttest: one assertion pins undici'sfetch()dropping a caller-suppliedHostheader, which is the defect the gateway'shttp.requestpath works around. Under Bun that assertion is skipped, because Bun'sfetch()keeps the header. The gateway path itself stays covered, and the file still passes 5/5 undernode --test.pwa on bunworkflow runs every PWA test file under Bun, one process per file, and then boots the server.Verified locally
/healthz,/manifest.webmanifest,/sw.js,/passkey.js,/push.js, both.well-knowndescriptors, the 401 and 404 responses, and the other routes I sampled are byte-identical to the live Node site./differs only by its per-render CSRF token.🤖 Generated with Claude Code