Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Add support for text blob bindings #1543

Merged
merged 4 commits into from
Jan 14, 2021

Conversation

xortive
Copy link
Contributor

@xortive xortive commented Sep 3, 2020

closes #483

I need to write docs, and confirm I got the env inheritance stuff right (I copied how it works for vars, need to ensure that is correct.)

But my baby test passes :)

I probably need to ensure size limits are still taken into account here as well.

changelog/docs:

Wrangler now supports text blobs! text blobs are values to use in your workers, but read from a file instead of a string in your TOML.

Usage:

text_blobs = { FOO = "path/to/foo.txt", BAR = "path/to/bar.txt" }

@xortive xortive requested a review from a team as a code owner September 3, 2020 05:03
@ashleymichal
Copy link
Contributor

I probably need to ensure size limits are still taken into account here as well.

correct. there's another ticket for that: #896

Copy link
Contributor

@ashleymichal ashleymichal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure about the name blobs. this likely deserves some product attention.

@@ -43,6 +43,7 @@ pub struct Manifest {
pub kv_namespaces: Option<Vec<ConfigKvNamespace>>,
pub env: Option<HashMap<String, Environment>>,
pub vars: Option<HashMap<String, String>>,
pub blobs: Option<HashMap<String, String>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to use a <HashMap<String, PathBuf>> explicitly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have used PathBuf, but webpack_config above uses String so I used that, but I can change it if you'd like.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please 😄

@@ -239,6 +241,9 @@ impl Manifest {

// don't inherit vars
target.vars = environment.vars.clone();

// don't inherit blobs
target.blobs = environment.blobs.clone();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't remember why we chose not to inherit vars... 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think these should likely be inherited; cc @rita3ko any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be inherited i think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only reason for not inheriting these, is it feels weird to do something different than for vars.

Copy link
Contributor Author

@xortive xortive Nov 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashleymichal @rita3ko Do y'all have a final opinion here as to why these should be inherited when vars are not? Y'all have more context than I do about what should/should not get inherited

EDIT:yeah, I see why these should be inherited, since they're more likely to represent something that is inherent to the worker itself, rather than it's environment. I changed it to inherit, can always drop the commit if y'all change your minds.

@ashleymichal ashleymichal self-requested a review September 3, 2020 15:44
@ispivey
Copy link
Contributor

ispivey commented Sep 18, 2020

@rita3ko : "Let's call 'em text blobs specifically, and just support those"

ashleymichal
ashleymichal previously approved these changes Sep 18, 2020
@ashleymichal
Copy link
Contributor

lgtm once the name change is complete.

@ashleymichal ashleymichal dismissed their stale review September 25, 2020 18:07

would like comments above to be addressed

@ashleymichal
Copy link
Contributor

@xortive are you in a position to address the above comments or should someone pick this up and carry it over the finish line?

@xortive
Copy link
Contributor Author

xortive commented Nov 19, 2020

@xortive are you in a position to address the above comments or should someone pick this up and carry it over the finish line?

Sorry I've been unresponsive with this PR, I've got some free time today so I'm going to get this out the door

@xortive
Copy link
Contributor Author

xortive commented Nov 19, 2020

name change done, going to resolve conflicts now

@xortive
Copy link
Contributor Author

xortive commented Nov 19, 2020

Alright, looks like this should be ready to go

Copy link
Contributor

@nataliescottdavidson nataliescottdavidson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write some docs / small lil paragraph explaining usage for the changelog?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow file bindings as text_blob
5 participants