From d37bbbbec345e9aae609bf9a6fed784a7ad81a9f Mon Sep 17 00:00:00 2001 From: Rahul Varghese Date: Thu, 15 Oct 2026 00:56:55 +0530 Subject: [PATCH 1/2] feat(deploy): retry a first deploy that loses Cloudflare's own race (0.19.0) A brand-new worker's first `wrangler deploy` can fail right after the upload with "This Worker does not exist on your account" (code 10007): the follow-up read lands before the create is visible. Seen on pullely/cirrus-timing-3's fleet landing, where it cost the convergence a whole resume (~2-4 min). The deploy is idempotent, so cloudflare-worker-turbo and cloudflare-workers-assets-turbo now try it three times, 10 s then 20 s apart, before failing the step. Co-Authored-By: Claude Fable 5.1 --- ...cloudflare-worker-turbo-verify-deploy.yaml | 20 +++++++++++++++++- ...re-workers-assets-turbo-verify-deploy.yaml | 21 ++++++++++++++++--- stack.yaml | 2 +- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml b/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml index 9a30ef9..08e7720 100644 --- a/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml +++ b/compositions/cloudflare-worker-turbo/jobs/cloudflare-worker-turbo-verify-deploy.yaml @@ -158,7 +158,25 @@ spec: run: | : "${CLOUDFLARE_ACCOUNT_ID:?CLOUDFLARE_ACCOUNT_ID is required}" : "${CLOUDFLARE_API_TOKEN:?CLOUDFLARE_API_TOKEN is required}" - pnpm exec wrangler deploy --config {{ .parameters.wranglerConfig }} --env {{ .orun.environment.name }} + # A first deploy of a brand-new worker can lose a race inside + # Cloudflare: the upload lands and the follow-up read answers + # "This Worker does not exist on your account" (code 10007). The + # deploy is idempotent, so retry it a few times with a short wait + # instead of parking the whole convergence on a resume. + attempts=3 + for i in $(seq 1 "$attempts"); do + if pnpm exec wrangler deploy --config {{ .parameters.wranglerConfig }} --env {{ .orun.environment.name }}; then + [ "$i" -gt 1 ] && echo "deploy passed on attempt $i/$attempts" + exit 0 + fi + if [ "$i" -lt "$attempts" ]; then + wait=$(( i * 10 )) + echo "deploy attempt $i/$attempts failed — retrying in ${wait}s" + sleep "$wait" + fi + done + echo "deploy failed after $attempts attempts" + exit 1 onFailure: stop - id: secrets-live diff --git a/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml b/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml index 1047074..5158722 100644 --- a/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml +++ b/compositions/cloudflare-workers-assets-turbo/jobs/cloudflare-workers-assets-turbo-verify-deploy.yaml @@ -104,9 +104,24 @@ spec: EFFECTIVE_WORKER_NAME="{{ .parameters.workerName }}" {{- end }} - pnpm exec wrangler deploy \ - --config "{{ .parameters.wranglerConfig }}" \ - --name "${EFFECTIVE_WORKER_NAME}" + # Same first-deploy race as cloudflare-worker-turbo (Cloudflare code + # 10007 right after the upload); the deploy is idempotent, so retry. + attempts=3 + for i in $(seq 1 "$attempts"); do + if pnpm exec wrangler deploy \ + --config "{{ .parameters.wranglerConfig }}" \ + --name "${EFFECTIVE_WORKER_NAME}"; then + [ "$i" -gt 1 ] && echo "deploy passed on attempt $i/$attempts" + exit 0 + fi + if [ "$i" -lt "$attempts" ]; then + wait=$(( i * 10 )) + echo "deploy attempt $i/$attempts failed — retrying in ${wait}s" + sleep "$wait" + fi + done + echo "deploy failed after $attempts attempts" + exit 1 onFailure: stop - id: smoke diff --git a/stack.yaml b/stack.yaml index 059120e..1f204fc 100644 --- a/stack.yaml +++ b/stack.yaml @@ -3,7 +3,7 @@ kind: Stack metadata: name: stack-tectonic title: Stack Tectonic - version: 0.18.2 + version: 0.19.0 description: Versioned OCI-hosted catalog of Cloudflare, Terraform and monorepo compositions for Sourceplane repositories. owner: sourceplane tags: From fbcc583501250710fe6511318b08e569514a2e75 Mon Sep 17 00:00:00 2001 From: Rahul Varghese Date: Thu, 15 Oct 2026 00:59:48 +0530 Subject: [PATCH 2/2] stack: keep 0.19.0 to the deploy retry The shared install (scope: lane) needs an orun that lets a lane-scoped step follow the job's setup actions; it ships with that orun. Co-Authored-By: Claude Fable 5.1