-
Notifications
You must be signed in to change notification settings - Fork 551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrangler: add metadata to the unsafe binding #2665
wrangler: add metadata to the unsafe binding #2665
Conversation
🦋 Changeset detectedLatest commit: 8c6ccf8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4285802836/npm-package-wrangler-2665 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/2665/npm-package-wrangler-2665 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4285802836/npm-package-wrangler-2665 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4285802836/npm-package-cloudflare-pages-shared-2665 Note that these links will no longer work once the GitHub Actions artifact expires. |
Codecov Report
@@ Coverage Diff @@
## main #2665 +/- ##
==========================================
+ Coverage 73.96% 74.04% +0.08%
==========================================
Files 166 166
Lines 10197 10181 -16
Branches 2728 2711 -17
==========================================
- Hits 7542 7539 -3
+ Misses 2655 2642 -13
|
@@ -1155,6 +1155,7 @@ function normalizeAndValidateEnvironment( | |||
validateBindingsProperty(envName, validateUnsafeBinding), | |||
{ | |||
bindings: [], | |||
metadata: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I am not sure about bundling the unsafe metadata and bindings into the same object here... The validateBindingsProperty
is really only designed to deal with the original unsafe bindings array of objects...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - with a couple of nits that you can tidy up as you wish @alankemp
2e770ff
to
d6185ed
Compare
I just tried a wrangler.toml that included unsafe.metadata but not an unsafe.binding and get an error: So I need to fix that before this can be merged |
This is now done. |
abd595b
to
c4ce24c
Compare
c4ce24c
to
e6dc0eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a fixup commit that I think resolves the weirdness you are seeing.
See c445c55
6a3c60d
to
c445c55
Compare
ff17dc6
to
ca72dd9
Compare
This allows you to add arbitary fields to the metadata uploaded with a worker. [unsafe.metadata] some_key = some_value
ca72dd9
to
8c6ccf8
Compare
This allows you to add arbitary fields to the metadata uploaded with a worker.
[unsafe.metadata]
some_key = some_value
What this PR solves / how to test:
Associated docs issues/PR:
Author has included the following, where applicable:
Reviewer has performed the following, where applicable:
Fixes # [insert issue number].