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

feat(apigatewayv2): allow websockets routes to return response to client #22984

Merged
merged 10 commits into from
Feb 18, 2023

Conversation

emilrowland
Copy link
Contributor

@emilrowland emilrowland commented Nov 18, 2022

This PR allows WebSocket routes to return a response to the client.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Nov 18, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team November 18, 2022 20:07
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Nov 18, 2022
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@aws-cdk-automation aws-cdk-automation dismissed their stale review November 18, 2022 23:01

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@emilrowland
Copy link
Contributor Author

I had to add an integration test to aws-apigatewayv2-integrations as I couldn't use a Mock integration in aws-apigatewayv2.
This is due to dependency conflicts.

@emilrowland emilrowland requested review from aws-cdk-automation and Naumel and removed request for Naumel and aws-cdk-automation December 15, 2022 18:09
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! Please see my comments inline.

* Should the route send a response to the client
* @default false
*/
readonly returnResponse?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that the way this is being used when it is true, I'm not sure that boolean is the right value here. You're adding $default as the routeResponseSelectionExpression creating a whole object from this . Can you help me understand why a boolean here is the right user experience?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Today the only valid value o the routeResponseSelectionExpression is $default or undefined. So to not overcomplicate it by passing a string I abstracted it to be a boolean instead.

See the quote below from https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html

Evaluation of the route response selection expression produces a route response key. Eventually, this key will be used to choose from one of the RouteResponses associated with the API. However, currently only the $default key is supported.

But if we want to be more future proof we could change the attribute to be the actual routeResponseSelectionExpression and pass it a string.

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review January 27, 2023 17:19

Pull request has been modified.

Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

@emilrowland emilrowland changed the title feat(aws-apigatewayv2): allow websockets routes to return response to client feat(apigatewayv2): allow websockets routes to return response to client Jan 27, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 27, 2023 17:29

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@TheRealAmazonKendra
Copy link
Contributor

TheRealAmazonKendra commented Feb 11, 2023

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Feb 11, 2023

update

❌ Base branch update has failed

refusing to allow a GitHub App to create or update workflow .github/workflows/close-stale-issues.yml without workflows permission
err-code: 77C13

@comcalvi comcalvi added the pr/do-not-merge This PR should not be merged at this time. label Feb 13, 2023
comcalvi
comcalvi previously approved these changes Feb 13, 2023
Copy link
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

lgtm, leaving do-not-merge so @TheRealAmazonKendra can take a look

@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Feb 18, 2023

update

❌ Base branch update has failed

refusing to allow a GitHub App to create or update workflow .github/workflows/issue-label-assign.yml without workflows permission
err-code: 8D750

@mergify mergify bot dismissed comcalvi’s stale review February 18, 2023 06:38

Pull request has been modified.

@TheRealAmazonKendra TheRealAmazonKendra removed the pr/do-not-merge This PR should not be merged at this time. label Feb 18, 2023
@mergify
Copy link
Contributor

mergify bot commented Feb 18, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: bd49362
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit f8fe1d2 into aws:main Feb 18, 2023
@mergify
Copy link
Contributor

mergify bot commented Feb 18, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants