-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[ESM] Validate event sources existence #12297
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
Conversation
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.
Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
a2099ce
to
a276f47
Compare
a276f47
to
c8501c4
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.
Hello @eLRuLL and thanks a lot for your contribution!
Nice extra validation of Event Source Mappings! 🚀 this will help users by failing early in the process, and provide more clarity.
It seems it broke the behavior of Event Source Mappings: there are 43 broken integration tests, and another one in bootstrap that also seems related to the change: it looks like it is not possible to create new valid Event Source Mapping of certain type anymore.
I also have comments about the access to other services, we usually tend to manage inter-service communication via the connect_to
utility, so that we have clear boundaries between services.
The tests also do not use the snapshot
fixture and it would be great to add it, as it provides a little bit extra parity at no cost.
Thanks again for the contribution!
tests/aws/services/lambda_/event_source_mapping/test_lambda_integration_dynamodbstreams.py
Outdated
Show resolved
Hide resolved
tests/aws/services/lambda_/event_source_mapping/test_lambda_integration_kinesis.py
Outdated
Show resolved
Hide resolved
d159d26
to
263e556
Compare
7e89ffb
to
895fb97
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 for jumping on the comment to fix them! This is really nice, and no tests are broken now! Nice 🚀
Very nice use of the snapshots too!
I just have a few comments: one regarding the creation of the internal client, that misses a bit of internal metadata in order to properly identify the request internally, so we can properly verify permission when LOCALSTACK_ENFORCE_IAM
is enabled.
Another comment is regarding the SQS operation used to verify the queue existence. It seems AWS is using a different operation (this needed a bit of investigation which is not too clear on AWS side sadly!)
We could also re-use the exception raised by SQS to return the error message in order to rely on SQS sending us the right error message, as it seems passed as-is by AWS too.
I believe we will be good to go once this is addressed! Thanks again, this is looking great!
tests/aws/services/lambda_/event_source_mapping/test_lambda_integration_dynamodbstreams.py
Show resolved
Hide resolved
895fb97
to
ce759dd
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.
LGTM! Thanks a lot for addressing the comments, this looks great and very streamlined.
I'd like to get @joe4dev approval on this as he is one of the owners of Lambda and I wouldn't want to miss something, but to me this looks good to go! 🚀
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.
Thank you for improving the DevX around Lambda Event Source mappings and dilligently addressing @bentsku comments 👏👏👏
It's so much clearer to catch issues early rather than allowing for creating broken ESMs 🚀
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.
Appreciate your contribution to the Lambda ESM validation!
Motivation
This PR allows for the ESM to validate the existence of different event source resources
Changes
Testing
test_esm_with_not_existing_sqs_queue
test inside thetest_lambda_integration_sqs.py
tests