Repository navigation
Conversation
The pinned-secret uploader converts every binding itself, and bindingsFromOutput had no case for the `worker-loader` binding that cf emits for `worker_loaders`. Any app with a Worker Loader binding and a secret failed with "Cloudflare binding LOADER cannot be uploaded with pinned secrets." Map it to the `worker_loader` binding type and cover it in the pinned upload test.
This branch has not been deployed
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.
Problem
When the active Worker version has any secret,
void deploy --platform cloudflareuploads through the pinned-secret uploader instead ofcf's. That uploader rebuilds every binding inbindingsFromOutput, which has no case for theworker-loaderbinding thatcfemits forworker_loaders, so it reachesdefaultand throws:An app that uses Dynamic Workers (
cloudflare: { worker_loaders: [{ binding: 'LOADER' }] }) and has any secret can't be deployed. I hit it with--atomic; reading the code, the non-atomicversions.uploadpath uses the same uploader wheneveroutput.activeSecretsis set.This is the same failure as #462 (
ratelimits), for another binding type.Fix
Map
worker-loaderto theworker_loaderbinding type inbindingsFromOutput.worker_loaderis the Worker metadata binding type that Cloudflare's own packages use (@cloudflare/workers-utils).Verification
verifyPinnedUploadnow declaresworker_loadersand expects{ name: 'LOADER', type: 'worker_loader' }. Without the source change both pinned-upload tests fail with the error above; with it,cf-version-runner.test.tspasses (127 tests).vp fmt --checkandvp lintpass on the changed files, andpackages/voidtypechecks.worker_loadersand a required secret, using void 1.6.2 with this change (void deploy --platform cloudflare --atomic). The upload was accepted, and the live version listsLOADER: worker_loadernext to the inherited secret (secret_text). Before the change, the same deploy stopped with the error above.env.LOADERat runtime on that deployment. I only checked that the upload is accepted and the binding is present on the live version.