-
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
fix(rds): clusterScailabilityType is spelled wrong and should be clusterScalabilityType #32825
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32825 +/- ##
=======================================
Coverage 81.52% 81.52%
=======================================
Files 222 222
Lines 13717 13717
Branches 2417 2417
=======================================
Hits 11183 11183
Misses 2254 2254
Partials 280 280
Flags with carried forward coverage won't be shown. Click here to find out more.
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
if (props.clusterScailabilityType === ClusterScailabilityType.LIMITLESS) { | ||
if (props.clusterScalabilityType === ClusterScalabilityType.LIMITLESS || props.clusterScailabilityType === ClusterScailabilityType.LIMITLESS) { |
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.
Also needs a check to ensure that you can't set both the old and new property at the same time. And that should be mentioned in the docstring as well.
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.
Thanks, will make this change.
@@ -419,6 +440,240 @@ describe('cluster new api', () => { | |||
}); | |||
}); | |||
|
|||
describe('limitless database', () => { |
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.
Lotsa new tests for a simple feature? Copy/paste or GenAI?
I'd rather turn existing tests into data-driven tests for both ways of passing props.
test.each([
{ clusterScailabilityType: ClusterScailabilityType.LIMITLESS },
{ clusterScalabilityType: ClusterScalabilityType.LIMITLESS },
])('my test with input %p, (partialProps) => {
// ...
});
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 intention was to duplicate the existing tests to take either the misspelled or the corrected name (and to remove the tests for the misspelling after the MV bump). Will look into refactoring them so that we don't have so much extra code.
facddcd
to
0b7c820
Compare
0b7c820
to
7328eb6
Compare
@@ -701,6 +730,10 @@ abstract class DatabaseClusterNew extends DatabaseClusterBase { | |||
constructor(scope: Construct, id: string, props: DatabaseClusterBaseProps) { | |||
super(scope, id); | |||
|
|||
if (props.clusterScalabilityType !== undefined && props.clusterScailabilityType !== undefined) { | |||
throw new Error('You cannot specify both clusterScalabilityType and clusterScailabilityType (deprecated). Use clusterScalabilityType.'); |
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.
@rix0rrr here I disallow both options to be set.
@@ -165,7 +187,10 @@ describe('cluster new api', () => { | |||
}); | |||
}); | |||
|
|||
test('cluster scalability option', () => { |
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.
@rix0rrr Extended our existing tests to check both the misspelled option and the correct option, for STANDARD and LIMITLESS database cluster types.
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.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Issue #32415
Closes #32415 .
Reason for this change
Misspelling of the
ClusterScalabilityType
type, enum, and prop.Description of changes
Deprecated misspellings of ClusterScailabilityType/clusterScailabilityType and aliased the misspelling for backwards compatibility. The misspelled name will be removed in the next MV release.
Describe any new or updated permissions being added
No permissions changes.
Description of how you validated changes
Added unit tests for the new spelling (ClusterScalabilityType/clusterScalabilityType), and kept unit tests that tested the misspelling.
Ran the relevant integration test.
# in packages/@aws-cdk-testing/framework-integ yarn integ test/aws-rds/test/integ.cluster-limitless.js
Ran Rosetta to verify README changes.
No complications from README changes in these commits.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license