Skip to content

Fix binding of SdkPojoSupplier to event stream type header. #1821

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

Merged
merged 4 commits into from
May 13, 2020

Conversation

adamthom-amzn
Copy link
Contributor

Description

Event stream type header values are generated from the member name in the event stream structure, not the structure name of the event itself. When the member name and the event type mismatch, then unmarshalling of events sent from the service fails.

From the spec: :event-type: This header’s value, a UTF-8 string, is derived from the event’s member name in the eventstream structure

Motivation and Context

This brings the implementation of event stream unmarshalling into sync with the spec.

Testing

I modified the existing generation tests to generate a mismatch between output event type names and member names. I have also tested this offline end-to-end with a service model that has this mismatch.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

Event stream type header values are generated from the member name in the event stream structure, not the structure name of the event itself.  When the member name and the event type mismatch, then unmarshalling of events sent from the service fails.

From the spec: `:event-type: This header’s value, a UTF-8 string, is derived from the event’s member name in the eventstream structure`
@millems
Copy link
Contributor

millems commented May 12, 2020

Do these two values match in Kinesis and Transcribe, and that's why they work? I want to make sure this wouldn't break one of those services.

@millems millems self-assigned this May 12, 2020
@adamthom-amzn
Copy link
Contributor Author

transcribe-streaming has AudioEvent that refers to the AudioEvent structure, and TranscriptEvent that points at a shape of the same name, as well as a bunch of exceptions that follow this pattern.

Kinesis follows this pattern as well.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@codecov-io
Copy link

Codecov Report

Merging #1821 into master will increase coverage by 0.01%.
The diff coverage is 93.10%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1821      +/-   ##
============================================
+ Coverage     76.24%   76.25%   +0.01%     
  Complexity      187      187              
============================================
  Files          1072     1072              
  Lines         32404    32375      -29     
  Branches       2541     2527      -14     
============================================
- Hits          24706    24689      -17     
+ Misses         6443     6432      -11     
+ Partials       1255     1254       -1     
Flag Coverage Δ Complexity Δ
#unittests 76.25% <93.10%> (+0.01%) 187.00 <0.00> (ø)
Impacted Files Coverage Δ Complexity Δ
...n/awssdk/enhanced/dynamodb/DynamoDbAsyncTable.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
.../amazon/awssdk/enhanced/dynamodb/EnhancedType.java 69.90% <ø> (ø) 0.00 <0.00> (ø)
...al/converter/attribute/EnumAttributeConverter.java 94.11% <ø> (ø) 0.00 <0.00> (ø)
...al/converter/attribute/ListAttributeConverter.java 90.69% <ø> (ø) 0.00 <0.00> (ø)
...nal/converter/attribute/MapAttributeConverter.java 72.72% <ø> (ø) 0.00 <0.00> (ø)
...nal/converter/attribute/SetAttributeConverter.java 88.88% <ø> (ø) 0.00 <0.00> (ø)
...ssdk/enhanced/dynamodb/mapper/BeanTableSchema.java 85.12% <ø> (ø) 0.00 <0.00> (ø)
...ssdk/enhanced/dynamodb/mapper/StaticAttribute.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
...dk/enhanced/dynamodb/mapper/StaticTableSchema.java 90.17% <ø> (ø) 0.00 <0.00> (ø)
...n/awssdk/enhanced/dynamodb/model/PageIterable.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
... and 66 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7b2909...638341a. Read the comment docs.

@millems millems merged commit f6e3d9f into aws:master May 13, 2020
@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.25%. Comparing base (abab62e) to head (638341a).
Report is 11906 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1821      +/-   ##
============================================
- Coverage     76.29%   76.25%   -0.04%     
  Complexity      187      187              
============================================
  Files          1074     1072       -2     
  Lines         32450    32375      -75     
  Branches       2550     2527      -23     
============================================
- Hits          24759    24689      -70     
+ Misses         6438     6432       -6     
- Partials       1253     1254       +1     
Flag Coverage Δ
unittests 76.25% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants