[wrangler] fix: pass force query parameter to API in pages deployment delete#13444
Conversation
…tch worker delete test pattern
🦋 Changeset detectedLatest commit: 2483b52 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
That's very interesting it's not documented, did not realize :) Without force (current wrangler behavior): DELETE https://api.cloudflare.com/client/v4/accounts/<account>/pages/projects/<project>/deployments/<deployment-id>
HTTP 400
{
"result": null,
"success": false,
"errors": [
{
"code": 8000035,
"message": "You cannot delete an aliased deployment without a `?force=true` parameter in the API request URL."
}
],
"messages": []
}With DELETE https://api.cloudflare.com/client/v4/accounts/<account>/pages/projects/<project>/deployments/<deployment-id>?force=true
HTTP 200
{
"result": null,
"success": true,
"errors": [],
"messages": []
} |
jamesopstad
left a comment
There was a problem hiding this comment.
Thanks for this and apologies for the confusion. We've checked with the relevant team and the docs have now been updated.
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
|
Thanks @jamesopstad and @naile . We also updated the API docs to reflect reality. |
|
I'll need to update the dev docs too: cloudflare/cloudflare-docs#28200 |
Improves #12474 — the
--forceflag was introduced but not wired to the API.wrangler pages deployment delete --forceonly skips the confirmation prompt — it does not pass?force=trueto the Cloudflare API. This causes deletion of aliased deployments (branch preview deployments) to fail with error 8000035, breaking automated cleanup of preview environments in CI/CD pipelines.The existing
wrangler delete(Workers) already passesforceas a query parameter to the API viaURLSearchParams. This PR bringspages deployment deletein line with that behavior.wrangler pages deployment deletecommand cloudflare-docs#28200