-
Notifications
You must be signed in to change notification settings - Fork 4.2k
chore(enum-updater): fix issue with exclusion mechanism + add README #34310
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
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.
Overall looks good, just a few minor nits on README formatting. Requesting changes instead of just a comment because I think we should have unit tests for the exclusion logic so we can confirm the exclusion mechanism works as intended this time.
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 for including in the tests! I noticed there's a bit of a unique implementation for the static-enum-mapping-updater
ones mocking the string split. I have a feeling that there might be a simpler way to implement those checks without going through that approach, but if not, I think we ought to comment in why we're taking that approach instead. I'm happy to discuss other alternative implementations and get this off the ground!
'module1': { | ||
'Enum1': { | ||
cdk_path: 'path/to/enum1', | ||
missing_values: ['VALUE3'] |
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.
I'm noticing this check is consistent with this test, but the other tests are expect(result).toEqual
ing the non-normalized, lowercase value. Wondering if that might cause issues later down the line, and if we should normalize the output of the findMissingValues
method as well. Thoughts?
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.
I think for the purpose of this test which is to check that it is able to identify missing values through normalization, it's fine to leave it as is. I don't expect this test to cause issues later on since the values are being normalized within the method itself.
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.
Fair enough. Future improvement could probably be to validate that final output, but that's out of scope for these changes.
tools/@aws-cdk/enum-updater/test/static-enum-mapping-updater.test.ts
Outdated
Show resolved
Hide resolved
tools/@aws-cdk/enum-updater/test/static-enum-mapping-updater.test.ts
Outdated
Show resolved
Hide resolved
tools/@aws-cdk/enum-updater/test/static-enum-mapping-updater.test.ts
Outdated
Show resolved
Hide resolved
tools/@aws-cdk/enum-updater/test/static-enum-mapping-updater.test.ts
Outdated
Show resolved
Hide resolved
tools/@aws-cdk/enum-updater/test/static-enum-mapping-updater.test.ts
Outdated
Show resolved
Hide resolved
tools/@aws-cdk/enum-updater/test/static-enum-mapping-updater.test.ts
Outdated
Show resolved
Hide resolved
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, thanks!
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This pull request has been removed from the queue for the following reason: The pull request can't be updated. You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Description of changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license