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

Merge request and response types #569

Merged
merged 9 commits into from
Jul 28, 2023
Merged

Merge request and response types #569

merged 9 commits into from
Jul 28, 2023

Conversation

adam-fowler
Copy link
Member

AWSRequest and AWSHTTPRequest have been merged to AWSHTTPRequest
AWSResponse and AWSHTTPResponse have been merged to AWSHTTPResponse

As request doesn't include some information it had before which was used in middleware this has been moved to the middleware context.

@adam-fowler adam-fowler requested a review from 0xTim July 21, 2023 13:37
@codecov
Copy link

codecov bot commented Jul 21, 2023

Codecov Report

Merging #569 (1fc2fb5) into 7.x.x (15744ff) will decrease coverage by 0.02%.
Report is 21 commits behind head on 7.x.x.
The diff coverage is 85.13%.

@@            Coverage Diff             @@
##            7.x.x     #569      +/-   ##
==========================================
- Coverage   78.87%   78.86%   -0.02%     
==========================================
  Files          71       73       +2     
  Lines        6292     6467     +175     
==========================================
+ Hits         4963     5100     +137     
- Misses       1329     1367      +38     
Files Changed Coverage Δ
.../SotoCore/Concurrency/Sequence+concurrentMap.swift 98.36% <ø> (ø)
...urces/SotoCore/Credential/Credential+IsEmpty.swift 100.00% <ø> (ø)
.../SotoCore/Credential/CredentialProviderError.swift 100.00% <ø> (ø)
...urces/SotoCore/Credential/ExpiringCredential.swift 0.00% <0.00%> (ø)
...Core/Credential/StaticCredential+Environment.swift 100.00% <ø> (ø)
Sources/SotoCore/Doc/AWSShape.swift 50.72% <0.00%> (ø)
...Core/Encoder/CodableProperties/EC2ArrayCoder.swift 0.00% <0.00%> (ø)
Sources/SotoCore/Errors/Error.swift 66.66% <0.00%> (ø)
...toCore/Message/Middleware/TreeHashMiddleware.swift 75.60% <0.00%> (ø)
Sources/SotoSignerV4/signer.swift 97.34% <ø> (ø)
... and 42 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

LGTM - couple of nits

Sources/SotoCore/AWSClient.swift Outdated Show resolved Hide resolved
Sources/SotoCore/HTTP/AWSHTTPResponse.swift Outdated Show resolved Hide resolved
Sources/SotoCore/HTTP/AWSHTTPResponse.swift Outdated Show resolved Hide resolved
@@ -576,52 +576,6 @@ class AWSClientTests: XCTestCase {
}
}

/// verify we are not calling the Retry handler when streaming a request
func testDontRetryStreamingRequests() async {
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming we don't need this test anymore? I can't see it transferred anywhere

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes we don't need it anymore. Previously I couldn't run retry on streamed responses because they called a callback for each data chunk. If you retried the request you could be sending the same data twice. Now we return the header and an async sequence with the body data and this is no longer a concern.

You can see in AWSClient.swift line 451 the related code has been deleted

@adam-fowler adam-fowler merged commit 6355a56 into 7.x.x Jul 28, 2023
@adam-fowler adam-fowler deleted the merge-request-response branch July 28, 2023 14:39
adam-fowler added a commit that referenced this pull request Jul 29, 2023
* reorder execute

* process response in execute

* Collapse AWSHTTPResponse and AWSResponse into one

* Collpase AWSRequest and AWSHTTPRequest into one

* Add HTTP to request and response type names

* Remove new middleware until we need it

No need to include in this PR

* Remove re-org to make PR review easier

* Changes from PR comments

* Another fix
adam-fowler added a commit that referenced this pull request Aug 12, 2023
* reorder execute

* process response in execute

* Collapse AWSHTTPResponse and AWSResponse into one

* Collpase AWSRequest and AWSHTTPRequest into one

* Add HTTP to request and response type names

* Remove new middleware until we need it

No need to include in this PR

* Remove re-org to make PR review easier

* Changes from PR comments

* Another fix
adam-fowler added a commit that referenced this pull request Dec 24, 2023
* reorder execute

* process response in execute

* Collapse AWSHTTPResponse and AWSResponse into one

* Collpase AWSRequest and AWSHTTPRequest into one

* Add HTTP to request and response type names

* Remove new middleware until we need it

No need to include in this PR

* Remove re-org to make PR review easier

* Changes from PR comments

* Another fix
adam-fowler added a commit that referenced this pull request Apr 5, 2024
* reorder execute

* process response in execute

* Collapse AWSHTTPResponse and AWSResponse into one

* Collpase AWSRequest and AWSHTTPRequest into one

* Add HTTP to request and response type names

* Remove new middleware until we need it

No need to include in this PR

* Remove re-org to make PR review easier

* Changes from PR comments

* Another fix
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