fix(ci): bust Cloudflare.Vite memo so prod tracks main#27
Merged
cooper (czxtm) merged 1 commit intomainfrom May 1, 2026
Merged
fix(ci): bust Cloudflare.Vite memo so prod tracks main#27cooper (czxtm) merged 1 commit intomainfrom
cooper (czxtm) merged 1 commit intomainfrom
Conversation
apps/web uses alchemy's Cloudflare.Vite, which content-hashes the Worker's working directory (apps/web/) to decide whether a rebuild + upload is needed. Workspace dependencies under packages/** (@stackpanel/api, @stackpanel/auth, @stackpanel/db, …) live outside that scope, so a push-to-main that only touches those packages hashes identically to the last deploy and alchemy short-circuits with "no change" — silently skipping the Vite build and the Worker upload. Evidence: the PR #25 merge (run 25216266546, sha 86bd256) completed the "Deploy" step in ~10s with no Vite output and printed "✓ TanstackStart (Cloudflare.Worker) no change", whereas the PR #23 merge (run 25207387008) — which did touch apps/web/ — ran the full Vite build and uploaded a 28.20 MB worker. As a result, stackpanel.com is still running whatever bundle the last apps/web/-touching commit deployed, not `main`. Fix: write a SHA-stamped .build-info file inside apps/web/ before alchemy deploy. The file sits inside the default memo scope (and is *not* gitignored — doing so would make the default exclude rules filter it out), so every CI run produces a fresh hash and alchemy is forced to rebuild + upload. The file is ephemeral on the CI runner. docs/ and api/ are unaffected — docs already pre-builds with `bun run build:worker` and uses Cloudflare.Worker (hash = main bundle bytes, naturally covers upstream changes), and api has a separate open failure unrelated to the memo.
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 1ccea00. Configure here. |
Contributor
|
Preview |
5 tasks
cooper (czxtm)
pushed a commit
that referenced
this pull request
May 2, 2026
Every link on stackpanel.com pointing under `/docs/*` (Quick start, Why
Stackpanel, Changelog, Stacks, License, …) currently returns HTTP 503
with `{"error":"DOCS_PROXY_URL environment variable is not configured"}`.
The proxy route at `apps/web/src/routes/docs/$.ts` + `index.ts` reads
`process.env.DOCS_PROXY_URL` and short-circuits with that 503 when the
binding is missing.
Root cause: the proxy was added on 2026-04-23 (74fca2e "Make environment
variables required by default") but `apps/web/alchemy.run.ts` was never
updated to forward the URL into `Cloudflare.Vite({ env })`. The recent
`feat(env): build-time secret injection` commit established the env-
forwarding pattern for `BETTER_AUTH_SECRET` + Polar values but didn't
include this one. So the binding has been absent on every deploy since
the route landed — the docs site itself (`docs.stackpanel.com`) is
healthy, only the apex proxy is broken.
Fix: derive `DOCS_PROXY_URL` per stage to mirror `hostnameFor` in
`apps/docs/alchemy.run.ts` (production → docs.stackpanel.com,
staging → docs.staging.stackpanel.com), and forward it through the same
`Cloudflare.Vite({ env })` block the secrets use. PR previews and dev
fall back to the production docs site since we don't deploy per-PR
docs workers; serving real content is preferable to 503'ing.
The CI memo-bust from PR #27 (.build-info stamp) will force a fresh
upload on push so this actually reaches the deployed Worker.
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
Fixes
stackpanel.comsilently laggingmainwhen a merge touches onlypackages/**(e.g.@stackpanel/api,@stackpanel/auth,@stackpanel/db).apps/webuses alchemy'sCloudflare.Vite, which content-hashes the Worker's working directory (apps/web/) to decide whether a rebuild + upload is needed. Workspace dependencies underpackages/**live outside that scope, so a push-to-mainthat only touches those packages hashes identically to the last deploy and alchemy short-circuits with "no change" — silently skipping the Vite build and the Worker upload. The apex stays frozen on whichever commit last happened to touchapps/web/.Evidence
25207387008, shab8cccf75) — touchedapps/web/→ ran Vite build + uploaded a 28.20 MB worker. ✅25216266546, sha86bd256b) — touched onlypackages/db/**,packages/auth/**→Deploystep completed in ~10s with zero Vite output and printed✓ TanstackStart (Cloudflare.Worker) no change. ❌As of now,
stackpanel.comserves the bundle from the PR #23 merge — PR #25's runtime-migration changes never reached prod.Fix
Stamp a
.build-infofile insideapps/web/(containing the commit SHA + refs) beforealchemy deploy. The file sits inside the default memo scope and is not gitignored — so every CI run produces a fresh hash and alchemy is forced to rebuild + upload. Ephemeral on the runner; no secrets.Leaves
Cloudflare.Viteand thememoscope alone — minimum blast radius, matches the existing CI pattern of "stage resolution → install → deploy".docs/andapi/are untouched:docs/already pre-builds withbun run build:worker+Cloudflare.Worker(hash = main bundle bytes, naturally covers upstream changes) — verified live-deployed on the PR feat(db): apply file-based Drizzle migrations programmatically at startup #25 merge (31.07 MB upload).api/deploys have been failing since 2026-04-29 withCannot find module '@stackpanel/infra/lib/deploy' from apps/api/alchemy.run.ts— unrelated to this fix; filed separately.Test plan
Deploy Webrun onmain→ confirm the step shows Vite build output and✓ TanstackStart (Cloudflare.Worker) updatedwithUploading worker (XX MB).curl -sI https://stackpanel.com/→ confirm newcf-rayand a response served by the fresh Worker.curl -sS -X POST 'https://stackpanel.com/api/trpc/waitlist.join?batch=1' -H 'content-type: application/json' -d '{"0":{"json":{"email":"test@example.invalid"}}}'no longer returns the default-secret 500.