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 request ID to response headers #2438

Merged
merged 24 commits into from
Mar 23, 2023
Merged

Add request ID to response headers #2438

merged 24 commits into from
Mar 23, 2023

Conversation

82marbag
Copy link
Contributor

@82marbag 82marbag commented Mar 7, 2023


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

@82marbag 82marbag requested a review from a team as a code owner March 7, 2023 11:10
@82marbag 82marbag requested a review from a team as a code owner March 7, 2023 11:59
@smithy-lang smithy-lang deleted a comment from github-actions bot Mar 7, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Mar 7, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Mar 7, 2023
@smithy-lang smithy-lang deleted a comment from github-actions bot Mar 7, 2023
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python

A new doc preview is ready to view.

@82marbag 82marbag force-pushed the request-id-response-headers branch 2 times, most recently from 0b817b9 to 147eef2 Compare March 13, 2023 13:27
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
82marbag and others added 11 commits March 22, 2023 12:26
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@82marbag 82marbag force-pushed the request-id-response-headers branch from 733701a to a244b9d Compare March 22, 2023 11:42
```
"""
references = ["smithy-rs#2438"]
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "server"}
Copy link
Contributor

@hlbarber hlbarber Mar 22, 2023

Choose a reason for hiding this comment

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

Technically, this is a breaking change:

- type Future = S::Future;
+ type Future = ServerRequestIdResponseFuture<S::Future>;

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python

A new doc preview is ready to view.

Comment on lines 20 to 22
//! To optionally add the [`ServerRequestId`] to the response headers, use [`ServerRequestIdProviderLayer::new_with_response_header`].
//! Use [`ServerRequestIdProviderLayer::new`] to use [`ServerRequestId`] in your handler.
//! Use [`ServerRequestIdProviderLayer::new_with_response_header`] to use [`ServerRequestId`] in your handler and add it to the response headers.
Copy link
Contributor

Choose a reason for hiding this comment

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

We speak of the fact that the server request id can be returned to the caller a couple of paragraphs above, I think it makes sense to mention the relevant constructor there.

pub struct ServerRequestIdProviderLayer;
pub struct ServerRequestIdProviderLayer {
header_key: Option<HeaderName>,
}

impl ServerRequestIdProviderLayer {
/// Generate a new unique request ID
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd update this to mention this other constructor and explain that it won't add it to the response headers (and vice versa in the docs for the other method).

Copy link
Contributor

@LukeMathWalker LukeMathWalker left a comment

Choose a reason for hiding this comment

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

A couple of docs comments, good to go otherwise!

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python

A new doc preview is ready to view.

Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
@82marbag 82marbag enabled auto-merge March 22, 2023 16:36
@82marbag 82marbag disabled auto-merge March 22, 2023 16:42
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python

A new doc preview is ready to view.

@82marbag 82marbag added this pull request to the merge queue Mar 23, 2023
@82marbag 82marbag merged commit d89a90d into main Mar 23, 2023
@82marbag 82marbag deleted the request-id-response-headers branch March 23, 2023 09:45
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.

3 participants