Repository navigation
fix(ci): repair preview Workers left without preview URLs - #1030
Merged
Merged
Conversation
A new preview Worker's first wrangler deploy now fails with Cloudflare code 10007 after the upload, before Wrangler enables workers.dev and preview URLs. Reruns saw the Worker as existing and skipped the deploy, so versions upload never returned the stable preview alias. Deploy whenever the Worker's preview URLs are off, and retry the deploy so a first run survives the race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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
wrangler deployup to three times, so a new pull request's first run survives Cloudflare's 10007 race instead of failing.Why
Since about 21:00 UTC on 24 Oct, a brand-new preview Worker's first
wrangler deployuploads the script and then fails on Wrangler's next call,GET /workers/workers/lymi-app-pr-<n>, with "This Worker does not exist on your account. [code: 10007]". That call is Wrangler's read before it enables workers.dev and preview URLs, so the Worker is left with both off. Every rerun then saw the Worker as existing, skipped the create step, andwrangler versions upload --preview-alias previewreported no preview URL becausepreviews_enabledwas false.Uploaded lymi-app-pr-<n>followed by the 10007 error.Version Preview URL, sopreview-url.mjsthrows.Open PRs whose preview Worker is already stuck, such as 1026 and 1027, recover after a rebase onto this change: preparing the preview sees preview URLs off and redeploys.
Instrumentation
None: this changes CI provisioning only, with no learner behaviour or product event.
Verification
node --test scripts/app-preview-infrastructure.test.mjs: 17 pass. The new test for a Worker that exists with preview URLs off fails onmainand passes here, as do the two updated readiness tests.pnpm verify:changedhanded over to the full gate (the diff touchesci.yml) and failed locally inapps/webtypecheck: this worktree's install predates@cloudflare/vitest-plugin. Left to CI, which installs fresh.app previewjob (job 121136623742) passed on its first run: the create step deployedlymi-app-pr-1030, the upload printedVersion Preview Alias URL: https://preview-lymi-app-pr-1030.k-porshnieva.workers.dev, and the sign-in and seeded-data checks passed. That first deploy did not hit the 10007 race, so the retry was not exercised.🤖 Generated with Claude Code