feat(location): support GeofenceCollection#30711
Conversation
b9886ce to
4ea0ec1
Compare
4ea0ec1 to
4b80527
Compare
lpizzinidev
left a comment
There was a problem hiding this comment.
Thanks 👍 Left some comments for minor adjustments
packages/@aws-cdk/aws-location-alpha/lib/geofence-collection.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
…into location-geofence
|
@lpizzinidev |
packages/@aws-cdk/aws-location-alpha/lib/geofence-collection.ts
Outdated
Show resolved
Hide resolved
|
|
||
| constructor(scope: Construct, id: string, props: GeofenceCollectionProps = {}) { | ||
|
|
||
| if (props.description && !Token.isUnresolved(props.geofenceCollectionName) && props.description.length > 1000) { |
There was a problem hiding this comment.
| if (props.description && !Token.isUnresolved(props.geofenceCollectionName) && props.description.length > 1000) { | |
| if (props.description !== undefined && !Token.isUnresolved(props.description) && props.description.length < 0 && props.description.length > 1000) { |
Your implementation is not validating description: "".
Can you please add test coverage for the specific case as well?
There was a problem hiding this comment.
Thanks.
- I implemented the validation as follows. Since
lengthis 0 or greater, I thought the conditionlength < 0might be unnecessary. If my understanding is incorrect, please let me know.
- I also added the case of
description: ""to the unit tests. Furthermore, I confirmed that deployment is possible as follows.
There was a problem hiding this comment.
You're right, I messed up 😄 Thanks for double-checking!
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
|
@lpizzinidev |
packages/@aws-cdk/aws-location-alpha/lib/geofence-collection.ts
Outdated
Show resolved
Hide resolved
4d72eaf to
ad28fb4
Compare
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
ad28fb4 to
1eb8ff9
Compare
aws-cdk-automation
left a comment
There was a problem hiding this comment.
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.
…x class (#30974) ### Issue # (if applicable) N/A ### Reason for this change Add validation for PlaceIndex description, similar to #30648, #30682, and #30711 . ### Description of changes Add validation and unit tests for description. ### Description of how you validated changes Add unit tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
| readonly kmsKey?: kms.IKey; | ||
| } | ||
|
|
||
| abstract class GeofenceCollectionBase extends Resource implements IGeofenceCollection { |
There was a problem hiding this comment.
What's the reasoning behind creating a base class when it's only inherited by one class? Do you foresee another class extending this abstract class?
There was a problem hiding this comment.
This is because the already implemented PlaceIndex class has a base class. I don't know if more classes will be added in the future, but I'm doing this to maintain consistency within the package.
I'd appreciate your opinion on this if you have any.
There was a problem hiding this comment.
I personally don't see the purpose of having a separate base class. I would recommend to just use one class instead. Otherwise the PR LGTM.
There was a problem hiding this comment.
@GavinZZ
Thanks. I've removed the based class.
Would you please review again?
|
@GavinZZ |
GavinZZ
left a comment
There was a problem hiding this comment.
LGTM, thank you making the changes
|
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). |
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. |
Issue # (if applicable)
Closes #30710.
Reason for this change
To support L2 level geofence collection.
Description of changes
Add
Geofence Collectionclass.Description of how you validated changes
Add unit tests and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license