-
Notifications
You must be signed in to change notification settings - Fork 190
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 useful Debug impl to PropertyBag and ConfigBag #2612
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
assert_eq!(property_bag.get(), Some(&MyType(10))); | ||
assert_eq!( | ||
format!("{:?}", property_bag), | ||
r#"PropertyBag { contents: ["aws_smithy_http::property_bag::test::test_extensions::MyType"] }"# |
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.
std::any::type_name
's output is essentially unstable, so I'm not sure if we want this test, see https://doc.rust-lang.org/std/any/fn.type_name.html#note.
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.
Nice! This is awesome
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
## Motivation and Context - it's hard to debug what properties are set, especially for layered configuration ## Description Add Debug Info for PropertyBag and Config bag: ``` PropertyBag { contents: ["aws_smithy_http::property_bag::test::test_extensions::MyType"] } ``` ``` ConfigBag { layers: [ Layer { name: "c", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop3>", "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop4>", ], }, Layer { name: "b", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop3>", "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop2>", ], }, Layer { name: "a", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop1>", ], }, Layer { name: "base", properties: [], }, ], } ``` There is still some work to do, but this is a start ## Testing - [x] UT ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <[email protected]>
## Motivation and Context - it's hard to debug what properties are set, especially for layered configuration ## Description Add Debug Info for PropertyBag and Config bag: ``` PropertyBag { contents: ["aws_smithy_http::property_bag::test::test_extensions::MyType"] } ``` ``` ConfigBag { layers: [ Layer { name: "c", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop3>", "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop4>", ], }, Layer { name: "b", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop3>", "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop2>", ], }, Layer { name: "a", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop1>", ], }, Layer { name: "base", properties: [], }, ], } ``` There is still some work to do, but this is a start ## Testing - [x] UT ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <[email protected]>
## Motivation and Context - it's hard to debug what properties are set, especially for layered configuration ## Description Add Debug Info for PropertyBag and Config bag: ``` PropertyBag { contents: ["aws_smithy_http::property_bag::test::test_extensions::MyType"] } ``` ``` ConfigBag { layers: [ Layer { name: "c", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop3>", "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop4>", ], }, Layer { name: "b", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop3>", "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop2>", ], }, Layer { name: "a", properties: [ "aws_smithy_runtime_api::config_bag::Value<aws_smithy_runtime_api::config_bag::test::layered_property_bag::Prop1>", ], }, Layer { name: "base", properties: [], }, ], } ``` There is still some work to do, but this is a start ## Testing - [x] UT ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: John DiSanti <[email protected]>
Motivation and Context
Description
Add Debug Info for PropertyBag and Config bag:
There is still some work to do, but this is a start
Testing
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.