-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore(docs/tests): SQSExtended test model (example of polymorph library calling an AWS service) #666
Conversation
…g/smithy-dafny into robin-aws/smithy-init-example
…-lang/smithy-dafny into robin-aws/sqs-extended-test-model
…obin-aws/sqs-extended-test-model # Conflicts: # TestModels/aws-sdks/ddb-lite/model/ComAmazonawsDynamodbTypes.dfy # TestModels/aws-sdks/kms-lite/model/ComAmazonawsKmsTypes.dfy # codegen/smithy-dafny-codegen-test/src/test/java/software/amazon/polymorph/smithydotnet/DotnetTestModels.java # codegen/smithy-dafny-codegen-test/src/test/java/software/amazon/polymorph/smithyjava/JavaTestModels.java
…obin-aws/sqs-extended-test-model # Conflicts: # TestModels/aws-sdks/ddb-lite/model/ComAmazonawsDynamodbTypes.dfy # TestModels/aws-sdks/kms-lite/model/ComAmazonawsKmsTypes.dfy
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 is super great!
Might have been better as multiple PRs, but I'm not sure if that is worth the overhead :)
for i := 0 to |messages| { | ||
var message := messages[i]; | ||
// TODO: Propogate error instead of terminating | ||
var receiptHandle :- expect message.ReceiptHandle; |
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 think you should just be able to MapFailure
here. The smithy-dafny error type should have a joining error that should just work.
non-blocking point :)
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.
Yup agreed. I'll address that when I follow up with adding more target languages.
Description of changes:
Adds a test model intended as an example of how to build a thick client using polymorphing, in this case adding a very common client-side operation for AWS SQS. My intention was to make this a
smithy init
template, but as it was significant work to get this example working I'm locking it down in CI first, then will find a way to make a template from it while still testing it.Made several fixes and improvements to get this working in Java and make progress in other languages:
aws.polymorph#localService$configRequired
parameter, defaulting to false. Previously all local services had to provide a default factory method for config structures, but this isn't always reasonable. ForSQSExtended
you really have to provide an underlying SQS client, and there's no sensible default value for an allocated service client....types.__default.java
file if the{:extern}
module has any subset types declared. To move closer to being able to eventually GENERATE ALL THE THINGS, added a dummy subset type in thepolymorph_dafny
output so this is always required, and included this empty file when doing--generate client-constructors
. This isn't really breaking since all substantial polymorph libraries have lots of constraints in their models and hence subset types declared.BinarySetAttributeValue
handling to useSdkBytes
correctly to all lists of blobs.dafnyError
case forToNative
on an arbitrary top-level service error (currently being patched in manually in the MPL).Also added a Setup section to the main README, since there are extra steps now.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.