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

feat(location): support GeofenceCollection #30711

Merged
merged 15 commits into from
Aug 29, 2024
Merged

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented Jun 30, 2024

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

@aws-cdk-automation aws-cdk-automation requested a review from a team June 30, 2024 08:01
@github-actions github-actions bot added star-contributor [Pilot] contributed between 25-49 PRs to the CDK feature-request A feature should be added or improved. p2 labels Jun 30, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 30, 2024
This was referenced Jul 1, 2024
Copy link
Contributor

@lpizzinidev lpizzinidev left a 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

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jul 28, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jul 28, 2024

@lpizzinidev
Thank you for the review!
I've addressed all your comments.

@mazyu36 mazyu36 requested a review from lpizzinidev July 28, 2024 15:24

constructor(scope: Construct, id: string, props: GeofenceCollectionProps = {}) {

if (props.description && !Token.isUnresolved(props.geofenceCollectionName) && props.description.length > 1000) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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?

Copy link
Contributor Author

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 condition length < 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.
image

Copy link
Contributor

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!

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jul 29, 2024

@lpizzinidev
Thank you for the review.
I've fixed.

@mazyu36 mazyu36 requested a review from lpizzinidev July 29, 2024 13:49
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 29, 2024
Co-authored-by: Luca Pizzini <lpizzini7@gmail.com>
@github-actions github-actions bot added the effort/medium Medium work item – several days of effort label Jul 29, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 29, 2024
@mazyu36 mazyu36 changed the title feat(location): Support GeofenceCollection feat(location): support GeofenceCollection Jul 29, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review July 29, 2024 15:54

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jul 29, 2024
mergify bot pushed a commit that referenced this pull request Jul 31, 2024
…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 {
Copy link
Contributor

@GavinZZ GavinZZ Aug 27, 2024

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?

Copy link
Contributor Author

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.

https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-location-alpha/lib/place-index.ts#L95

Copy link
Contributor

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.

Copy link
Contributor Author

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?

packages/@aws-cdk/aws-location-alpha/lib/util.ts Outdated Show resolved Hide resolved
@GavinZZ GavinZZ self-assigned this Aug 27, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 27, 2024
@mergify mergify bot dismissed GavinZZ’s stale review August 28, 2024 00:03

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 28, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Aug 28, 2024

@GavinZZ
Thank you for the review.
I've addressed all your comments.

@mazyu36 mazyu36 requested a review from GavinZZ August 28, 2024 00:37
@mazyu36 mazyu36 mentioned this pull request Aug 29, 2024
1 task
Copy link
Contributor

@GavinZZ GavinZZ left a 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

Copy link
Contributor

mergify bot commented Aug 29, 2024

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-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 29, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0270867
  • 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 04d73ac into aws:main Aug 29, 2024
12 checks passed
Copy link
Contributor

mergify bot commented Aug 29, 2024

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

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2024
@mazyu36 mazyu36 deleted the location-geofence branch August 29, 2024 22:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-location-alpha: support L2 Geofence Collection Construct
4 participants