-
Notifications
You must be signed in to change notification settings - Fork 341
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
[DNM] s3_object: fix removal of max_keys=0 from params for list_keys operation #2294
Conversation
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 4m 33s |
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.
What makes me nervous about this change is that I'm not sure what the actual effect is when there's a limit of "0" applied. There's also no test that this is actually doing what we expect.
From local testing, I've noticed that it just doesn't return anything. Imo don't see any harm with this fix, but would check with @alinabuzachis as well.
|
Can you please add some tests (I guess units will be the best) for this param that will help to understand the behaviour when set to 0 or a different value? |
@alinabuzachis on a deeper look, I think while the API without paginator (not used in code) does accept MaxKeys in request the below assertion fails, as including max_keys in code is not changing anything I guess
the same works fine with AWS CLI, which utilizes same backend code as client.list_objects_v2 I think
|
I have played with this option a bit and can confirm that the paginator does not accept max_keys. I don't know if this option has ever worked, unless the paginator API was changed and this parameter was removed/replaced. However, similar functionality is achieved by passing MaxItems to PaginationConfig. Therefore, I suggest removing the default value of max_keys and, passing it to PaginationConfig similar to:
This succeeds then:
Thoughts? @tremble @mandar242 |
If someone passes |
76d49e0
to
43b29fc
Compare
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 7m 25s |
@tremble @alinabuzachis , in that case maybe we can drop this PR, and inform reporter to make use of |
Closing this in favour of #2328 which reworks how/when pagination is used. |
SUMMARY
fix accidental removal of max_keys: 0 from params
The current code removes all falsy values including 0, causing 'max_keys: 0' being removed from pagination_params
builds up on work from #1954
Fixes #1953
ISSUE TYPE
COMPONENT NAME
s3_object
ADDITIONAL INFORMATION
current code
PR code