-
Notifications
You must be signed in to change notification settings - Fork 4k
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(lambda): fix so that the commandHook
function is called only once during bundling.
#32776
base: main
Are you sure you want to change the base?
fix(lambda): fix so that the commandHook
function is called only once during bundling.
#32776
Conversation
Fix so that the
commandHook` function is called only once during bundling.commandHook
function is called only once during bundling.
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.
commandHook
function is called only once during bundling.commandHook
function is called only once during bundling.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
@Mergifyio update |
✅ Branch has been successfully updated |
commandHook
function is called only once during bundling.commandHook
function is called only once during bundling.
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.
commandHook
function is called only once during bundling.commandHook
function is called only once during bundling.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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 👍
A couple of comments:
- I'd classify the PR as a
fix(lambda)
instead of achore
(that will require an integration test update as well to verify the change) - Do we need to fix the behavior for Python runtimes as well?
commandHook
function is called only once during bundling.commandHook
function is called only once during bundling.
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.
The pull request linter fails with the following errors:
PRs must pass status checks before we can provide a meaningful review. If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing |
Thank you for the review! 👍
I fixed the PR title. Thanks. I have a question about integration testing. a. Deploy the Lambda stack and confirm that the In the case of a, I'm wondering how to test it. Can I use
I think this logic is unnecessary for the Python runtime because there is no distinction between Docker bundling and Local bundling. |
@ayame113 Thanks for the follow up 👍
Looking at the docs, following
I guess an update/re-run to this Node test and this GO test should be enough. |
Thanks for the clarification! 👍 Please let me know if there are any other changes that should be added.
|
@ayame113
Can we use an |
This is my first contribution to aws-cdk! So please let me know if I'm doing something wrong.
Issue # (if applicable)
Closes #31973.
Reason for this change
When using local bundling, the
commandHook
function was being called twice.This PR fixes it so that it is only called once.
Description of changes
When the variable
shouldBuildImage
is true, acreateBundlingCommand
for the Docker build will be created as before.When the variable
shouldBuildImage
is false, acreateBundlingCommand
for the local build will be created whenbundler.local.tryBundle()
is called. (Previously, both acreateBundlingCommand
for the Docker build and for the local build were created.)After making this change, some tests failed because they were expecting the
createBundlingCommand
to be called immediately, so I addedforcedDockerBundling: true
to some of the tests.Note: I was going to send a patch to aws-cdk-lib, but I found a similar code in aws-lambda-go-alpha, so I fixed it at the same time. Is that okay?
Description of how you validated changes
I've added a unit test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license