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

fix(custom-resources): logApiResponseData is added to custom resource event properties by default #30418

Merged
merged 27 commits into from
Jun 6, 2024

Conversation

colifran
Copy link
Contributor

@colifran colifran commented Jun 1, 2024

Closes #30121, #29949

Reason for this change

PR #29648 introduced a new resource property logApiResponseData. This resource property is true by default which forces an update for AwsCustomResource. For users without onUpdate configured an empty data object is returned if no SDK call is configured. This can cause an attribute error if the user is depending on a data from a specific SDK call.

Description of changes

Made logApiResponseData undefined by default which will not trigger onUpdate. To maintain backwards compatibility with the original PR introducing logApiResponseData as true by default, I've also introduced a feature flag that will allow users to keep the current behavior so they aren't now forced into another onUpdate event.

Description of how you validated changes

Updated unit tests where logApiResponseData was added as a resource property. Added new unit test to verify that logApiResponseData could be added to the event. Updated unit tests that test _render() to ensure that the default case will result in an empty object. Updated integ tests.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
@aws-cdk-automation aws-cdk-automation requested a review from a team June 1, 2024 10:35
@github-actions github-actions bot added bug This issue is a bug. p2 labels Jun 1, 2024
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 1, 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.

Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
@colifran colifran changed the title fix(custom-resources): logApiResponseData is triggers onUpdate by default fix(custom-resources): logApiResponseData triggers onUpdate by default Jun 1, 2024
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 1, 2024 16:47

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

Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
@colifran colifran changed the title fix(custom-resources): logApiResponseData triggers onUpdate by default fix(custom-resources): logApiResponseData is added to custom resource properties by default Jun 1, 2024
Signed-off-by: Francis <colifran@amazon.com>
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 1, 2024
Signed-off-by: Francis <colifran@amazon.com>
@colifran colifran changed the title fix(custom-resources): logApiResponseData is added to custom resource properties by default fix(custom-resources): logApiResponseData is added to custom resource event properties by default Jun 2, 2024
@colifran colifran added the pr/do-not-merge This PR should not be merged at this time. label Jun 4, 2024
Signed-off-by: Francis <colifran@amazon.com>
@colifran colifran self-assigned this Jun 4, 2024
Signed-off-by: Francis <colifran@amazon.com>
@heikkis
Copy link

heikkis commented Jun 5, 2024

Any thoughts if this makes to 2.145 version?

Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
@colifran colifran removed the pr/do-not-merge This PR should not be merged at this time. label Jun 6, 2024
Copy link
Contributor

mergify bot commented Jun 6, 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
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 3df31b0
  • 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 a899ac6 into main Jun 6, 2024
12 checks passed
@mergify mergify bot deleted the colifran/logging branch June 6, 2024 00:41
Copy link
Contributor

mergify bot commented Jun 6, 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).

Leo10Gama pushed a commit to Leo10Gama/aws-cdk that referenced this pull request Jun 11, 2024
…ce event properties by default (aws#30418)

Closes aws#30121, aws#29949

### Reason for this change

PR aws#29648 introduced a new resource property `logApiResponseData`. This resource property is `true` by default which forces an update for `AwsCustomResource`. For users without `onUpdate` configured an empty data object is returned if no SDK call is configured. This can cause an attribute error if the user is depending on a data from a specific SDK call.

### Description of changes

Made `logApiResponseData` undefined by default which will not trigger `onUpdate`. To maintain backwards compatibility with the original PR introducing `logApiResponseData` as true by default, I've also introduced a feature flag that will allow users to keep the current behavior so they aren't now forced into another `onUpdate` event.

### Description of how you validated changes

Updated unit tests where `logApiResponseData` was added as a resource property. Added new unit test to verify that `logApiResponseData` could be added to the event. Updated unit tests that test `_render()` to ensure that the default case will result in an empty object. Updated integ 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*
mazyu36 pushed a commit to mazyu36/aws-cdk that referenced this pull request Jun 22, 2024
…ce event properties by default (aws#30418)

Closes aws#30121, aws#29949

### Reason for this change

PR aws#29648 introduced a new resource property `logApiResponseData`. This resource property is `true` by default which forces an update for `AwsCustomResource`. For users without `onUpdate` configured an empty data object is returned if no SDK call is configured. This can cause an attribute error if the user is depending on a data from a specific SDK call.

### Description of changes

Made `logApiResponseData` undefined by default which will not trigger `onUpdate`. To maintain backwards compatibility with the original PR introducing `logApiResponseData` as true by default, I've also introduced a feature flag that will allow users to keep the current behavior so they aren't now forced into another `onUpdate` event.

### Description of how you validated changes

Updated unit tests where `logApiResponseData` was added as a resource property. Added new unit test to verify that `logApiResponseData` could be added to the event. Updated unit tests that test `_render()` to ensure that the default case will result in an empty object. Updated integ 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*
@aws-cdk-automation
Copy link
Collaborator

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.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

custom-resources: PR:29648 caused Custom resources to be replaced
6 participants