Repository navigation
Remove verbose mode - #19
Conversation
dlh01
left a comment
There was a problem hiding this comment.
I'm not sure I follow the motivation for this change as described in #18. First, I don't follow how verbose mode is incompatible with formatted data. Second, since this PR only changes the name of the flag, not any behavior, I'm not sure I understand how it fixes the issue.
More generally, a --verbose flag is a well-established convention, while a --progress-bar flag is not so common. Combined with the above points of confusion, I'm not sure what benefits are being gained for this tradeoff.
Having said all that, if you think this is a needed change, I trust your judgment. The only other thing I would point out would be that I think this warrants the next version of the package being a major version, since this PR changes a public API (while #17 is arguably a bug fix).
|
So, let me elaborate a bit more then. We use In this command, we don't show any debugging information, it is being used to set The progress bar "convention" is something we created as part of https://github.com/alleyinteractive/wp-bulk-task/wiki. Mainly because the feature is usually used with migrations and migration takes time. One might want to keep track of how a command is doing. So, #16 is not a bug fix since the command runs correctly with or without it. The error is that we are using a long running command but we do not print any data as part of collecting the report, and then we list the output in the format we want. The cursor feature would only be relevant if we were printing something as the command is being run, as the data is being fetched and created. Because if the command failed for any reason, we would not lose any already fetched data for the reports. But for listing data, even if the command fails with 50% of the report, we lose all data with or without this See my talk about running WP CLI Commands At Scale where I went deeper into this. So, to recap:
:) |
|
Thank you for this thoughtful response!
Speaking just for myself, this definition of The guide at https://clig.dev/#arguments-and-flags says:
Which, as I read it, only suggests that debugging output should be shown only when verbose mode is enabled, not that verbose mode should include debugging output. Additionally, I would observe the authors of that document list a dedicated The two core CLI commands document their
I would argue that neither description indicates that debugging output will be shown. ("Log useful information" comes close to my usual definition of the Moreover, WP-CLI itself contains a global
I think the fact that, in this command, I would not expect, as a developer, that if I decided to change the internals of the command to not use Bulk Task, that I would have to find a way to rewrite the progress bar just to maintain compatibility with the flag. Instead, I would expect to find some other relevant way to be verbose.
If the command failed at 50%, then the next time it ran, it would check only the remaining 50% of the data, right? So it would appear to "complete," but the user would get results that were actually incomplete (because, as you say, it doesn't print anything until the end)? If so, that's what I mean by bug. |
dlh01
left a comment
There was a problem hiding this comment.
🌳 For the reasons I mentioned, I'm still not quite convinced by this change, but the code itself looks good, and there's a method behind it, and that's important!
|
I see I mixed up That's tricky, because I'd only argue that my suggestion better aligns to how Alley developers use it. A
I agree with this comment. However, the Unless we decide to actually have useful information in |
fixes #18