Skip to content
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 full Event Stream marshalling support and working S3 example #667

Merged
merged 14 commits into from
Aug 27, 2021
Merged

Add full Event Stream marshalling support and working S3 example #667

merged 14 commits into from
Aug 27, 2021

Conversation

jdisanti
Copy link
Collaborator

@jdisanti jdisanti commented Aug 24, 2021

Motivation and Context

This is more progress towards #121.

Description

  • Completed implementation of the Event Stream marshall/unmarshall codegen
  • Refactored Arc<Mutex<PropertyBag>> to be SharedPropertyBag
  • Fixed bug where a signed empty frame wasn't being sent on end of stream (fixes BadRequestException response in the Transcribe example)
  • Started on RPC initial-response support by adding try_recv_initial() to Receiver
  • Reduced number of AWS services in tier-1 CI build

Testing

  • Marshall/unmarshall codegen is thoroughly unit tested
  • Manually tested against Transcribe StartStreamTranscription and S3 SelectObjectContent

Checklist

  • I have updated the CHANGELOG

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jdisanti jdisanti requested a review from rcoh August 24, 2021 23:25
Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making this fields optional feels like a bit of a code smell, probably worth splitting it up to avoid running heterogenous data through this function.

[meta comment on cfbadaf]

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small cleanups. Only major thing IIRC was the generic error stuff. Exciting that this operations are working!

*codegenScope
)
},
{ rust("unimplemented!(\"TODO(EventStream): Figure out what to do when there's no payload\")") }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like the kind of runtime panic we should be very cautious about since it's not that hard to trigger. Feels like a level of TODO a bit higher than the others we should be very careful not to launch with

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case where the target is the union member, it is required due to the nature of Smithy unions, so it's impossible to reach this unimplemented! in this case.

So that means this is only reachable for an event struct that has a @eventPayload annotated member that isn't also @required (so the builder isn't checking its requiredness). Will start looking into the expected behavior here.

For the models we are allow listing in this PR (Transcribe and S3), this isn't a problem since none of them need to serialize an event with a member annotated with @eventPayload. It's exclusively in the response events so far.

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Excited to ship this!

)
}

override fun parseEventStreamGenericError(operationShape: OperationShape): RuntimeType =
Copy link
Collaborator

@rcoh rcoh Aug 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. We can customize this for S3 select to get nice errors at some point.

  • open an issue to track

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue opened: #671

@jdisanti jdisanti merged commit 5c0e294 into smithy-lang:main Aug 27, 2021
@jdisanti jdisanti deleted the eventstream-codegen branch August 27, 2021 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants