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(applicationautoscaling): typo in DYANMODB_WRITE_CAPACITY_UTILIZATION #18085

Merged
merged 9 commits into from
Jan 14, 2022

Conversation

jumic
Copy link
Contributor

@jumic jumic commented Dec 18, 2021

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 #17209.


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

@gitpod-io
Copy link

gitpod-io bot commented Dec 18, 2021

@github-actions github-actions bot added the @aws-cdk/aws-applicationautoscaling Related to AWS Application Auto Scaling label Dec 18, 2021
Copy link
Contributor

@comcalvi comcalvi left a 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.

Comment on lines 192 to 196
/**
* DYNAMODB_WRITE_CAPACITY_UTILIZATION
* @see https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html
*/
DYNAMODB_WRITE_CAPACITY_UTILIZATION = 'DynamoDBWriteCapacityUtilization',
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed as proposed.

Copy link
Contributor Author

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]

Copy link
Contributor

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:

  1. Change the value of DYNAMODB_WRITE_CAPACITY_UTILIZATION to a dummy value, something like 'DynamoDBWriteCapacityUtilization-dummy'.
  2. 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 (which DYANMODB_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.

Copy link
Contributor Author

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.

@comcalvi comcalvi added the pr-linter/exempt-test The PR linter will not require test changes label Dec 29, 2021
@mergify mergify bot dismissed comcalvi’s stale review December 29, 2021 20:31

Pull request has been modified.

@jumic jumic requested a review from comcalvi December 29, 2021 20:31
Copy link
Contributor

@comcalvi comcalvi left a 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.

@mergify mergify bot dismissed comcalvi’s stale review January 13, 2022 17:12

Pull request has been modified.

@jumic jumic requested a review from comcalvi January 13, 2022 18:46
Copy link
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

LGTM!

@mergify
Copy link
Contributor

mergify bot commented Jan 14, 2022

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 46418fb
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit 626e6aa into aws:master Jan 14, 2022
@mergify
Copy link
Contributor

mergify bot commented Jan 14, 2022

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

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-applicationautoscaling Related to AWS Application Auto Scaling pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-applicationautoscaling): Typo in PredefinedMetric enum
3 participants