Repository navigation
[deploy-helpers] Warn when a Build Output Preview is missing bindings without IDs - #16752
Draft
edmundhung wants to merge 1 commit into
Draft
edmundhung wants to merge 1 commit into
edmundhung wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 637bbaa The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
Contributor
|
@edmundhung Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
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.
When
previewBuildOutput()uploads a Preview, it leaves out KV, D1, and R2 bindings that have no resource ID, so the Preview can get them from the Preview base config. If the Preview base config doesn't define them either, the Preview runs without them and nothing says so.For example, a cf project with
CACHE: bindings.kv()deploys fine to production, because the namespace is created on the first deploy. But aftercf previews deploy,env.CACHEisundefinedand the Preview fails at runtime.This adds a warning after the upload that lists those bindings. It reads the Preview base config first, so bindings defined there aren't reported:
The existing missing-bindings warning only runs outside JSON mode, and cf always calls
previewBuildOutput()withjson: true. This one is logged in both modes. It goes throughlogger.warnto stderr, so the JSON output stays unchanged. If the Preview base config can't be retrieved, the deployment is already live, so the command still succeeds and the warning lists the bindings it couldn't check (the same approach #16090 takes for the existing warning).