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. |
|
Preview |
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.