-
Notifications
You must be signed in to change notification settings - Fork 4k
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(validation): shared interface to notify user of all validation issues when initializing a new RDS DB Cluster or SQS Queue #32841
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
@@ -2093,30 +2172,6 @@ describe('cluster', () => { | |||
}); | |||
}); | |||
|
|||
test('throws if performanceInsightRetention is set but performance insights is disabled', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two tests did the same thing (as implemented), removed them here and moved to line 567.
}).toThrow('Aurora Limitless Database requires I/O optimized storage type, got: aurora'); | ||
}); | ||
|
||
test.each([[], undefined])('throw error for invalid cloudwatch log exports', (cloudwatchLogsExports) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested at line 584.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32841 +/- ##
==========================================
- Coverage 81.48% 81.45% -0.04%
==========================================
Files 226 227 +1
Lines 13768 13776 +8
Branches 2416 2417 +1
==========================================
+ Hits 11219 11221 +2
- Misses 2271 2277 +6
Partials 278 278
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this 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.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption Request: unit test changes provide coverage for single and multiple errors returned, no README changes are needed as the effects of this change will be intuitive to users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two pieces of feedback:
- Can you please change this to use
ValidationError
? We are currently starting a migration of all error types to the newValidationError
. You could not have known that. But would be good to get started on it. - This is great progress towards a more generic validation system. Good stuff! However I think we already should be aiming much higher and make this a generic (private) feature in core, so that all our constructs can you use this.
First one is an easy change and I will implement this. For your second point, are you suggesting to generalize But I worry this might be too abstracted. We have different rules for standard and limitless database initializations, and offering flexibility in an abstraction might make a generalized function more difficult to use. Happy to hear your thoughts on this. |
If I understand the PR correctly, you are introducing a feature that allows a construct to declare a number if rules that can be validated independently from each other. If any of the rules fails, the construct will throw a validation error with all failing rules. I think this a feature that would benefit other constructs as well and is worth generalizing.
That's a good concern, and we will have to make sure the API is easy enough to understand. I agree, this PR feels complex because you are starting from the list of all possible rules and then run some filters to only pick the applicable ones. That part I think can be kept local to the RDS DB Cluster. |
…is interface for SQS and RDS props validation.
8aef9e4
to
16787f0
Compare
The pull request linter fails with the following errors:
PRs must pass status checks before we can provide a meaningful review. If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing ✅ A exemption request has been requested. Please wait for a maintainer's review. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue #32840
Closes #32840
Reason for this change
When initializing a new RDS DB Cluster, the current implementation fails on the first validation error, making it possible for the user to encounter another failure after fixing known validation issues.
The same holds true for new SQS Queue props validation.
Description of changes
Implemented a validation function that collects all validation errors and presents them to the user.
Describe any new or updated permissions being added
No permissions changes.
Description of how you validated changes
Added unit tests and modified existing unit tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license