-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add no progress result printer to s3 transfer #2747
Conversation
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.
Had some small feedback.
@@ -369,6 +369,11 @@ | |||
'output is suppressed.')} | |||
|
|||
|
|||
NO_PROGRESS = {'name': 'no-progress', 'action': 'store_true', |
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.
The no-*
params typically have a store_false
action with the destination being the param without the no
prefix (progress
in this case). Also makes it less confusing if we ever add an explicit true version of this arg (--progress
).
@@ -369,6 +369,11 @@ | |||
'output is suppressed.')} | |||
|
|||
|
|||
NO_PROGRESS = {'name': 'no-progress', 'action': 'store_true', | |||
'help_text': ( | |||
'File transfer progress is not displayed.')} |
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.
It's probably worth documenting that this arg only matter is the other two options aren't provided (quiet/only_show_errors)
Codecov Report
@@ Coverage Diff @@
## develop #2747 +/- ##
===========================================
+ Coverage 95.58% 95.59% +<.01%
===========================================
Files 151 151
Lines 11848 11860 +12
===========================================
+ Hits 11325 11337 +12
Misses 523 523
Continue to review full report at Codecov.
|
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 really hope this gets merged into an upcoming version soon. I manually made these changes to the three python files affected, and now the log files created by all my s3 cron scripts are useful and readable. As far as I can tell, it's a complete fix to a problem people have been complaining about for years. The --no progress option is documented in the help files the same as any other function and does what it says it does. Thank you joguSD!
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.
Looks good. I just had some very small comments. Also make sure you run the integration tests to make sure nothing is broken.
@@ -369,6 +369,15 @@ | |||
'output is suppressed.')} | |||
|
|||
|
|||
NO_PROGRESS = {'name': 'no-progress', | |||
'action': 'store_false', | |||
'dest': 'progress', |
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.
Not sure it is needed but all of the parameters like this have a 'default': True
in the dictionary. Not sure if it is needed. Do not think it is. But it would not hurt to be consistent.
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.
The other two flags like this don't have a default either, I think it's fine to have no default.
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 was referring to all of the boolean flags that have store_false
as the action. I just checked the docs and did it on the command line and its fine. Putting the default
kwarg whose value is True
is redundant.
'dest': 'progress', | ||
'help_text': ( | ||
'File transfer progress is not displayed. This flag ' | ||
'is only applied when the quiet and only-show-errors ' |
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.
Does the second sentence even matter? Based on the --quiet
and --only-show-errors
documentation, it will not show progress anyways. I would prefer to remove it in case we do not cause any confusion in the future if we add a new output parameter and forget to update this documentation.
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.
The second sentence was added in response to some of James' feedback.
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.
Oh its because it is conflicting. Like if --no-progress --quiet
is provided which one would win? Yeah I'm fine with keeping it as is.
# Copy file into bucket. | ||
p = aws('s3 cp %s s3://%s/ --no-progress' % (foo_txt, bucket_name)) | ||
self.assertEqual(p.rc, 0) | ||
# Ensure success message was printed |
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.
It might be good to assert there was no progress statement as well in the standard output.
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.
Updated.
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.
Looks good. 🚢
This seemed relatively easy to implement and a lot of people have been asking for it.
This is basically a copy paste of the
OnlyShowErrorsResultPrinter
except that it still prints success messages. Just like the--only-show-errors
flag you can now also pass--no-progress
to omit the progress rendering. Not sure if I hit all the tests we need for this.Implements: #519