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(rds): clusterScailabilityType is spelled wrong and should be clusterScalabilityType #32825

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iankhou
Copy link
Contributor

@iankhou iankhou commented Jan 9, 2025

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.

# in packages/aws-cdk-lib
yarn test aws-rds
Screenshot 2025-01-09 at 16 10 04

Ran the relevant integration test.

# in packages/@aws-cdk-testing/framework-integ
yarn integ test/aws-rds/test/integ.cluster-limitless.js
Screenshot 2025-01-09 at 17 03 44

Ran Rosetta to verify README changes.

./scripts/run-rosetta.sh

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

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p2 labels Jan 9, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team January 9, 2025 23:25
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 9, 2025
@iankhou iankhou changed the title rds: scalability is spelled wrong chore(rds): clusterScailabilityType is spelled wrong and should be clusterScalabilityType Jan 9, 2025
@iankhou iankhou self-assigned this Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.52%. Comparing base (f63ec29) to head (facddcd).
Report is 1 commits behind head on main.

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           
Flag Coverage Δ
suite.unit 81.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 80.98% <ø> (ø)
packages/aws-cdk-lib/core 82.09% <ø> (ø)

@iankhou iankhou marked this pull request as ready for review January 9, 2025 23:48
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 10, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Comment on lines -805 to +838
if (props.clusterScailabilityType === ClusterScailabilityType.LIMITLESS) {
if (props.clusterScalabilityType === ClusterScalabilityType.LIMITLESS || props.clusterScailabilityType === ClusterScailabilityType.LIMITLESS) {
Copy link
Contributor

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.

Copy link
Contributor Author

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', () => {
Copy link
Contributor

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) => {
  // ...
});

Copy link
Contributor Author

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.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 10, 2025
@iankhou iankhou force-pushed the iankhou-rds-misspelling branch from facddcd to 0b7c820 Compare January 10, 2025 16:20
@iankhou iankhou force-pushed the iankhou-rds-misspelling branch from 0b7c820 to 7328eb6 Compare January 10, 2025 16:28
@@ -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.');
Copy link
Contributor Author

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', () => {
Copy link
Contributor Author

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.

@iankhou iankhou changed the title chore(rds): clusterScailabilityType is spelled wrong and should be clusterScalabilityType fix(rds): clusterScailabilityType is spelled wrong and should be clusterScalabilityType Jan 10, 2025
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.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@rix0rrr rix0rrr added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jan 10, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 10, 2025 16:33

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rds: scalability is spelled wrong
3 participants