fix(ci): bump Wrangler lower bound to ^4.81.0, pin all deno task wrangler* entries, use deno task wrangler in deploy step#1528
Conversation
…in deploy step Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/fcf11654-c1f0-412e-9c55-6fc874055344 Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adjusts the CI deployment tooling to avoid a known broken Wrangler range and to make GitHub Actions deployments use the same Wrangler invocation approach as the rest of the repo.
Changes:
- Bumps the Wrangler import-map lower bound in
deno.jsonfrom^4.77.0to^4.81.0. - Updates the composite deploy action to run the worker deploy via
deno task wrangler ...instead of a directdeno run -A npm:wrangler ...invocation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
deno.json |
Raises the Wrangler import-map minimum version to avoid the regressed versions. |
.github/actions/deploy-worker/action.yml |
Makes the main deploy step use the repo’s standard deno task wrangler entrypoint. |
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/6ee2ded8-8eee-4edd-a433-9e52c45700fa Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Done in fe6bb15. All 15 |
Cloudflare deployments have been failing deterministically on every push to
main. Wrangler 4.77–4.80 has a known regression where deploying a worker with a[[containers]]binding causes a broken internalfetchcall during the container image upload phase —fetch failedevery time, not transient.Description
Three related changes ensure the
^4.81.0version bound is enforced consistently across every Wrangler invocation in the repo.Changes
deno.json(import map) — Raise Wrangler import-map lower bound from^4.77.0→^4.81.0to match the version already resolved indeno.lock(4.81.0) and prevent the broken range from being re-resolved on lockfile regeneration.deno.json(tasks) — Pin all 15deno task wrangler*task definitions from the unversionednpm:wranglertonpm:wrangler@^4.81.0so every task invocation uses the same version bound as the import-map alias, making the CI fix deterministic..github/actions/deploy-worker/action.yml— Replace the baredeno run -A npm:wranglerinvocation in theDeploy Workerstep withdeno task wrangler, so the deploy step honours the import map anddeno.lockconsistently with every other Wrangler call in the project.deno.lockis not modified — it already resolves to4.81.0.Testing
Zero Trust Architecture Checklist
This PR does not touch
worker/orfrontend/.Worker / Backend
*) on write/authenticated endpoints — N/A[vars]) — N/A.prepare().bind()(no string interpolation) — N/AFrontend / Angular
CanActivateFnauth guards — N/AlocalStorage) — N/AAPI Shield / Vulnerability Scanner
This PR does not touch
openapi.yamlor resource handlers.operationIdinopenapi.yaml— N/A/{id}path parameters) include asecurity:annotation — N/AWHERE user_id = ?) — N/A404(not403) to avoid leaking resource existence — N/Acloudflare-schema.yamlregenerated ifopenapi.yamlchanged (deno task schema:cloudflare) — N/AIf this PR does not touch
worker/orfrontend/, the ZTA checklist is not required.If this PR does not touch
openapi.yamlor resource handlers, the API Shield checklist is not required.Original prompt
Problem
Cloudflare deployments have been failing on every push to
mainfor several days. The CI run at https://github.com/jaypatrick/adblock-compiler/actions/runs/24287822198/job/70920282396 (and the prior run 24287474259) shows the same deterministic failure:This
fetch failedoccurs every single attempt, both for the tail worker deploy and the main worker deploy. It is not transient — it is a known regression in Wrangler 4.77–4.80 where deploying a worker with a[[containers]]binding causes a broken internalfetchcall during the container image upload phase.Root Causes
1.
deno.jsonWrangler specifier has a stale lower boundIn
deno.jsonline 118:The
deno.lockhas already resolved this to4.81.0:But because the lower bound is
^4.77.0, the import map specifier is misleading and could resolve to a broken version if the lockfile is regenerated or updated. The specifier should be updated to^4.81.0to match the locked version and prevent regression.2. The
Deploy Workerstep inaction.ymlbypasses the lockfileIn
.github/actions/deploy-worker/action.ymlline 164:deno run -A npm:wrangler deploy --var SENTRY_RELEASE:${{ inputs.github-sha }}This invokes
npm:wranglerdirectly viadeno run, bypassingdeno.json's import map anddeno.lock. This means it may resolve to a different Wrangler version than what all thedeno task wranglercalls use elsewhere. It should usedeno task wranglerfor consistency.Required Changes
Change 1:
deno.jsonUpdate line 118 from:
to:
Change 2:
.github/actions/deploy-worker/action.ymlIn the
Deploy Workerstep (around line 164), change the run command from:to:
Notes
deno.lock— the lock file already has the correct resolved version (4.81.0). Onlydeno.json's specifier string needs updating.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Cloudflare deployments are failing https://github.com/jaypatrick/adblock-compiler/actions/runs/24287822198/job/70920282396
Assistant: Now let me look at the workflow and wrangler config to understand the full picture:
Assistant: Here's the root cause analysis of the failing deployment:
Root Cause: Tail Worker
fetch failed→ Main Worker Deploy AbortedThe failure is not a code bug — it's a Wrangler networking/connectivity error occurring during the tail worker (
adblock-tail) deploy step, which then cascades to the main worker deploy.What's happening
Looking at the log sequence:
Tail worker deploy fails 3 times with
fetch failed— Wrangler's HTTP client cannot reachapi.cloudflare.comduring the upload phase. This is a transient Cloudflare API connectivity issue from the GitHub Actions runner.The tail worker failure is non-fatal (correctly marked
::warning::and continues).Main worker deploy then also fails with the same
fetch failederror at thewrangler deploystep (stepDeploy Worker, linedeno run -A npm:wrangler deploy).record-deployment.tsscript records it asstatus=failed.Two real issues found
Issue 1 — Wrangler version is outdated:
Wrangler is printing
Note that there is a newer version of Wrangler available (4.81.1). The version currently used may have a known connectivity bug that was fixed in a newer release.Issue 2 — Main worker deploy has no retry logic, unlike the tail worker. The tail worker has a 3-attempt retry loop, but the
Deploy Workerstep inaction.ymlline 164 is a single bare invocation: