Skip to content

fix(deploy): bypass deployment checks for automatic rollbacks - #571

Open
davidgustys wants to merge 1 commit into
voidzero-dev:mainfrom
davidgustys:fix/rollback-bypass-deployment-checks
Open

davidgustys wants to merge 1 commit into
voidzero-dev:mainfrom
davidgustys:fix/rollback-bypass-deployment-checks

Conversation

@davidgustys

@davidgustys davidgustys commented Oct 23, 2026 •

Copy link
Copy Markdown

Cloudflare refuses a deployment that moves traffic back to an older Worker version when a secret has changed since that version was active (error 10220), unless the request is forced. Void's automatic recovery runs into this. After a failed readiness check, activation or trigger sync, it deploys the previous version at 100%. Cloudflare rejects that, the Worker stays at the previous version at 100% plus the failed one at 0%, and the next deploy stops with deployment-changed until the deployment is fixed by hand.

This adds an optional bypassDeploymentChecks to the versions.deploy operation. It is passed to cf as --bypass-deployment-checks, which sends force=true to the Deployments API. Only automatic recovery sets it, and only after the existing check that Void still owns the current traffic:

  • restorePreviousVersion, for readiness, activation and trigger-sync failures
  • the trigger-sync rollback in activateCloudflareExistingVersion
  • restorePlatformWorkerDeployment in the platform installer

Normal deploys and user-requested rollbacks are unchanged.

It applies when the version being rolled back from changed a secret. In stock Void, that's void platform upgrade with a replacement VOID_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN: the new token is uploaded with the new version, so a failed trigger publish can't restore the previous deployment. I found it in a fork that publishes prebuilt artifacts with explicit secrets. There, a deploy that changed a secret and then failed readiness left the Worker stuck as described. With this change, the same live run on Cloudflare restored the previous version and the next deploy went through.

  • Unit tests check that the recovery paths send the flag and that normal activation and user rollbacks don't. One test runs the real cf binary against a local server and checks that ?force=true is sent alongside the deployment body.
  • Focused tests pass (356), as do vp run check, vp fmt, vp lint, vp run test --base main and one full vp test run. The only failing files are the init, init-install and nitro tests, which fail the same way on main locally.

Cloudflare rejects a deployment that rolls back to an older version after
a secret changed (error 10220) unless it is forced. Void's automatic
recovery after failed readiness, activation or trigger synchronization
therefore failed whenever the failed version changed a secret, leaving
the Worker at previous@100 plus failed@0 and blocking later deploys with
deployment-changed.

Add an optional bypassDeploymentChecks flag to versions.deploy, mapped to
cf's --bypass-deployment-checks (force=true), and set it only on automatic
recovery paths that have already verified ownership of current traffic:
restorePreviousVersion, the trigger-synchronization rollback, and platform
deployment restoration. Normal deploys and user-requested rollbacks are
unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant