-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(location): support GeofenceCollection #30711
Conversation
b9886ce
to
4ea0ec1
Compare
4ea0ec1
to
4b80527
Compare
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 👍 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
- I implemented the validation as follows. Since
length
is 0 or greater, I thought the conditionlength < 0
might be unnecessary. If my understanding is incorrect, please let me know.
if (props.description !== undefined && !Token.isUnresolved(props.description) && props.description.length > 1000) { |
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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 👍
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
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GavinZZ
Thanks. I've removed the based class.
Would you please review again?
@GavinZZ |
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 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 Collection
class.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