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

fix(ecs-patterns): add validation for queue and queue related props #21717

Merged
merged 6 commits into from
Aug 30, 2022

Conversation

rajyan
Copy link
Contributor

@rajyan rajyan commented Aug 23, 2022

Problem

When queue construct is set, queue related props (maxReceiveCount, visibilityTimeout, retentionPeriod) have no effect to the queue of the QueueProcessingService. I think this is a reasonable behavior, but it is difficult to notice when wrongly configured.

Fix

This pull request adds a validation to prevent from setting both queue and queue related props at the same time, and notice users the configuration error. Also, updates the param docs for this behavior.


All Submissions:

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

…riod, visibilityTimeout and maxReceiveCount have no effect when queue is specified.
@gitpod-io
Copy link

gitpod-io bot commented Aug 23, 2022

@github-actions github-actions bot added the p2 label Aug 23, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team August 23, 2022 01:07
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! We need tests for this change before we can provide a meaningful review.

Comment on lines 294 to 295
if (props.queue && (props.retentionPeriod || props.visibilityTimeout || props.maxReceiveCount)) {
throw new Error('retentionPeriod, visibilityTimeout and maxReceiveCount can be set only when queue is not set. Specify them in the QueueProps of the queue');
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably have different error messages depending on which prop is provided that shouldn't be. It may be confusing if all are listed and a customer hasn't provided them all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much for your quick reviews!
Added some unit tests and fixed the error messages.

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review August 24, 2022 01:39

Pull request has been modified.

@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Aug 30, 2022

update

✅ Branch has been successfully updated

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.

Looks great! Thanks!

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@mergify
Copy link
Contributor

mergify bot commented Aug 30, 2022

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).

@mergify mergify bot merged commit 7e9bd7d into aws:main Aug 30, 2022
josephedward pushed a commit to josephedward/aws-cdk that referenced this pull request Aug 30, 2022
…ws#21717)

## Problem

When queue construct is set, queue related props (maxReceiveCount, visibilityTimeout, retentionPeriod) have no effect to the queue of the `QueueProcessingService`. I think this is a reasonable behavior, but it is difficult to notice when wrongly configured.

## Fix

This pull request adds a validation to prevent from setting both queue and queue related props at the same time, and notice users the configuration error. Also, updates the param docs for this behavior.

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)


*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@rajyan rajyan deleted the fix/queue-processing-service-validation branch October 1, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants