dynamo_request_parser: adding support for transactions#7244
dynamo_request_parser: adding support for transactions#7244mattklein123 merged 20 commits intoenvoyproxy:masterfrom
Conversation
60dc23c to
a956054
Compare
Signed-off-by: Hallie Lomax <hallie@lyft.com> missing colon Signed-off-by: Hallie Lomax <hallie@lyft.com> missing colon.. Signed-off-by: Hallie Lomax <hallie@lyft.com> adding test Signed-off-by: Hallie Lomax <hallie@lyft.com> another missing colon Signed-off-by: Hallie Lomax <hallie@lyft.com> attempt format fix Signed-off-by: Hallie Lomax <hallie@lyft.com> one more Signed-off-by: Hallie Lomax <hallie@lyft.com> fixing json Signed-off-by: Hallie Lomax <hallie@lyft.com>
89108a5 to
7746282
Compare
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
|
@hallie thanks for working on this! Do you mind merging in master? I will do a pass now. |
|
@junr03 will do! |
Signed-off-by: Hallie Lomax <hallie@lyft.com>
| } | ||
|
|
||
| TEST(DynamoRequestParser, parseTableNameTransactOperation) { | ||
| std::vector<std::string> supported_transact_operations{"TransactGetItems", "TransactWriteItems"}; |
There was a problem hiding this comment.
You could use the statically defined constant vector RequestParser::TRANSACT_OPERATIONS to prevent drift, no?
There was a problem hiding this comment.
so this list is private, meaning i can't call it outside of the class. and all the other operations vectors are private as well, meaning that i'd either have to convert them all to public or not follow the set convention, so i'm just reverting back to having a separate list in the test (which is what the other tests for this file do)
| // 4xx | ||
| "AccessDeniedException", | ||
| "ConditionalCheckFailedException", | ||
| "IdempotentParameterMismatchException", |
There was a problem hiding this comment.
Can we add tests for the failure scenarios that lead to these type of errors?
There was a problem hiding this comment.
Judging from the implementation of the function that uses this list, its just checking if this error name exists in the error string returned from dynamo. And the only tests for that function are passing a string with one of the error names in it, rather than actually mimicking the error itself. So is this necessary to add?
|
/wait |
Signed-off-by: Hallie Lomax <hallie@lyft.com>
b60e605 to
5988ebc
Compare
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Signed-off-by: Hallie Lomax <hallie@lyft.com>
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
@junr03 could I get another review? :0 |
| for (const Json::ObjectSharedPtr& transact_item : transact_items) { | ||
| next_table_name = getTableNameFromTransactItem(*transact_item); | ||
| if (next_table_name.empty()) { | ||
| auto next_table_name = getTableNameFromTransactItem(*transact_item); |
There was a problem hiding this comment.
convention for the envoy codebase is to explicitly add the type here. Also I would add const here as you don't expect to change the table name.
There was a problem hiding this comment.
I think it's ok to make this const auto.
zuercher
left a comment
There was a problem hiding this comment.
Looks good. Let's switch the one type to const, and then I'll approve.
| for (const Json::ObjectSharedPtr& transact_item : transact_items) { | ||
| next_table_name = getTableNameFromTransactItem(*transact_item); | ||
| if (next_table_name.empty()) { | ||
| auto next_table_name = getTableNameFromTransactItem(*transact_item); |
There was a problem hiding this comment.
I think it's ok to make this const auto.
Agree with @hallie that the existing tests are sufficient.
Signed-off-by: Hallie Lomax <hallie@lyft.com>
|
@zuercher updated! :D |
Signed-off-by: Hallie Lomax <hallie@lyft.com>
Description:
TransactWriteItemsTransactGetItemsIdempotentParameterMismatchExceptionTransactionCanceledExceptionTransactionInProgressExceptionRisk Level:
LowTesting: mostly just planning to copy existing tests for
BATCH_OPERATIONSDocs Changes:
NoneRelease Notes:
Fixes #7240