-
Notifications
You must be signed in to change notification settings - Fork 335
Verbose file printouts when using wrangler publish with a Worker Site #790
Conversation
…th a workers site
src/commands/kv/bucket/mod.rs
Outdated
@@ -36,6 +36,10 @@ pub fn directory_keys_values( | |||
let entry = entry.unwrap(); | |||
let path = entry.path(); | |||
if path.is_file() { | |||
if print_files { | |||
message::working(&format!("Parsing {}...", path.display())); |
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.
Why parsing by the way?
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.
because we technically don't upload until later :P by then, all the files have been batched into vecs for batched KV bulk uploads, so it's not optimal to print out the files there (we'd be iterating over the files again when we can just print out files in this initial interation).
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 see. I would be fine with Processing x ...
. Parsing
the file sounds odd to me, especially if we don't do it at all.
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.
That sounds good! Will replace Parsing
with Processing
:)
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.
We aren't parsing the files so we should change this verb.
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.
How about Preparing
?
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.
This generally LGTM I have a few nits that I won't block on. This is the output that I had when running wrangler publish
after wrangler generate --site && cd worker
$ wrangler publish --print-files
🌀 Using namespace for Workers Site "__worker-workers_sites_assets"
💁 Preparing to upload updated files...
🌀 Processing ./public/favicon.ico...
🌀 Processing ./public/index.html...
🌀 Processing ./public/404.html...
🌀 Processing ./public/img/404-wrangler-ferris.gif...
🌀 Processing ./public/img/200-wrangler-ferris.gif...
✨ Success
✨ Built successfully, built project size is 11 KiB.
✨ Successfully published your script to https://worker.avery.workers.dev
Unrelated to this PR: I think the singular "Success" line should be more descriptive about what exactly was successful. Think we might want to audit the way we communicate success. If others agree I'll open a new issue.
src/commands/kv/bucket/mod.rs
Outdated
@@ -36,6 +36,10 @@ pub fn directory_keys_values( | |||
let entry = entry.unwrap(); | |||
let path = entry.path(); | |||
if path.is_file() { | |||
if print_files { | |||
message::working(&format!("Processing {}...", path.display())); |
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.
Should "Processing" be "Uploading"? We aren't doing any processing on each file.
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.
On second thought (personal opinion incoming): I think I'd like to just have each file name on its own line without Processing
or the ...
.
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.
Heh Sven suggested switching to Processing instead of Parsing! I think either is okay... I have no strong opinions on which verb we use. I can get rid of the ellipses easy.
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.
Yeah - I feel like it might be redundant to have any verb (not hugely important) but seems like we could get away with each line just being the file name by itself with no frills (maybe even no emoji for easy copy pasting?)
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.
How about I use the word "preparing"? I guess we are preparing since we are base64 encoding all file contents :)
@EverlastingBugstopper what did you think about extending this behavior to |
I think extending to preview is a great idea - it's probably going to be used more often when debugging in preview than when publishing to be honest. I'm still a bit confused what you mean by "true verbose" |
True verbose refers to actually printing out logs (like our info
logs!)—it’s important that we don’t conflate that and the simple logic here
for printing out file names :)
…On Mon, Oct 21, 2019 at 12:14 PM Avery Harnish ***@***.***> wrote:
I think extending to preview is a great idea - it's probably going to be
used more often when debugging in preview than when publishing to be
honest. I'm still a bit confused what you mean by "true verbose"
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#790>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4YZSJEU2JTACXZIBMTRTLQPX5QNANCNFSM4JDCT75Q>
.
|
@gabbifish is there a reason that we can't just make this what i would expected wrangler publish --verbose to print what this does i think |
These file printouts are not info logs—instead, they are message::working
printouts. I originally used —verbose but Sven suggested we use something
different so we didn’t conflate these printouts with what we expect from
true verbose (eg. Printing out actual leveled logs). I did like his point,
but am happy to revert to using —verbose if folks prefer it.
…On Mon, Oct 21, 2019 at 12:31 PM ashley williams ***@***.***> wrote:
@gabbifish <https://github.com/gabbifish> is there a reason that we can't
just make this what verbose would mean for this command? i.e. these are
INFO logs? i'm not sure the bepsoke flag is necessary here
i would expected wrangler publish --verbose to print what this does i think
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#790>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4YZSIYL53E7BIWGHXQSP3QPX7P7ANCNFSM4JDCT75Q>
.
|
can you summarize @xtuc's point (it's late his time so he may be asleep)? im' not sure i understand the difference but it seems useful to understand! (i dont see it in the comment history so i'm not sure where the convo happened- would be good to document here!) |
I also don't feel strongly about that. My argument was that Also, once if we descided to add a |
The file printouts are distinct from info logs—in the code you can see they
are printed out with message::warn. This means that info logs and the file
printouts won’t overlap :D does this make you feel better about us using
—verbose then?
…On Mon, Oct 21, 2019 at 12:36 PM Sven Sauleau ***@***.***> wrote:
I don't feel strongly about that. My argument was that --print-files is
self describing, --verbose will add some noise in the ouput.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#790>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4YZSJW7BFUQQ6P52EOXGLQPYAFRANCNFSM4JDCT75Q>
.
|
I'm going to revert to using |
src/main.rs
Outdated
) | ||
.arg( | ||
Arg::with_name("verbose") | ||
.short("v") |
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 wouldn't use a short alias for this flag. It could be in our way when we want to add a flag that starts with the same name and that is more commonly used.
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.
agree
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.
a few nits, but otherwise looks good to go for me
src/commands/kv/bucket/mod.rs
Outdated
@@ -36,6 +36,10 @@ pub fn directory_keys_values( | |||
let entry = entry.unwrap(); | |||
let path = entry.path(); | |||
if path.is_file() { | |||
if print_files { | |||
message::working(&format!("Parsing {}...", path.display())); |
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.
We aren't parsing the files so we should change this verb.
src/main.rs
Outdated
) | ||
.arg( | ||
Arg::with_name("verbose") | ||
.short("v") |
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.
agree
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.
this looks great to me!! 🚀
Is this is 1.11.0 release yet? |
This PR closes #657. It allows Wrangler users running
wrangler publish
orwrangler preview
to see which files are being uploaded to Workers KV: