fix(deploy): enable workers.dev subdomain on worker deploy#7
Merged
Conversation
Live validation of the M8 deploy-job delegation surfaced a latent v0.2 bug:
DeployDO uploads the worker via the raw Scripts API, which leaves the
workers.dev subdomain DISABLED — so a deployed worker returns 404 at
<name>.<sub>.workers.dev (wrangler enables it automatically; the API doesn't).
After upload, POST .../scripts/:name/subdomain {enabled: true}, and resolve the
account subdomain to return a reachable URL for the deployments UI. Verified
live: enabling the subdomain made the CI-built worker serve HTTP 200. Affects
both v0.2 deploy.yml worker deploys and v0.3 CI deploy jobs.
Co-Authored-By: Claude Fable 5 <[email protected]>
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.
What
Live validation of the v0.3 M8 deploy-job delegation (build a worker in the CI sandbox → deploy it) surfaced a latent v0.2 bug:
DeployDOuploads workers via the raw Workers Scripts API, which — unlikewrangler deploy— leaves theworkers.devsubdomain disabled. The script uploads fine and reports success, but the worker returns 404 / error 1042 at<name>.<subdomain>.workers.dev, i.e. it's deployed but unreachable.Evidence (live, on a real account)
The CI deploy-job delegation itself worked perfectly — the run log shows the sandbox-built artifact flowing to the deploy:
But
GET gitflare-ci-deploy-test.<sub>.workers.dev→ 404. The Cloudflare API confirmed the script existed (GET script→ 200) withsubdomain: { enabled: false }, while wrangler-deployed workers hadenabled: true. Enabling it viaPOST .../scripts/:name/subdomain {enabled:true}made the worker immediately serve HTTP 200 with the CI-built body.Fix
After a successful script upload,
uploadWorkerScript:POST .../scripts/:name/subdomain { enabled: true }to expose it onworkers.dev(best-effort; the deploy still counts as success either way), andworkers.devsubdomain to return a reachableurlfor the deployments UI.Applies to both
.gitflare/deploy.ymlworker deploys (v0.2) and.gitflare/ci.ymldeploy jobs (v0.3).Tests
cf-deploy.test.tsupdated: asserts the subdomain-enable POST fires with{enabled:true}, the returned URL is built from the account subdomain, and that a failed upload does NOT attempt any subdomain calls. 105 worker tests pass.🤖 Generated with Claude Code