-
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(applicationautoscaling): typo in DYANMODB_WRITE_CAPACITY_UTILIZATION
#18085
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.
This looks great! One tiny change and this will be perfect.
/** | ||
* DYNAMODB_WRITE_CAPACITY_UTILIZATION | ||
* @see https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html | ||
*/ | ||
DYNAMODB_WRITE_CAPACITY_UTILIZATION = 'DynamoDBWriteCapacityUtilization', |
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 new property needs to be above the deprecated property (see #17731 for details).
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.
Changed as proposed.
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.
@comcalvi Do you have any ideas how I could fix the build error? Value DYANMODB_WRITE_CAPACITY_UTILIZATION
was not removed. Is there something wrong with the validation? Thanks.
@aws-cdk/aws-applicationautoscaling... CHANGES.
Original assembly: @aws-cdk/aws-applicationautoscaling@1.137.0
Updated assembly: @aws-cdk/aws-applicationautoscaling@0.0.0
API elements with incompatible changes:
err - ENUM VALUE @aws-cdk/aws-applicationautoscaling.PredefinedMetric.DYANMODB_WRITE_CAPACITY_UTILIZATION: member DYANMODB_WRITE_CAPACITY_UTILIZATION has been removed [removed:@aws-cdk/aws-applicationautoscaling.PredefinedMetric.DYANMODB_WRITE_CAPACITY_UTILIZATION]
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.
@jumic I was mistaken about the effects of the above-mentioned jsii bug. It turns out that because only the first enum member is accepted, the second one is entirely removed from the jsii assembly, which is equivalent to deleting it; this results in a breaking change.
The only way to truly fix this is to give the new enum a dummy value that will be replaced by the correct value whenever it's used. We can do this as follows:
- Change the value of
DYNAMODB_WRITE_CAPACITY_UTILIZATION
to a dummy value, something like'DynamoDBWriteCapacityUtilization-dummy'
. - Anytime the props are used to assign a value (pretty sure here is the only spot), add a check (
if
statement or ternary operator, preferably) to find the dummy value and replace it with the correct value (whichDYANMODB_WRITE_CAPACITY_UTILIZATION
will have).
Would you be willing to make those changes? It's totally fine if you're not, this is a good bit more work than this change should be.
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.
@comcalvi Thanks, this fixed the build.
I also added a test case for this special logic. I hope this is okay.
Pull request has been modified.
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.
Very nice work! Two minor comments and this should be perfect.
packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts
Show resolved
Hide resolved
packages/@aws-cdk/aws-applicationautoscaling/test/target-tracking.test.ts
Outdated
Show resolved
Hide resolved
Pull request has been modified.
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.
LGTM!
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…TION` (aws#18085) Enum value `DYANMODB_WRITE_CAPACITY_UTILIZATION` in `PredefinedMetric` has a typo in `DYANMODB`. This PR deprecates this value and adds the new value `DYNAMODB_WRITE_CAPACITY_UTILIZATION`. I think we don't need to add a test case to this PR. Please add the label `pr-linter/exempt-test` if you agree. Fixes aws#17209. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Enum value
DYANMODB_WRITE_CAPACITY_UTILIZATION
inPredefinedMetric
has a typo inDYANMODB
.This PR deprecates this value and adds the new value
DYNAMODB_WRITE_CAPACITY_UTILIZATION
.I think we don't need to add a test case to this PR. Please add the label
pr-linter/exempt-test
if you agree.Fixes #17209.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license