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(cognito): add analyticsConfiguration to UserPoolClient #32862

Merged

Conversation

ren-yamanashi
Copy link
Contributor

Issue # (if applicable)

Closes #32837

Reason for this change

UserPoolClient in Cognito did not support the analyticsConfiguration property.

Description of changes

  • add analytics property to UserPoolClientProps(interface)
  • add validationAnalytics method to UserPoolClient(Class / L2 Construct)

Description of how you validated changes

Added both unit and integration 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 January 12, 2025 09:13
@github-actions github-actions bot added effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK labels Jan 12, 2025
@ren-yamanashi ren-yamanashi changed the title feat: add analyticsConfiguration to UserPoolClient feat(cognito): add analyticsConfiguration to UserPoolClient Jan 12, 2025
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 dismissed their stale review January 12, 2025 09:33

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

Copy link

codecov bot commented Jan 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.83%. Comparing base (51e671f) to head (90b3efe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32862   +/-   ##
=======================================
  Coverage   80.83%   80.83%           
=======================================
  Files         236      236           
  Lines       14253    14253           
  Branches     2490     2490           
=======================================
  Hits        11522    11522           
  Misses       2446     2446           
  Partials      285      285           
Flag Coverage Δ
suite.unit 80.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 79.57% <ø> (ø)
packages/aws-cdk-lib/core 82.20% <ø> (ø)

@ren-yamanashi ren-yamanashi changed the title feat(cognito): add analyticsConfiguration to UserPoolClient feat(cognito): add analyticsConfiguration to UserPoolClient [WIP] Jan 12, 2025
Copy link
Contributor

@wladyslawczyzewski wladyslawczyzewski left a comment

Choose a reason for hiding this comment

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

hi @ren-yamanashi , thank you for this contribution, could you please adjust the validation and tests as described in the comments? thank you in advance!

@@ -618,4 +667,13 @@ export class UserPoolClient extends Resource implements IUserPoolClient {
throw new Error(`${name}: Must be a duration between ${min.toHumanString()} and ${max.toHumanString()} (inclusive); received ${value.toHumanString()}.`);
}
}

private validateAnalytics(analytics: AnalyticsConfiguration) {
Copy link
Contributor

Choose a reason for hiding this comment

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

the CloudFormation expects either ApplicationArn or all of ApplicationId, ExternalId and RoleArn to be provided. Could you please adjust the validation for this?

// resources: [pinpointApp.attrArn],
// }));

new UserPoolClient(stack, 'Client', {
Copy link
Contributor

Choose a reason for hiding this comment

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

cloud you please provide more test cases for 1) providing only ApplicationArn and using the Cognito's service role and 2) providing all of ApplicationId, ExternalId and RoleArn?

@ren-yamanashi
Copy link
Contributor Author

ren-yamanashi commented Jan 12, 2025

hi @ren-yamanashi , thank you for this contribution, could you please adjust the validation and tests as described in the comments? thank you in advance!

@wladyslawczyzewski

Thank you comment !

I will adjust the PR content based on your comment and #32865 🙏.

@aaythapa
Copy link
Contributor

aaythapa commented Feb 4, 2025

@mergify update

Copy link
Contributor

mergify bot commented Feb 4, 2025

update

✅ Branch has been successfully updated

@aaythapa aaythapa self-assigned this Feb 4, 2025
Copy link
Contributor

@aaythapa aaythapa left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! Left some comments, mostly nits and questions I had

@ren-yamanashi
Copy link
Contributor Author

ren-yamanashi commented Feb 6, 2025

@aaythapa

Thanks for your review!

I have fixed, so please confirm.

aaythapa
aaythapa previously approved these changes Feb 6, 2025
Copy link
Contributor

@aaythapa aaythapa left a comment

Choose a reason for hiding this comment

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

Thank you for contributing! Everything LGTM

Copy link
Contributor

mergify bot commented Feb 6, 2025

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
Contributor

mergify bot commented Feb 7, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

Copy link
Contributor

mergify bot commented Feb 7, 2025

refresh

✅ Pull request refreshed

@aaythapa
Copy link
Contributor

aaythapa commented Feb 7, 2025

@mergify requeue

Copy link
Contributor

mergify bot commented Feb 7, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

Copy link
Contributor

mergify bot commented Feb 7, 2025

requeue

✅ The queue state of this pull request has been cleaned. It can be re-embarked automatically

Copy link
Contributor

mergify bot commented Feb 7, 2025

This pull request has been removed from the queue for the following reason: pull request manually updated.

The pull request #32862 has been manually updated

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you need to post a comment with the text: @mergifyio requeue

@mergify mergify bot dismissed aaythapa’s stale review February 7, 2025 06:51

Pull request has been modified.

Copy link
Contributor

mergify bot commented Feb 7, 2025

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

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 90b3efe
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

mergify bot commented Feb 7, 2025

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

@mergify mergify bot merged commit 1c98881 into aws:main Feb 7, 2025
20 checks passed
Copy link

github-actions bot commented Feb 7, 2025

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 Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-cognito): L2 Construct support for analytics configuration
6 participants