-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix matchers to align with waiters SEP #3242
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
base: version-3
Are you sure you want to change the base?
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.
Lookin' good! Thank you for picking up on this work.
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 great!
client.stub_responses(:waiter_operation, | ||
table_list: [{ table_status: 'ACTIVE' }, { table_status: 'ACTIVE' }]) |
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.
Could fix the alignment like so - I think rubocop will ok with the below:
client.stub_responses(:waiter_operation, | |
table_list: [{ table_status: 'ACTIVE' }, { table_status: 'ACTIVE' }]) | |
client.stub_responses( | |
:waiter_operation, | |
table_list: [ { table_status: 'ACTIVE' }, { table_status: 'ACTIVE' }] | |
) |
object = { | ||
object_member: { | ||
string_member: 'string' | ||
}, | ||
string_member: 'string', | ||
number_member: 1, | ||
boolean_member: true, | ||
array_member: [1, 2, 3], | ||
object_array_member: [ | ||
{ | ||
object_member: { | ||
string_member: 'string' | ||
}, | ||
string_member: 'string' | ||
} | ||
] | ||
} |
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.
Nit: could reduce the number of lines here like so - I think. If you do decide to reformat, you might as well do it for others as well
object = { | |
object_member: { | |
string_member: 'string' | |
}, | |
string_member: 'string', | |
number_member: 1, | |
boolean_member: true, | |
array_member: [1, 2, 3], | |
object_array_member: [ | |
{ | |
object_member: { | |
string_member: 'string' | |
}, | |
string_member: 'string' | |
} | |
] | |
} | |
object = { | |
object_member: { string_member: 'string' }, | |
string_member: 'string', | |
number_member: 1, | |
boolean_member: true, | |
array_member: [1, 2, 3], | |
object_array_member: [ | |
{ | |
object_member: { string_member: 'string' }, | |
string_member: 'string' | |
} | |
] | |
} |
client.stub_responses(:waiter_operation, | ||
table_list: [{ table_status: 'FAILED' }, { table_status: 'ACTIVE' }]) |
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.
Alignment here as well
@@ -1,6 +1,8 @@ | |||
Unreleased Changes | |||
------------------ | |||
|
|||
* Issue - Fix waiter matchers to cover object expected value type. |
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 didn't see any changes in the lib - so we won't need this changelog. Also - was there any diffs when you rake build all the service gems?
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.
Yes, no changelog is needed here.
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.
Seems fine. Feel free to do the suggested cleanups.
@@ -82,6 +82,12 @@ def acceptors(acceptors) | |||
acceptor['argument'] | |||
) | |||
end | |||
case acceptor['expected'] |
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.
You can simplify this by calling your convert_value method.
converted_key = convert_key(key) | ||
result[converted_key] = convert_value(value) |
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.
You can single line this.
# Convert keys for every object in array | ||
def convert_array(array) | ||
array.map do |elem| | ||
elem.is_a?(Hash) ? convert_keys(elem) : elem |
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.
You can just call convert_value here right? I would do array.collect { |e| convert_value(e) }
@@ -1,6 +1,8 @@ | |||
Unreleased Changes | |||
------------------ | |||
|
|||
* Issue - Fix waiter matchers to cover object expected value type. |
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.
Yes, no changelog is needed here.
@@ -27,7 +27,13 @@ | |||
"type":"structure", | |||
"members":{ | |||
"Table":{"shape":"TableDescription"}, | |||
"TableList":{"shape":"TableList"} |
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 example was pretty much retrofitted by dynamodb. If it's not too much trouble, we should probably slightly rewrite this - maybe we can do away with the "Table" concepts, make the operation just called operation, etc. Isn't TableList just the same as ObjectList pretty much?
Add support for matching expected value type of object for waiters.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
To make sure we include your contribution in the release notes, please make sure to add description entry for your changes in the "unreleased changes" section of the
CHANGELOG.md
file (at corresponding gem). For the description entry, please make sure it lives in one line and starts withFeature
orIssue
in the correct format.For generated code changes, please checkout below instructions first:
https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
Thank you for your contribution!