Repository navigation
fix(ci): smoke tests the head commit's preview, not the previous build - #295
Merged
Merged
Conversation
Cloudflare rewrites one comment per Worker in place, so between a push and that build finishing it still names the previous commit, and the address beside it is that build's. Discovery read the first workers.dev host in the comment and took it. The `Smoke (web)` lane on c221df7 therefore tested b60f0ac's deployment: five specs failed on routes the commit adds, and a head that commit emitted three times went unseen. Discovery now reads the comment's `Latest Commit` cell and skips a comment naming any other commit, so the 12-minute window is spent waiting for this commit's build rather than measuring the last one. A comment that names no commit is still accepted: the column is Cloudflare's to rename, and no address at all stops the lane. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWDpubJYs3RkxjCw1u
The unit lane covered discovery's helpers and none of its flow: `fromPrComments`, `discoverUrl`, `main` and `waitReachable` ran only inside a CI job, which is how a smoke lane measuring the previous build went unnoticed. The fixture is the web Worker's comment on #284, as Cloudflare wrote it. Job 135332006782 ran on 01947eb while that comment still named d3499ab and selected d3499ab's 37de6e0a address. The flow tests pin that such a row is never taken: discovery falls through to the check run GitHub serves for the head commit, keeps polling while the row is stale, takes the row once it names the head, and reports none rather than probing the stale address when the window closes. Four of them fail with the commit check removed. The script exports the four functions; nothing else in it changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`Smoke (ladle)` decides whether a push owes it a `wemeditate-design` preview by matching the changed files against WATCH. WATCH still named `server/cms-types`, which #131 renamed `server/sahajcloud-types.ts`, so the one server module components, hooks and lib import at runtime was outside it, and the docs' copy of the list said the same. A guard now resolves every value import from the trees Ladle builds, follows it through `server/`, and requires WATCH to match each module it reaches. It fails on the old pattern. The Cloudflare build triggers hold the same stale path and are not in this repo; the docs say so beside the list. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`pages/_error/+Page.tsx` reads `PUBLIC__STATUS_PAGE_URL` through `import.meta.env`, which Vite inlines at build time from `.env.production`. The URL was only in `wrangler.toml`'s `[vars]`, which bind to the running Worker and are read by nothing, so the deployed error page compiled `statusPageUrl` as `undefined` and never offered the status page. The URL moves to `.env.production`, and the dead `[vars]` copy goes: nothing reads a `PUBLIC__` binding at runtime, and a second copy is what made this look configured. `.env.example` now says where production's value comes from, as it does for the SahajCloud URL. A guard requires the status URL in `.env.production` and every `PUBLIC__` entry in `[vars]` to be there with the same value. Both cases fail on the previous files. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`scripts/chrome-debug.sh` ran `pkill -f "Google Chrome"` before each launch, which closed every Chrome on the machine: the user's own browser, and any debug Chrome another session was driving. AGENTS.md forbids stopping either. The script now never stops anything. When the port is taken it reuses it only if Chrome's debugger answers there, and otherwise refuses with a hint to pass another port. When a Chrome already holds the debug profile without that port open, it refuses too, since the launch would hand over to that process and the port would never open; the pkill existed to clear exactly that case. A guard fails on any `pkill`, `killall` or `kill` command in a script under `scripts/`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`getSahajCloudContext` filled a missing `PUBLIC__SAHAJCLOUD_URL` with `http://localhost:3000` in every build. A production Worker cannot reach that, so a deploy built without the URL would have sent every read there and reported a network outage on each page, never the missing variable. The fallback now applies in development only. Elsewhere the context schema refuses the read on first use with `baseURL: PUBLIC__SAHAJCLOUD_URL is not set in this build`, which the config read propagates to the error page. It is a first-request error rather than a build failure because the schema already owns every other configuration refusal, and `.env.production` carries the value for every Cloudflare build. These are the module's first tests: the embedded URL, the development fallback, the production refusal (which fails on the old code), a malformed URL, a missing key, and the Worker secret winning inside a request. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The comment above `PUBLIC__SAHAJCLOUD_URL` says its value is also in wrangler.toml [vars], which is no longer true of the status page URL now that [vars] dropped it. Give that value its own group. The production-env guard also required wrangler.toml to keep at least one PUBLIC__ entry in [vars], though those entries are read by nothing, so removing the last dead one would have failed it. It now accepts an empty table and instead throws on a PUBLIC__ line it cannot parse, which is what the length check was standing in for. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`curl -s` exits 0 on any HTTP answer, a 404 included, so a web server on the requested port was reported as a running Chrome and the script exited 0 without launching. Only a DevTools endpoint's /json/version names a webSocketDebuggerUrl, so require that instead. Checked with a stubbed copy of the script: a plain `python3 -m http.server` on the port now refuses with exit 1, and a server returning a DevTools-shaped /json/version is still reused with exit 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
…dflare Two corrections to what the CI doc and ci.yml say. The `Workers Builds: <worker>` check run does name a preview: its output.summary carries `Preview URL: https://<version>-<worker>...` for that commit's own build (01947eb shows fbf316a0-wemeditate-web and 6240d24f-wemeditate-design). Since discovery now refuses a comment that names an earlier commit, that check run is the fallback it reaches, so the claim that it carries no address, and the ci.yml comment that `checks: read` serves only a dashboard link, invited someone to drop the permission as dead. The ladle WATCH list now names server/sahajcloud-types while both Cloudflare triggers still name server/cms-types. Until the dashboard is edited, a push touching only that file passes WATCH but gets no Ladle build, and Smoke (ladle) ends on the derived branch host: the previous Ladle build, so green without testing the change, or red if the branch never had one. The note now says that rather than only "waits". Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Ardnived
approved these changes
Nov 19, 2026
Contributor
Author
|
🤖 no session running Written by the sydevs dispatcher. Sessions never edit this comment. |
This was referenced Nov 19, 2026
Open
sydevs-bot
pushed a commit
that referenced
this pull request
Nov 20, 2026
Fixes the red `Smoke (web)`: `/zz/map should 404: expected 200 to be 404`, and the same for `/zz/meditations/<id>`. The smoke job runs the spec from the merge ref but fetches the preview Cloudflare built from this branch's head (#295). `main` carries both halves of #315 — the matchers that stop an unknown prefix minting a second address, and the smoke spec that pins it — while this head carried only the spec's absence. Bringing the base in puts the matchers on the head the preview is built from, so there is nothing else to fix here. Base merged clean. Lean gate green: lint, `tsc --noEmit`, 1482 tests in 150 files, `pages/onBeforeRoute.test.ts` among them. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXMjw8p5ZyKppLjncT
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
Smoke (web)andSmoke (ladle)lanes now test only a preview built from the commit under test. Before, while Cloudflare was rebuilding, discovery took the address in the bot comment for the previous build. The lane then reported failures on routes the commit adds, and missed what the commit broke.server/sahajcloud-types.tsnow counts as a Ladle change in CI. Before,WATCHstill namedcms-types, the name that module had before refactor: use SahajCloud, not CMS, as the backend's name in code #131.wrangler.toml[vars], which the build never reads, so production compiled it asundefined.scripts/chrome-debug.shno longer kills every Chrome on the machine before it launches. When the port is taken, it reuses a real DevTools endpoint or refuses to start.PUBLIC__SAHAJCLOUD_URLnow fails on its first SahajCloud read, with a message that names the variable. Before, it quietly read fromhttp://localhost:3000.Merge prerequisite (outside this repo): both Workers Builds triggers on the
wemeditate-designWorker (themainone and the preview-branch one) still includeserver/cms-types*. Change that toserver/sahajcloud-types*in the Cloudflare dashboard before or with this merge. Until then, CI'sWATCHlist is wider than the trigger. A push that touches onlyserver/sahajcloud-types.tsgets no Ladle build, soSmoke (ladle)waits 12 minutes and then tests the branch alias. That alias serves the previous Ladle build, so the lane goes green without testing the change. On a branch that never had a Ladle build, it goes red. The ⚠ note indocs/cloudflare-previews-ci.mddescribes this. Delete the note once the triggers are fixed.Findings addressed
37de6e0awhile the head was01947eb6. TheWorkers Buildscheck run ond3499ab5shows that37de6e0awas that earlier commit's build. Cloudflare's bot posts one comment per Worker and edits it in place, so between a push and the end of the build the comment still names the old commit.Fix: commit c8c853a is 91fa2f4 from feat(seo): share metadata and JSON-LD at parity with the old site #282, cherry-picked unchanged with its authorship kept.
namesCommit(scripts/get-cloudflare-preview-url.mjs:115) refuses any bot row whose commit cell names a different commit thanPR_HEAD_SHA, and discovery keeps polling within its existing window. The only other script change is four names added to the export block.Tests:
tests/guards/preview-discovery.test.ts, "discovery against a pull request whose preview is mid-rebuild" (7 flow tests). The fixtures are built from the real Cloudflare comment on feat(components): skip link, nav names, page titles and an axe gate #284 (wemeditate-web | 01947eb6 | …fbf316a0-wemeditate-web…) and the real check-run summary. They cover:d3499ab5row is never taken;mainkeeps polling until the row changes;waitReachable;With
namesCommitdisabled, 4 of them fail..github/workflows/ci.yml:109WATCHnow saysserver/(sahajcloud-types|error-utils), and the Include list indocs/cloudflare-previews-ci.md:77matches it.tests/guards/ladle-watch-paths.test.tsfollows every value import fromcomponents,hooks,lib,layoutsand.ladleintoserver/, and requires theWATCHregex read fromci.ymlto match each module it reaches. On main'sci.ymlit fails, namingserver/sahajcloud-types.ts.curl https://wemeditate-web.contact-c66.workers.dev/this-page-does-not-exist-ci-checkreturns 404 with nouptimerobotlink on the page.pages/_error/+Page.tsx:16readsimport.meta.env.PUBLIC__STATUS_PAGE_URL, which Vite inlines at build time from.env.productionand never from[vars]..env.production:14, with its own comment. The dead copy inwrangler.toml[vars]is gone, since no code reads aPUBLIC__binding from the running Worker..env.examplenow says where production's value comes from. A localpnpm buildinlines the URL into both the server and client error bundles.tests/guards/production-env.test.ts. The URL must passisSafeHttpUrl, and everyPUBLIC__entry in[vars]must appear in.env.productionwith the same value. An empty[vars]is accepted, and aPUBLIC__line the guard cannot parse makes it throw. Both tests fail on main's files.pkillon Chrome.scripts/chrome-debug.shkills nothing now./json/versionnameswebSocketDebuggerUrl, line 23), the script reuses it.python3 -m http.serveron the port is refused with exit 1, and a server that answers like DevTools is reused with exit 0.tests/guards/script-process-kills.test.tsfails on anypkill,killallorkillcommand inscripts/**/*.sh. On main it fails, naming thepkillline.server/sahajcloud-context.ts:80falls back tohttp://localhost:3000only whenimport.meta.env.DEVis true. Otherwise the schema field at line 43 throwsPUBLIC__SAHAJCLOUD_URL is not set in this build, and that error reaches the error page.server/sahajcloud-context.test.tsholds the module's first 6 tests. "refuses a production build that names no SahajCloud" fails on main's code.docs/cloudflare-previews-ci.md:32-39and thechecks: readcomment atci.yml:18said the check run never carries a preview URL. That is wrong: the check-run summary on01947eb6containsPreview URL: https://fbf316a0-wemeditate-web.contact-c66.workers.devand…6240d24f-wemeditate-design…. This check run is now the fallback F1 relies on, so both texts now say it carries the commit's own preview.Not in this PR
wemeditate-designBuilds trigger path still has to change fromserver/cms-types*toserver/sahajcloud-types*on both triggers. See the merge prerequisite above. It is dashboard configuration, and this run had no Cloudflare credentials..claude/workflow.json:31still tells readers to useserver/cms-types.ts, which should readserver/sahajcloud-types.ts. That path is protected, so an unattended run could not edit it.Reconciled with open PRs
.env.production(from line 22) and inserts[[routes]]before[vars]inwrangler.toml. This PR inserts lines underPUBLIC__SAHAJCLOUD_URLand deletes one line inside[vars]. The trial merge is clean, and the production-env guard passes on the merged tree.tryGetContextatserver/sahajcloud-context.ts:51. This PR edits the schema, the docblock and thebaseURLline around it, and the merge is clean.git merge-tree --write-treeof this head against all eight open PR branches reports no conflicts: feat(server): legacy redirect map and lookup for the wemeditate.com cutover #276, feat(seo): share metadata and JSON-LD at parity with the old site #282, feat(components): add a mobile menu, and make the compact bar the phone's header #283, feat(player): move VideoPlayer from Vidstack to Video.js 10 #285, feat(server): switch wemeditate.com over to the new site #288, feat(preview): stream unsaved lecture edits into the preview panel #290, chore(contracts): re-sync copied contracts from SahajCloud #292 and feat(components): a MeditationLibrary for the meditations index block #293.Test results
.claude/skills/pr-prep/check.shon the pushed head:no-consoleon theskipping … names another commitline from the cherry-picked 91fa2f4, kept verbatim. Lines written for this PR add no warnings.This bundle is not marked BUILD. An earlier
pnpm buildon this branch, run because server and env files changed, passed. Nothing on the build path changed after that.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw